MapBox RMMapView像素以协调报告错误的lat / lng

时间:2014-07-19 21:55:10

标签: geolocation mapbox

下面是我用来将像素转换为坐标的代码段,反之亦然。

CLLocationCoordinate2D currentLocation = CLLocationCoordinate2DMake(geoPoint.latitude, geoPoint.longitude);
[mapView setCenterCoordinate:currentLocation];
CGPoint centerScreenPoint = [mapView coordinateToPixel:mapView.centerCoordinate];
CLLocationCoordinate2D loc = [mapView pixelToCoordinate:centerScreenPoint];
第一行的

geoPoint 是CLLocationManager报告的当前位置。虽然 centerScreenPoint 给了我160,284这是iPhone 5的中心点,但在运行此代码并转储 currentLocation loc 的值后,我获得两个不同的坐标。

这些观点如何产生不同,有什么想法?

0 个答案:

没有答案