Iphone X/Y像素到经度&;纬度

Iphone X/Y像素到经度&;纬度,iphone,ios,coordinates,latitude-longitude,pixels,Iphone,Ios,Coordinates,Latitude Longitude,Pixels,嘿,我使用以下公式成功地将经纬度转换为x/y坐标: // These should roughly box Germany - use the actual values appropriate to your image double minLat = 54.8; double minLong = 5.5; double maxLat = 47.2; double maxLong = 15.1; // Map image size (in points) CGSize mapSize = m

嘿,我使用以下公式成功地将经纬度转换为x/y坐标:

// These should roughly box Germany - use the actual values appropriate to your image
double minLat = 54.8;
double minLong = 5.5;
double maxLat = 47.2;
double maxLong = 15.1;

// Map image size (in points)
CGSize mapSize = mapView.frame.size;

// Determine the map scale (points per degree)
double xScale = mapSize.width / (maxLong - minLong);
double yScale = mapSize.height / (maxLat - minLat);

// Latitude and longitude of city
double spotLat = 49.993615;
double spotLong = 8.242493;

// position of map image for point
CGFloat x = (spotLong - minLong) * xScale;
CGFloat y - (spotLat - minLat) * yScale;
但现在我需要把它换成另一种方式。假设x=83,y=294。我怎样才能从中得到纬度和经度

如果

x = (spotLong - minLong) * xScale;
然后

(x / xScale) + minLong = spotLong;
只是重新安排一下方程


然后对纬度y做同样的处理。

这对墨卡托投影有效吗?