0
获取网格参考我的应用通过使用下面的代码获取longitude
和latitude
将位置坐标发送到服务器。我如何从我的CLLoocation.coordinate
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)
}
我现在被要求发送值作为网格参考,我发现要做到这一点的唯一方法涉及非常复杂的算法。
有没有更简单的方法从我的经度和纬度值获取网格参考?
谢谢,我试过使用代码,因为应用程序不会在Xcode8中运行。结果还不完全正确,但它确实给了我一些继续。 – user616076