【发布时间】:2016-10-18 10:11:42
【问题描述】:
我的应用通过使用下面的代码获取longitude 和latitude 将位置坐标发送到服务器。
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
let locationArray = locations as NSArray
let locationObj = locationArray.lastObject as! CLLocation
let coord = locationObj.coordinate
latitudeTxt = String(format: "%.4f", coord.latitude)
longitudeTxt = String(format: "%.4f",coord.longitude)
}
我现在被要求将值作为网格参考发送,而我发现这样做的唯一方法涉及非常复杂的算法。
有没有更简单的方法可以从我的经度和纬度值中获取网格参考?
【问题讨论】:
标签: ios swift cllocationmanager cllocation