我使用Objective-c在iOS上使用SKMaps版本2.5.1。该库为我提供了5个选项来设置我的标题(SKHeadingModeNone
,SKHeadingModeRotatingHeading
,SKHeadingModeHistoricPositions
,SKHeadingModeRotatingMap
,SKHeadingModeRoute
),其中任何一个似乎都无法正常工作
我的代码:
- (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上使用它时的结果:
我做错了什么?