mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 18:25:19 +00:00
Remove "street" location channel; add coverage + names; style mesh
- Drop GeohashChannelLevel.street and update mappings/tests\n- Map geohash lengths >=8 to Block in teleport, no Street\n- Show ~distance coverage (mi/km via Locale.measurementSystem) next to each #geohash\n- Add reverse geocoding to display coarse names (country/region/city/neighborhood) per level\n- Style "#mesh" row title with toolbar blue\n- Fix iOS 16 deprecation: use Locale.measurementSystem
This commit is contained in:
@@ -6,14 +6,12 @@ final class LocationChannelsTests: XCTestCase {
|
||||
// Sanity: known coords (Statue of Liberty approx)
|
||||
let lat = 40.6892
|
||||
let lon = -74.0445
|
||||
let street = Geohash.encode(latitude: lat, longitude: lon, precision: GeohashChannelLevel.street.precision)
|
||||
let block = Geohash.encode(latitude: lat, longitude: lon, precision: GeohashChannelLevel.block.precision)
|
||||
let neighborhood = Geohash.encode(latitude: lat, longitude: lon, precision: GeohashChannelLevel.neighborhood.precision)
|
||||
let city = Geohash.encode(latitude: lat, longitude: lon, precision: GeohashChannelLevel.city.precision)
|
||||
let region = Geohash.encode(latitude: lat, longitude: lon, precision: GeohashChannelLevel.region.precision)
|
||||
let country = Geohash.encode(latitude: lat, longitude: lon, precision: GeohashChannelLevel.country.precision)
|
||||
|
||||
XCTAssertEqual(street.count, 8)
|
||||
XCTAssertEqual(block.count, 7)
|
||||
XCTAssertEqual(neighborhood.count, 6)
|
||||
XCTAssertEqual(city.count, 5)
|
||||
@@ -21,7 +19,6 @@ final class LocationChannelsTests: XCTestCase {
|
||||
XCTAssertEqual(country.count, 2)
|
||||
|
||||
// All prefixes must match progressively
|
||||
XCTAssertTrue(street.hasPrefix(block))
|
||||
XCTAssertTrue(block.hasPrefix(neighborhood))
|
||||
XCTAssertTrue(neighborhood.hasPrefix(city))
|
||||
XCTAssertTrue(city.hasPrefix(region))
|
||||
|
||||
Reference in New Issue
Block a user