Reputation: 95
I'am using Navigation on map and i want to center on my position with a zoom in when i make zoom out(Screen Shot), how can i do this?
This is how i did but it doesn't work :
-(IBAction)centrerAction:(id)sender
{
[self.skMap animateToLocation:userLocation.coordinate withDuration:0];
[self.skMap animateToZoomLevel:19];
}
Thanks for Help.
Upvotes: 0
Views: 448
Reputation: 230
I tried that too without success. You can also use:
SKCoordinateRegion currentLocationRegion;
currentLocationRegion.center = [[SKPositionerService sharedInstance]currentCoordinate];
currentLocationRegion.zoomLevel = 19;
[self.skMap setVisibleRegion:currentLocationRegion];
Upvotes: 1