Search code examples
iosobjective-cmapsskmaps

Not able to move map after starting Navigation SKMAPS


I had added SKMAPVIEW as subview to my UIView, After getting the start and end coordinates, I had calculated route and started navigation.. while calculating the route I'm able to move the map and zoom as my wish.

But when I started navigation I'm not able to move the map, but I'm able to zoom in or zoom out in the map.. what should I do in order to move the map after starting the navigation... ??? Thanks in advance...

And also I want to rotate the navigation arrow according to the current direction of the user based on compass direction.

-(void)StartNavigation
{
    ///Navigation Settings
    self.mapView.settings.showCompass = YES;
    self.mapView.settings.followUserPosition = YES;
    self.mapView.settings.headingMode = SKHeadingModeRotatingHeading;
    SKNavigationSettings* navSettings = [SKNavigationSettings navigationSettings];
    navSettings.navigationType = SKNavigationTypeReal;
    navSettings.distanceFormat=SKDistanceFormatMilesFeet;
    navSettings.showStreetNamePopUpsOnRoute=YES;

    // Navigation RouteAdvisor Settings
    [SKRoutingService sharedInstance].mapView.settings.displayMode = SKMapDisplayMode2D;
    SKAdvisorSettings *settings = [SKAdvisorSettings advisorSettings];
    settings.advisorVoice = @"en_us";
    settings.advisorType = SKAdvisorTypeTextToSpeech;

    [SKRoutingService sharedInstance].advisorConfigurationSettings = settings;
    [[SKRoutingService sharedInstance]startNavigationWithSettings:navSettings];
}

Solution

  • Make sure that you're in "panning" mode, something similar to (extracted from the demo project's code):

    self.mapView.settings.followUserPosition = NO;
    self.mapView.settings.displayMode = SKMapDisplayMode2D;