【发布时间】:2016-12-28 02:53:30
【问题描述】:
我想根据经度和纬度获取商家的名称。还有其他 API 可以做到这一点,例如 Google Places,但如果我能提供帮助,我宁愿在我的应用程序中不要有额外的依赖项。有没有办法通过 Swift 中的 CoreLocation 来做到这一点?我知道您可以使用以下方法从纬度和经度中获取地址“名称”:
let geocoder = CLGeocoder()
geocoder.reverseGeocodeLocation(location) { (placemarks, error) in
placemarks?.first?.name
}
但这只是给了我门牌号,而不是像“Costco”这样的公司的实际名称或它的真正名称。
【问题讨论】:
标签: swift gps mapkit cllocation reverse-geocoding