gpt4 book ai didi

ios - 在 Swift 中获取 Google map 中 Lat Long 的地点 ID

转载 作者:行者123 更新时间:2023-11-29 05:32:27 24 4
gpt4 key购买 nike

有没有办法从经纬度或地址获取 Google 地点 ID?我已在 lat long 之前获取位置地址,但地点 ID 没有成功。谁能帮帮我吗?我的要求很简单。我有拉长。使用经纬度获取地址。现在我只需要该地址的地点 ID。

这是我的代码:

let geocoder = GMSGeocoder()
geocoder.reverseGeocodeCoordinate(coordinate) { (response, error) in

if error != nil{
print("reverse geodcode fail: \(error!.localizedDescription)")
}else{
if let places = response?.results(){
if let place = places.first{
print("GMS Address Place-->", place)
if let lines = place.lines{
print("GEOCODE: Formatted Address: \(lines[0])")
}
}else{
print("GEOCODE: nil first in places")
}
}else{
print("GEOCODE: nil in places")
}
}

最佳答案

关于ios - 在 Swift 中获取 Google map 中 Lat Long 的地点 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57412002/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com