Ios 错误的航向
我正在使用Objective-c为iOS使用2.5.1版。库为我提供了5个选项来设置标题(Ios 错误的航向,ios,objective-c,skmaps,Ios,Objective C,Skmaps,我正在使用Objective-c为iOS使用2.5.1版。库为我提供了5个选项来设置标题(SKHeadingModeNone,SKHeadingModeRotatingHeading,SKHeadingModeHistoricPositions,SKHeadingModeRotatingMap,SKHeadingModeRotatingHeading),这些选项似乎都不能正常工作 我的代码: - (void)loadSettings { //Controls if rotation ge
SKHeadingModeNone
,SKHeadingModeRotatingHeading
,SKHeadingModeHistoricPositions
,SKHeadingModeRotatingMap
,SKHeadingModeRotatingHeading
),这些选项似乎都不能正常工作
我的代码:
- (void)loadSettings
{
//Controls if rotation gestures are enabled or disabled
self.mapView.settings.rotationEnabled = NO;
//Controls the map display mode ( 2D / 3D )
self.mapView.settings.displayMode = SKMapDisplayMode3D;
//Set the delegate to it self
self.mapView.delegate = self;
//Controls if the map follows the user position.
self.mapView.settings.followUserPosition = YES;
self.mapView.settings.showDebugView = YES;
//Controls the heading mode of the map.
self.mapView.settings.headingMode = SKHeadingModeRoute;
//Controls if house numbers are rendered on the map.
self.mapView.settings.showHouseNumbers = YES;
//Controls the framerate of the map for non user interaction camera changes ( navigation, inertia, etc. ). Default is 30 fps
self.mapView.settings.frameRate = 30.0f;
//Manages the displaying of the map scale. The scale value is updated automatically based on the visible region of the map
self.mapView.mapScaleView.hidden = YES;
/** SKMapInternationalizationSettings stores information about the maps labeling language. First the primary option will be applied for displaying the name of the map elements (country, city, street names) on the first row. If it doesn't exist then the second option will be applied. For displaying both options, the showBothOptions property should be set to YES. If the primary & fallback options are the same then only one option will be displayed.*/
SKMapInternationalizationSettings *internationalizationSettings = [SKMapInternationalizationSettings mapInternationalization];
internationalizationSettings.primaryOption = SKMapInternationalizationOptionLocal;
internationalizationSettings.fallbackOption = SKMapInternationalizationOptionInternational;
internationalizationSettings.primaryInternationalLanguage = SKMapLanguageLOCAL;
internationalizationSettings.fallbackInternationalLanguage = SKMapLanguageEN;
internationalizationSettings.showBothOptions = YES;
self.mapView.settings.mapInternationalization = internationalizationSettings;
//Zoom to current location
SKCoordinateRegion currentLocationRegion;
currentLocationRegion.center = [[SKPositionerService sharedInstance]currentCoordinate];
currentLocationRegion.zoomLevel = 23;
[self.mapView setVisibleRegion:currentLocationRegion];
[self.mapView animateToBearing:0.0f];
}
这是我在真正的iPhone上使用它的结果:
我做错了什么?航向校准正常吗?您是否在您的location manager代表中实施了
location manager应显示HeadingCalibration
?CLHeading
更新中headingaccuracity
的值是多少?[self.mapView animateToBearing:0.0f]的任何原因代码>哪一个明显会迫使(至少暂时)方向角为0?您想要的场景是什么?您试图实现什么?什么不起作用?有关不同行为的一些示例,请查看演示项目“行人导航UI”示例,您可以通过单击左下角图标实时更改标题模式。有关现有标题模式选项的更多详细信息,请参阅