MKMapView not centered on pin
Posted
by Val Smith
on Stack Overflow
See other posts from Stack Overflow
or by Val Smith
Published on 2010-05-15T13:42:36Z
Indexed on
2010/05/15
13:44 UTC
Read the original article
Hit count: 452
Hi all,
I have an mkmapview that i'm currently adding pins to, but for some reason when I call [mapView setRegion:[detailItem coordinateRegion] animated:YES];
the pin is off-centered (toward the right side of the screen) on the map. Here is the code for [deailItem coordinateRegion]
:
- (MKCoordinateRegion)coordinateRegion {
MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center = self.coordinate;
region.span.longitudeDelta = 0.0075f;
region.span.latitudeDelta = 0.0075f;
return (region);
}
I'm setting the coordinateRegion's center to the object's x,y coordinate, so why is it off-center on the map? I feel like there's something I'm missing here...
::Val::
© Stack Overflow or respective owner