MMKMap
- Summary
- Instance methods
- cameraPositionWithGeometry:
- cameraPositionWithGeometry:focusRect:
- cameraPositionWithGeometry:azimuth:tilt:focusRect:
- visibleRegionWithCameraPosition:
- moveWithCameraPosition:animation:cameraCallback:
- moveWithCameraPosition:
- addInputListenerWithInputListener:
- removeInputListenerWithInputListener:
- addCameraListenerWithCameraListener:
- removeCameraListenerWithCameraListener:
- setMapLoadedListenerWithMapLoadedListener:
- addTapListenerWithTapListener:
- removeTapListenerWithTapListener:
- deselectGeoObject
- selectGeoObjectWithSelectionMetaData:
- setMapStyleWithStyle:
- setMapStyleWithId:style:
- resetMapStyles
- set2DModeWithEnable:
- projection
- wipe
- addTileLayerWithLayerId:layerOptions:createTileDataSource:
- Properties
@interface MMKMap : NSObject |
The object that is used to interact with the map.
Summary
Instance methods
- (nonnull MMKCameraPosition *)cameraPositionWithGeometry: |
- (nonnull MMKCameraPosition *) |
- (nonnull MMKCameraPosition *) |
- (nonnull MMKVisibleRegion *)visibleRegionWithCameraPosition: |
- (void)moveWithCameraPosition:(nonnull MMKCameraPosition *)cameraPosition |
- (void)moveWithCameraPosition:(nonnull MMKCameraPosition *)cameraPosition; |
- (void)addInputListenerWithInputListener: |
- (void)removeInputListenerWithInputListener: |
- (void)addCameraListenerWithCameraListener: |
- (void)removeCameraListenerWithCameraListener: |
- (void)setMapLoadedListenerWithMapLoadedListener: |
- (void)addTapListenerWithTapListener: |
- (void)removeTapListenerWithTapListener: |
- (void)deselectGeoObject; |
- (void)selectGeoObjectWithSelectionMetaData: |
- (BOOL)setMapStyleWithStyle:(nonnull NSString *)style; |
- (BOOL)setMapStyleWithId:(NSInteger)id style:(nonnull NSString *)style; |
- (void)resetMapStyles; |
- (void)set2DModeWithEnable:(BOOL)enable; |
- (nonnull MMKProjection *)projection; |
- (void)wipe; |
- (nonnull MMKLayer *) |
Properties
@property (nonatomic, readonly, nonnull) MMKCameraPosition *cameraPosition; |
@property (nonatomic, readonly, nonnull) MMKVisibleRegion *visibleRegion; |
@property (nonatomic, readonly, nonnull) MMKCameraBounds *cameraBounds; |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite) MMKMapType mapType; |
@property (nonatomic, readonly, nonnull) MMKMapObjectCollection *mapObjects; |
@property (nonatomic, readonly, nonnull) MMKLogo *logo; |
@property (nonatomic, assign, unsafe_unretained, readwrite, nullable) |
@property (nonatomic, assign, unsafe_unretained, readwrite) MMKMapMode mode; |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, assign, unsafe_unretained, readwrite, |
@property (nonatomic, readonly, getter=isValid) BOOL valid; |
Instance methods
cameraPositionWithGeometry:
- (nonnull MMKCameraPosition *)cameraPositionWithGeometry: |
Calculates the camera position that projects the specified geometry into the current focusRect, or the full view if the focusRect is not set.
cameraPositionWithGeometry:focusRect:
- (nonnull MMKCameraPosition *) |
Calculates the camera position that projects the specified geometry into the custom focusRect.
cameraPositionWithGeometry:azimuth:tilt:focusRect:
- (nonnull MMKCameraPosition *) |
Returns |
Camera position that projects the specified geometry into the |
visibleRegionWithCameraPosition:
- (nonnull MMKVisibleRegion *)visibleRegionWithCameraPosition: |
Returns |
The map region that is visible from the given camera |
moveWithCameraPosition:animation:cameraCallback:
- (void)moveWithCameraPosition:(nonnull MMKCameraPosition *)cameraPosition |
Changes camera position. Can cancel a previous unfinished movement.
@see mapkit.Animation for more details. - parameter: cameraCallback A function that takes the bool argument marking the camera action complete. Invoked when:
- A camera action is cancelled (for example, as a result of a subsequent request for camera movement), passing false as an argument.
- A camera action finished successfully, passing true as an argument.
Parameters |
|
animation |
Required. Defines animation parameters. |
cameraCallback |
A function that takes the bool argument marking the camera action complete. Invoked when: A camera action is cancelled (for example, as a result of a subsequent request for camera movement), passing false as an argument. A camera action finished successfully, passing true as an argument. |
moveWithCameraPosition:
- (void)moveWithCameraPosition:(nonnull MMKCameraPosition *)cameraPosition; |
Immediately changes the camera position. Can cancel a previous unfinished movement.
addInputListenerWithInputListener:
- (void)addInputListenerWithInputListener: |
Adds input listeners.
The class does not retain the object in the 'inputListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
removeInputListenerWithInputListener:
- (void)removeInputListenerWithInputListener: |
Removes input listeners.
addCameraListenerWithCameraListener:
- (void)addCameraListenerWithCameraListener: |
Adds camera listeners.
The class does not retain the object in the 'cameraListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
removeCameraListenerWithCameraListener:
- (void)removeCameraListenerWithCameraListener: |
Removes camera listeners.
setMapLoadedListenerWithMapLoadedListener:
- (void)setMapLoadedListenerWithMapLoadedListener: |
Sets a map loaded listener.
The class does not retain the object in the 'mapLoadedListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
addTapListenerWithTapListener:
- (void)addTapListenerWithTapListener: |
Adds a tap listener that is used to obtain brief geo object info.
The class does not retain the object in the 'tapListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
removeTapListenerWithTapListener:
- (void)removeTapListenerWithTapListener: |
Removes a tap listener that is used to obtain brief geo object info.
deselectGeoObject
- (void)deselectGeoObject; |
Resets the currently selected geo object.
selectGeoObjectWithSelectionMetaData:
- (void)selectGeoObjectWithSelectionMetaData: |
Selects a geo object with the specified objectId in the specified layerId. If the object is not currently on the screen, it is selected anyway, but the user will not actually see that. You need to move the camera in addition to this call to be sure that the selected object is visible for the user. GeoObjectSelectionMetadata can be extracted from the geo object's metadata container when the user taps on a geo object.
setMapStyleWithStyle:
- (BOOL)setMapStyleWithStyle:(nonnull NSString *)style; |
Applies JSON style transformations to the map. Same as setMapStyle(0, style). Affects VectorMap and Hybrid map types. Set to empty string to clear previous styling. Returns true if the style was successfully parsed, and false otherwise. If the returned value is false, the current map style remains unchanged.
setMapStyleWithId:style:
- (BOOL)setMapStyleWithId:(NSInteger)id style:(nonnull NSString *)style; |
Applies JSON style transformations to the map. Replaces previous styling with the specified ID (if such exists). Stylings are applied in an ascending order. Affects VectorMap and Hybrid map types. Set to empty string to clear previous styling with the specified ID. Returns true if the style was successfully parsed, and false otherwise. If the returned value is false, the current map style remains unchanged.
resetMapStyles
- (void)resetMapStyles; |
Resets all JSON style transformations applied to the map.
set2DModeWithEnable:
- (void)set2DModeWithEnable:(BOOL)enable; |
Forces the map to be flat. true - All loaded tiles start showing the "flatten out" animation; all new tiles do not start 3D animation. false - All tiles start showing the "rise up" animation.
projection
- (nonnull MMKProjection *)projection; |
Provides map projection
wipe
- (void)wipe; |
Erases tiles, caches, etc. Does not trigger the next frame generation.
addTileLayerWithLayerId:layerOptions:createTileDataSource:
- (nonnull MMKLayer *) |
Adds tile layer.
Properties
cameraPosition
@property (nonatomic, readonly, nonnull) MMKCameraPosition *cameraPosition; |
Returns |
Current camera position. Target position must be within |
visibleRegion
@property (nonatomic, readonly, nonnull) MMKVisibleRegion *visibleRegion; |
Returns |
The map region that is currently visible. Region IS bounded |
cameraBounds
@property (nonatomic, readonly, nonnull) MMKCameraBounds *cameraBounds; |
Undocumented
nightModeEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
If enabled, night mode will reduce map brightness and improve contrast.
zoomGesturesEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enable/disable zoom gestures, for example: - pinch - double tap (zoom in) - tap with two fingers (zoom out)
scrollGesturesEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enable/disable scroll gestures, such as the pan gesture.
tiltGesturesEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enable/disable tilt gestures, such as parallel pan with two fingers.
rotateGesturesEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enable/disable rotation gestures, such as rotation with two fingers.
fastTapEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Removes the 300 ms delay in emitting a tap gesture. However, a double-tap will emit a tap gesture along with a double-tap.
mapType
@property (nonatomic, assign, unsafe_unretained, readwrite) MMKMapType mapType; |
Sets the base map type.
mapObjects
@property (nonatomic, readonly, nonnull) MMKMapObjectCollection *mapObjects; |
Returns |
List of map objects associated with the map. The layerId for |
logo
@property (nonatomic, readonly, nonnull) MMKLogo *logo; |
Mappable logo object.
poiLimit
@property (nonatomic, assign, unsafe_unretained, readwrite, nullable) |
Limits the number of visible basemap POIs.
Optional property, can be nil.
mode
@property (nonatomic, assign, unsafe_unretained, readwrite) MMKMapMode mode; |
Selects one of predefined map style modes optimized for particular use case(transit, driving, etc). Resets json styles set with setMapStyle. MapMode.Map by deafult.
hdModeEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enables hd mode of displayed content
awesomeModelsEnabled
@property (nonatomic, assign, unsafe_unretained, readwrite, |
Enables rich textured 3d content on basemap.
valid
@property (nonatomic, readonly, getter=isValid) BOOL valid; |
Tells if this object is valid or no. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.