Nedra Kachroudi
Nedra Kachroudi

Reputation: 95

skmaps how can i zoom in on current position in navigation

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.

enter image description here

Upvotes: 0

Views: 448

Answers (1)

TomWayne
TomWayne

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

Related Questions