启动导航SKMAPS后无法移动地图 [英] Not able to move map after starting Navigation SKMAPS
问题描述
我已经将SKMAPVIEW作为子视图添加到了UIView中,获得了起点和终点坐标之后,我已经计算了路线并开始导航..在计算路线的同时,我可以根据自己的意愿移动地图和缩放.
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];
}
推荐答案
确保您处于平移"模式,类似于(摘自演示项目的代码):
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;
这篇关于启动导航SKMAPS后无法移动地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!