Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 错误的航向_Ios_Objective C_Skmaps - Fatal编程技术网

Ios 错误的航向

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

我正在使用Objective-c为iOS使用2.5.1版。库为我提供了5个选项来设置标题(
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”示例,您可以通过单击左下角图标实时更改标题模式。有关现有标题模式选项的更多详细信息,请参阅