MapViewPreferencesContext
Objective-C
@interface MapViewPreferencesContext : NSObject
Swift
class MapViewPreferencesContext : NSObject
An object that manages map view preferences.
-
Initializes and returns a newly allocated object using the model data.
Declaration
Objective-C
- (nonnull instancetype)initWithModelData:(nonnull void *)data;
-
Change the map view perspective.
Declaration
Objective-C
- (void)setMapViewPerspective:(MapViewPerspective)perspective animationDuration:(NSTimeInterval)duration completionHandler:(nonnull void (^)(BOOL))handler;
Swift
func setMapViewPerspective(_ perspective: MapViewPerspective, animationDuration duration: TimeInterval) async -> Bool
Parameters
perspective
The map perspective.
duration
The fly animation duration in milliseconds. 0 means no animation. Default is none.
handler
The block to execute asynchronously with the result.
-
Returns the map view perspective.
Declaration
Objective-C
- (MapViewPerspective)getMapViewPerspective;
Swift
func getMapViewPerspective() -> MapViewPerspective
-
Returns the viewing angle.
Declaration
Objective-C
- (double)getViewAngle;
Swift
func getViewAngle() -> Double
-
Returns the minimum viewing angle. @details The minimum view angle is when the camera is looking directly downward at the map.
Declaration
Objective-C
- (double)getMinViewAngle;
Swift
func getMinViewAngle() -> Double
-
Returns the maximum viewing angle. @details The maximum view angle is when the camera is looking directly toward the horizon.
Declaration
Objective-C
- (double)getMaxViewAngle;
Swift
func getMaxViewAngle() -> Double
-
Sets the viewing angle.
Declaration
Objective-C
- (void)setViewAngle:(double)value;
Swift
func setViewAngle(_ value: Double)
Parameters
value
The view angle.
-
Sets the tilt angle in degrees.
Declaration
Objective-C
- (void)setTiltAngle:(double)angle;
Swift
func setTiltAngle(_ angle: Double)
Parameters
angle
The tilt angle in degrees.
-
Gets the tilt angle in degrees.
Declaration
Objective-C
- (double)getTiltAngle;
Swift
func getTiltAngle() -> Double
-
Gets the map rotation angle in degrees relative to north-south axis. The value of 0 corresponds to north-up alignment.
Declaration
Objective-C
- (double)getRotationAngle;
Swift
func getRotationAngle() -> Double
-
Sets the map rotation angle in degrees relative to north-south axis. The value of 0 corresponds to north-up alignment.
Declaration
Objective-C
- (void)setRotationAngle:(double)value;
Swift
func setRotationAngle(_ value: Double)
-
Get access to the visibility settings for the landmark stores..
Declaration
Objective-C
- (nullable LandmarkStoreContextCollection *)getLandmarkStoreCollection;
Swift
func getLandmarkStoreCollection() -> LandmarkStoreContextCollection?
-
Returns the path collection from the map.
Declaration
Objective-C
- (nullable PathCollectionObject *)getPaths;
Swift
func getPaths() -> PathCollectionObject?
-
Returns the marker collection from the map.
Declaration
Objective-C
- (nullable MarkerCollectionObject *)getMarkers;
Swift
func getMarkers() -> MarkerCollectionObject?
-
Returns the traffic visibility. @details By default is true if current map style contains the traffic layer.
Declaration
Objective-C
- (BOOL)getTrafficVisibility;
Swift
func getTrafficVisibility() -> Bool
-
Sets the traffic visibility. @details Will return SDKErrorCodeKNotFound if current map style doesn’t contains the traffic layer.
Declaration
Objective-C
- (SDKErrorCode)setTrafficVisibility:(BOOL)state;
Swift
func setTrafficVisibility(_ state: Bool) -> SDKErrorCode
-
Enable / Disable the cursor mode. When the cursor is enabled map selection can be activated by calling setCursorScreenPosition. The cursor is automatically disabled by MapView::startFollowingPosition.
Declaration
Objective-C
- (void)enableCursor:(BOOL)value;
Swift
func enableCursor(_ value: Bool)
-
Test if cursor is enabled. Default is false.
Declaration
Objective-C
- (BOOL)isCursorEnabled;
Swift
func isCursorEnabled() -> Bool
-
Enable / Disable the cursor rendering.
Declaration
Objective-C
- (void)enableCursorRender:(BOOL)value;
Swift
func enableCursorRender(_ value: Bool)
-
Test if cursor render is enabled. Default is false.
Declaration
Objective-C
- (BOOL)isCursorRenderEnabled;
Swift
func isCursorRenderEnabled() -> Bool
-
Set map view details by content path.
Declaration
Objective-C
- (void)setMapStyleWithPath:(nonnull NSString *)path smoothTransition:(BOOL)smoothTransition;
Swift
func setMapStyleWithPath(_ path: String, smoothTransition: Bool)
Parameters
path
The content path.
smoothTransition
Enables a smooth transition between old and new style.
-
Set map view details by content data.
Declaration
Objective-C
- (void)setMapStyleWithData:(nonnull NSData *)data smoothTransition:(BOOL)smoothTransition;
Swift
func setMapStyleWith(_ data: Data, smoothTransition: Bool)
Parameters
data
The content data.
smoothTransition
Enables a smooth transition between old and new style.
-
Set map view details by content identifier.
Declaration
Objective-C
- (void)setMapStyleWithIdentifier:(NSInteger)identifier smoothTransition:(BOOL)smoothTransition;
Swift
func setMapStyleWithIdentifier(_ identifier: Int, smoothTransition: Bool)
Parameters
identifier
The content id.
smoothTransition
Enables a smooth transition between old and new style.
-
Returns the current map style identifier.
Declaration
Objective-C
- (NSInteger)getMapStyleId;
Swift
func getMapStyleId() -> Int
-
Set buildings visibility to the specified option.
Declaration
Objective-C
- (void)setBuildingsVisibility:(BuildingsVisibility)visibility;
Swift
func setBuildingsVisibility(_ visibility: BuildingsVisibility)
-
Returns the buildings visibility.
Declaration
Objective-C
- (BuildingsVisibility)getBuildingsVisibility;
Swift
func getBuildingsVisibility() -> BuildingsVisibility
-
Gets follow position preferences.
Declaration
Objective-C
- (nonnull FollowPositionPreferencesContext *)getFollowPositionPreferences;
Swift
func getFollowPositionPreferences() -> FollowPositionPreferencesContext
-
Enable / disable frames per second draw.
Declaration
Objective-C
- (void)setDrawFPS:(BOOL)value position:(CGPoint)point;
Swift
func setDrawFPS(_ value: Bool, position point: CGPoint)
-
Get the map view focus viewport. @details The focus viewport is the view screen part containing the maximum map details. The coordinates are relative to view parent screen. @details The default value is the view whole viewport. @details The values are in pixels.
Declaration
Objective-C
- (CGRect)getFocusViewport;
Swift
func getFocusViewport() -> CGRect
-
Set the map view focus viewport rectangle. @details If rect is empty the focus will be reset to whole view. @details The values are in pixels.
Declaration
Objective-C
- (void)setFocusViewport:(CGRect)rect;
Swift
func setFocusViewport(_ rect: CGRect)
-
Get the map labels fading animation status. @details By default fading animation is On.
Declaration
Objective-C
- (BOOL)getMapLabelsFading;
Swift
func getMapLabelsFading() -> Bool
-
Set the map labels fading animation. @details By default fading animation is On.
Declaration
Objective-C
- (void)setMapLabelsFading:(BOOL)status;
Swift
func setMapLabelsFading(_ status: Bool)
-
Set the map labels continuous rendering state. @details By default is false.
Declaration
Objective-C
- (void)setMapLabelsContinuousRendering:(BOOL)status;
Swift
func setMapLabelsContinuousRendering(_ status: Bool)
-
Get the map labels continuous rendering state.
Declaration
Objective-C
- (BOOL)getMapLabelsContinuousRendering;
Swift
func getMapLabelsContinuousRendering() -> Bool
-
Get the fast data loading disable state. @details Returns true if fast data loading is disabled.
Declaration
Objective-C
- (BOOL)getDisableFastLoading;
Swift
func getDisableFastLoading() -> Bool
-
Disable the fast data loading when moving camera.
Declaration
Objective-C
- (void)setDisableFastLoading:(BOOL)status;
Swift
func setDisableFastLoading(_ status: Bool)
-
Enables or disables the map scale.
Declaration
Objective-C
- (void)showMapScale:(BOOL)status;
Swift
func showMapScale(_ status: Bool)
-
Check if map scale is shown.
Declaration
Objective-C
- (BOOL)isMapScaleShown;
Swift
func isMapScaleShown() -> Bool
-
Sets the map scale position.
Declaration
Objective-C
- (void)setMapScalePosition:(CGRect)rect;
Swift
func setMapScalePosition(_ rect: CGRect)
Parameters
rect
- The rectangle position related to parent view.
-
Gets the map scale position.
Declaration
Objective-C
- (CGRect)getMapScalePosition;
Swift
func getMapScalePosition() -> CGRect
-
Sets the elevation alpha factor.
Declaration
Objective-C
- (void)setElevationAlphaFactor:(float)factor;
Swift
func setElevationAlphaFactor(_ factor: Float)
Parameters
factor
- float value between 0 and 1 to set the elevation shadows opacity
-
Gets the elevation alpha factor.
Declaration
Objective-C
- (float)getElevationAlphaFactor;
Swift
func getElevationAlphaFactor() -> Float
-
Gets frames per second draw state.
Declaration
Objective-C
- (BOOL)getDrawFPS;
Swift
func getDrawFPS() -> Bool
-
Set map details quality level. Default is MapDetailsQualityLevelHigh.
Declaration
Objective-C
- (void)setMapDetailsQualityLevel:(MapDetailsQualityLevel)level;
Swift
func setMapDetailsQualityLevel(_ level: MapDetailsQualityLevel)
Parameters
level
Map details quality level, see MapDetailsQualityLevel.
-
Returns the map details quality level.
Declaration
Objective-C
- (MapDetailsQualityLevel)getMapDetailsQualityLevel;
Swift
func getMapDetailsQualityLevel() -> MapDetailsQualityLevel
-
Enable / disable touch gesture.
Declaration
Objective-C
- (SDKErrorCode)enableTouchGesture:(MapViewTouchGestures)gesture enable:(BOOL)state;
Swift
func enableTouchGesture(_ gesture: MapViewTouchGestures, enable state: Bool) -> SDKErrorCode
Parameters
gesture
Map view gesture.
-
Enable / disable touch gestures.
Declaration
Objective-C
- (SDKErrorCode)enableTouchGestures:(int)gestures enable:(BOOL)state;
Swift
func enableTouchGestures(_ gestures: Int32, enable state: Bool) -> SDKErrorCode
Parameters
gestures
Packed map view gestures.
-
Check if touch gesture is enabled.
Declaration
Objective-C
- (BOOL)isTouchGestureEnabled:(MapViewTouchGestures)gesture;
Swift
func isTouchGestureEnabled(_ gesture: MapViewTouchGestures) -> Bool
-
Get enabled touch gestures packed.
Declaration
Objective-C
- (int)getTouchGesturesStates;
Swift
func getTouchGesturesStates() -> Int32
-
Set enabled touch gestures packed.
Declaration
Objective-C
- (void)setTouchGesturesStates:(int)gestures;
Swift
func setTouchGesturesStates(_ gestures: Int32)
-
Get number of routes in this collection.
Declaration
Objective-C
- (int)routesCollectionSize;
Swift
func routesCollectionSize() -> Int32
-
Get route specified by index.
Declaration
Objective-C
- (nullable RouteObject *)getRoute:(int)index;
Swift
func getRoute(_ index: Int32) -> RouteObject?
-
Get index of the specified route. Returns < 0 for error.
Declaration
Objective-C
- (int)indexOf:(nonnull RouteObject *)route;
Swift
func index(of route: RouteObject) -> Int32
-
Check if the route is the main route in the collection.
Declaration
Objective-C
- (BOOL)isMainRoute:(nonnull RouteObject *)routeObject;
Swift
func isMainRoute(_ routeObject: RouteObject) -> Bool
-
Gets the current main route.
Declaration
Objective-C
- (nullable RouteObject *)getMainRoute;
Swift
func getMainRoute() -> RouteObject?
-
Set the route as main route in the collection.
Declaration
Objective-C
- (void)setMainRoute:(nonnull RouteObject *)routeObject;
Swift
func setMainRoute(_ routeObject: RouteObject)
-
Add a route in the collection of visible routes.
Declaration
Objective-C
- (BOOL)addRoute:(nonnull RouteObject *)routeObject isMainRoute:(BOOL)isMainRoute label:(nullable NSString *)label images:(nullable NSArray<UIImage *> *)images;
Swift
func addRoute(_ routeObject: RouteObject, isMainRoute: Bool, label: String?, images: [UIImage]?) -> Bool
Parameters
routeObject
The route object.
isMainRoute
True if the route is the main route, false if alternative route.
label
The route label string.
images
The route label images.
-
Remove the route.
Declaration
Objective-C
- (void)removeRoute:(nonnull RouteObject *)routeObject;
Swift
func removeRoute(_ routeObject: RouteObject)
-
Check if a route object is part of the routes collection.
Declaration
Objective-C
- (BOOL)containsRoute:(nonnull RouteObject *)routeObject;
Swift
func containsRoute(_ routeObject: RouteObject) -> Bool
-
Remove all routes.
Declaration
Objective-C
- (void)clearRoutes;
Swift
func clearRoutes()
-
Returns the route custom render settings.
Declaration
Objective-C
- (nullable MapViewRouteRenderSettings *)getRenderSettings: (nonnull RouteObject *)routeObject;
Swift
func getRenderSettings(_ routeObject: RouteObject) -> MapViewRouteRenderSettings?
-
Sets the route custom render settings.
Declaration
Objective-C
- (void)setRenderSettings:(nonnull MapViewRouteRenderSettings *)settings route:(nonnull RouteObject *)routeObject;
Swift
func setRenderSettings(_ settings: MapViewRouteRenderSettings, route routeObject: RouteObject)
-
Get route label text.
Declaration
Objective-C
- (nullable NSString *)getRouteLabel:(nonnull RouteObject *)routeObject;
Swift
func getRouteLabel(_ routeObject: RouteObject) -> String?
-
Set route bubble text.
Declaration
Objective-C
- (void)setRouteLabel:(nonnull RouteObject *)routeObject label:(nonnull NSString *)label;
Swift
func setRouteLabel(_ routeObject: RouteObject, label: String)
Parameters
routeObject
The route for which the label wants to be set.
label
The route label string. @details The route label supports custom icon placement inside the text by using the icon place-mark %%icon index%%, e.g. “My header text %%0%%\n%%1%% my footer”. @details The %%icon index%% must be a valid integer in images list container, i.e. 0 <= icon index < images.size()
-
Get route image list.
Declaration
Objective-C
- (nonnull NSArray<ImageObject *> *)getRouteImages: (nonnull RouteObject *)routeObject;
Swift
func getRouteImages(_ routeObject: RouteObject) -> [ImageObject]
-
Set route bubble image.
Declaration
Objective-C
- (void)setRouteImages:(nonnull RouteObject *)routeObject images:(nonnull NSArray<UIImage *> *)images;
Swift
func setRouteImages(_ routeObject: RouteObject, images: [UIImage])
-
Hide the route label.
Declaration
Objective-C
- (void)hideRouteLabel:(nonnull RouteObject *)routeObject;
Swift
func hideRouteLabel(_ routeObject: RouteObject)
-
Get all map view routes in the collection.
Declaration
Objective-C
- (nonnull NSArray<MapViewRouteObject *> *)getMapViewRoutes;
Swift
func getMapViewRoutes() -> [MapViewRouteObject]