PDA

View Full Version : SKMaps wrong heading



RM335
14.01.2016, 10:10
Hello all!

I'am using SKMaps version 2.5.1 for iOS using objective-c. The library gives me 5 (SKHeadingModeNone, SKHeadingModeRotatingHeading, SKHeadingModeHistoricPositions, SKHeadingModeRotatingMap, SKHeadingModeRoute) options to set my heading, non of them seems to be working correct.

My code:



- (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.primaryInternationalL anguage = SKMapLanguageLOCAL;
internationalizationSettings.fallbackInternational Language = 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];
}

This is the result when I use it on a real iPhone:

2404
2405

What am I doing wrong?

Adela_Silvia
19.01.2016, 10:56
What are you trying to achieve? What is not working?
For some examples of different behavior, check the demo project, the "Pedestrian navigation UI" examples, where you can change real time the heading mode by clicking on the lower left icon.
Also see sdkblog.skobbler.com/advanced-pedestrian-navigation (http://sdkblog.skobbler.com/advanced-pedestrian-navigation/) for more details about the existing heading mode options