objective c - iOS: Best way to position my mapView to show the coordinates at the top left -
objective c - iOS: Best way to position my mapView to show the coordinates at the top left -
i have next code below positions mapview shows coordinates in center. however, need position mapview show coordinates @ top left. code below using. using category called mkmapview+zoomlevel.h. if need more info please allow me know.
[self.mapview setcentercoordinate:coordinate zoomlevel:level animated:animated];
get part self.mapview.region , find new coordinate using simple geometry. part give center point , width , height of view in degrees of latitude , longitude.
from there, can determine center coordinate provide map view set original coordinate in upper left corner.
cllocationcoordinate2dmake(self.mapview.coordinate.latitude + self.mapview.region.span.latitudedelta / 2, self.mapview.coordinate.longitude + self.mapview.region.span.longitudedelta / 2)
ios objective-c iphone xcode
Comments
Post a Comment