我已经将SKMAPVIEW作为子视图添加到我的UIView中。在获得开始和结束坐标后,我计算了路线并开始导航..在计算路线时我能够移动地图并按照我的意愿进行缩放。
但是当我开始导航时,我无法移动地图,但我可以放大或缩小地图..我应该怎么做才能在开始导航后移动地图.. 。???提前谢谢......
我还希望根据指南针方向根据用户的当前方向旋转导航箭头。
-(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];
}
答案 0 :(得分:3)
确保您处于“平移”模式,类似于(从演示项目的代码中提取):
self.mapView.settings.followUserPosition = NO;
self.mapView.settings.displayMode = SKMapDisplayMode2D;