Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ctdonath

macrumors 68000
Original poster
Mar 11, 2009
1,598
641
Is there some trivial way to let the user center the map on current GPS position?

The app doesn't really care where (save perhaps for a pin drop there), no need to stay centered if moving, just scroll the map to current position when button is tapped.
 
Is there some trivial way to let the user center the map on current GPS position?

The app doesn't really care where (save perhaps for a pin drop there), no need to stay centered if moving, just scroll the map to current position when button is tapped.

Get the current location and change the map region to center on that location. Takes about 3 lines of code.
 
Is there some trivial way to let the user center the map on current GPS position?

The app doesn't really care where (save perhaps for a pin drop there), no need to stay centered if moving, just scroll the map to current position when button is tapped.

Code:
[MKMapView setRegion:(MKCoordinateRegion) [I]region[/I] animated:(BOOL) [I]animated[/I]]
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.