Skip to content

Commit

Permalink
🔨 GeoQueryable changes to hashing generation
Browse files Browse the repository at this point in the history
  • Loading branch information
benlmyers committed Sep 4, 2022
1 parent 1cc54c9 commit 4ad9ec6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public protocol GeoQueryable: Document {
/// The address of the location of the document.
var address: String? { get set }
/// The geohash of the document.
var geohash: String { get }
var geohash: String { get set }
}

#if canImport(CoreLocation)
Expand All @@ -37,10 +37,10 @@ public extension GeoQueryable {
// MARK: - Properties

/// The document's location's geohash.
var geohash: String {
mutating func updateGeohash() {
let location: CLLocationCoordinate2D = .init(latitude: latitude, longitude: longitude)
let hash = location.geohash(length: Self.geohashPrecision.rawValue)
return hash
self.geohash = hash
}
}

Expand Down

0 comments on commit 4ad9ec6

Please sign in to comment.