Hi, I'm trying to put an Annotation the lower left corner of currently visible map region, although the following code
CLLocationCoordinate2D origin = getOriginOfRegion(mapView.region);
[[[SimpleAnnotation alloc] initWithCoords:origin] autorelease];
...
extern CLLocationCoordinate2D getOriginOfRegion(MKCoordinateRegion region){
return CLLocationCoordinate2DMake(region.center.latitude-region.span.latitudeDelta/2,
region.center.longitude-region.span.longitudeDelta/2);
}
where SimpleAnnotation
is as simple as it gets; puts the pin point a few degrees off the actual corner:
On the right side zoom level is higher, and as you can see the mistake is significantly smaller.
I've tried doing some math to counter it, considering that the error may be something related to projecting elliptical coordinates onto a plane, but didn't come up with anything useful.
Has anyone solved this problem? I've noticed that latitude values are not 'linear' on a mapView, I need some hints to understand how to transform them.