小编kly*_*ins的帖子

使用 Swift 将 CLLocationCoordinate2d 转换为街道地址

我试图将 CLLocationCoordinates2d 坐标转换为物理街道地址。

我试过 CLGeocoder 没有运气。这是我提供纬度和经度坐标的代码。

    let manager = CLLocationManager()

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{

    guard let locValue: CLLocationCoordinate2D = manager.location?.coordinate else { return }
    print("locations = \(locValue.latitude) \(locValue.longitude)")
    // let locationtext = "locations = \(locValue.latitude) \(locValue.longitude)"
    locationTxt.text = "\(locValue.latitude) \(locValue.longitude)"

}
Run Code Online (Sandbox Code Playgroud)

谢谢!

xcode reverse geocoding cllocation swift

5
推荐指数
1
解决办法
6232
查看次数

标签 统计

cllocation ×1

geocoding ×1

reverse ×1

swift ×1

xcode ×1