1

What is the algorithm used in MKMapPointForCoordinate? In other words, how does one convert a MKMapPoint to latitude/longitude and vis-versa outside of Apple's ecosystem?

xtravar
  • 1,321
  • 11
  • 24
  • Convert MKMapPoint to Latitude/Longitude and then use the formula described in this stackoverflow example, shared with this [link](http://stackoverflow.com/questions/14329691/covert-latitude-longitude-point-to-a-pixels-x-y-on-mercator-projection) – meghan66 Mar 15 '15 at 04:27

1 Answers1

2

In order to convert it inside Apple system:

MKMapPoint yourPoint;
CLLocationCoordinate2D location = MKCoordinateForMapPoint(yourPoint);
NSLog(@"%@", location.latitude);
NSLog(@"%@", location.longitude);

How does Apple do it? Here you can read here

Basically, it uses Mercator map projection:

http://mathworld.wolfram.com/MercatorProjection.html

Darius Miliauskas
  • 3,391
  • 4
  • 35
  • 53