启动导航SKMAPS后无法移动地图
我已经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]; }
确保您处于“平移”模式,类似于(从演示项目的代码中提取):
self.mapView.settings.followUserPosition = NO; self.mapView.settings.displayMode = SKMapDisplayMode2D;