【发布时间】:2020-06-13 21:07:11
【问题描述】:
我需要在我的表中保存两个地标。一个用于位置,一个用于目的地。 我现在正在做的是创建一个包含所有详细信息的字典,如下所示:
let location: [String: Any] = [
"coordinate": GeoPoint(latitude: item.location.coordinate.latitude , longitude: item.location.coordinate.longitude),
"name": item.location.name,
"isoCountryCode": item.location.isoCountryCode,
"country": item.location.country,
...etc
]
然后我将其保存到 Firestore。然后我将其解析为我的 Placemark 模型(不是 CLPlacemark)。
最近我在想是否最好只保存坐标然后使用 GeoCoder
geocoder.reverseGeocodeLocation(location, completionHandler: { (placemarks, error) in 获取地标。
那么实际上哪个更好?
【问题讨论】:
标签: ios swift firebase google-cloud-firestore geolocation