Not able to move map after starting Navigation SKMAPS

*爱你&永不变心* 提交于 2020-01-04 05:21:07

问题


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];
}

回答1:


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;


来源:https://stackoverflow.com/questions/34448151/not-able-to-move-map-after-starting-navigation-skmaps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!