MMKMap
- Summary
- Instance methods
- cameraPosition(with:)
- cameraPosition(with:focus:)
- cameraPosition(with:azimuth:tilt:focus:)
- visibleRegion(with:)
- move(with:animation:cameraCallback:)
- move(with:)
- addInputListener(with:)
- removeInputListener(with:)
- addCameraListener(with:)
- removeCameraListener(with:)
- setMapLoadedListenerWith(_:)
- addTapListener(with:)
- removeTapListener(with:)
- deselectGeoObject()
- selectGeoObject(withSelectionMetaData:)
- setMapStyleWithStyle(_:)
- setMapStyleWithId(_:style:)
- resetMapStyles()
- set2DMode(withEnable:)
- projection()
- wipe()
- addTileLayer(withLayerId:layerOptions:createTileDataSource:)
- Properties
class MMKMap : NSObject |
The object that is used to interact with the map.
Summary
Instance methods
func cameraPosition(with geometry: MMKGeometry) -> MMKCameraPosition |
func cameraPosition(with geometry: MMKGeometry, |
func cameraPosition(with geometry: MMKGeometry, |
func visibleRegion(with cameraPosition: MMKCameraPosition) -> MMKVisibleRegion |
func move(with cameraPosition: MMKCameraPosition, |
func move(with cameraPosition: MMKCameraPosition) |
func addInputListener(with inputListener: MMKMapInputListener) |
func removeInputListener(with inputListener: MMKMapInputListener) |
func addCameraListener(with cameraListener: MMKMapCameraListener) |
func removeCameraListener(with cameraListener: MMKMapCameraListener) |
func setMapLoadedListenerWith( mapLoadedListener: MMKMapLoadedListener_?) |
func addTapListener(with tapListener: MMKLayersGeoObjectTapListener) |
func removeTapListener(with tapListener: MMKLayersGeoObjectTapListener) |
func deselectGeoObject() |
func selectGeoObject(withSelectionMetaData selectionMetaData: MMKGeoObjectSelectionMetadata) |
func setMapStyleWithStyle(_ style: String) -> Bool |
func setMapStyleWithId(_ id: Int, style: String) -> Bool |
func resetMapStyles() |
func set2DMode(withEnable enable: Bool) |
func projection() -> MMKProjection |
func wipe() |
func addTileLayer(withLayerId layerId: String, |
Properties
var cameraPosition: MMKCameraPosition { get } |
var visibleRegion: MMKVisibleRegion { get } |
var cameraBounds: MMKCameraBounds { get } |
var isNightModeEnabled: Bool { get set } |
var isZoomGesturesEnabled: Bool { get set } |
var isScrollGesturesEnabled: Bool { get set } |
var isTiltGesturesEnabled: Bool { get set } |
var isRotateGesturesEnabled: Bool { get set } |
var isFastTapEnabled: Bool { get set } |
var mapType: MMKMapType { get set } |
var mapObjects: MMKMapObjectCollection { get } |
var poiLimit: NSNumber? { get set } |
var mode: MMKMapMode { get set } |
var isHdModeEnabled: Bool { get set } |
var isAwesomeModelsEnabled: Bool { get set } |
var isValid: Bool { get } |
Instance methods
cameraPosition(with:)
func cameraPosition(with geometry: MMKGeometry) -> MMKCameraPosition |
Calculates the camera position that projects the specified geometry into the current focusRect, or the full view if the focusRect is not set.
cameraPosition(with:focus:)
func cameraPosition(with geometry: MMKGeometry, |
Calculates the camera position that projects the specified geometry into the custom focusRect.
cameraPosition(with:azimuth:tilt:focus:)
func cameraPosition(with geometry: MMKGeometry, |
Returns |
Camera position that projects the specified geometry into the |
visibleRegion(with:)
func visibleRegion(with cameraPosition: MMKCameraPosition) -> MMKVisibleRegion |
Returns |
The map region that is visible from the given camera |
move(with:animation:cameraCallback:)
func move(with cameraPosition: MMKCameraPosition, |
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. |
move(with:)
func move(with cameraPosition: MMKCameraPosition) |
Immediately changes the camera position. Can cancel a previous unfinished movement.
addInputListener(with:)
func addInputListener(with inputListener: MMKMapInputListener) |
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.
removeInputListener(with:)
func removeInputListener(with inputListener: MMKMapInputListener) |
Removes input listeners.
addCameraListener(with:)
func addCameraListener(with cameraListener: MMKMapCameraListener) |
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.
removeCameraListener(with:)
func removeCameraListener(with cameraListener: MMKMapCameraListener) |
Removes camera listeners.
setMapLoadedListenerWith(_:)
func setMapLoadedListenerWith( mapLoadedListener: MMKMapLoadedListener_?) |
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.
addTapListener(with:)
func addTapListener(with tapListener: MMKLayersGeoObjectTapListener) |
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.
removeTapListener(with:)
func removeTapListener(with tapListener: MMKLayersGeoObjectTapListener) |
Removes a tap listener that is used to obtain brief geo object info.
deselectGeoObject()
func deselectGeoObject() |
Resets the currently selected geo object.
selectGeoObject(withSelectionMetaData:)
func selectGeoObject(withSelectionMetaData selectionMetaData: MMKGeoObjectSelectionMetadata) |
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(_:)
func setMapStyleWithStyle(_ style: String) -> Bool |
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:)
func setMapStyleWithId(_ id: Int, style: String) -> Bool |
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()
func resetMapStyles() |
Resets all JSON style transformations applied to the map.
set2DMode(withEnable:)
func set2DMode(withEnable enable: Bool) |
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()
func projection() -> MMKProjection |
Provides map projection
wipe()
func wipe() |
Erases tiles, caches, etc. Does not trigger the next frame generation.
addTileLayer(withLayerId:layerOptions:createTileDataSource:)
func addTileLayer(withLayerId layerId: String, |
Adds tile layer.
Properties
cameraPosition
var cameraPosition: MMKCameraPosition { get } |
Returns |
Current camera position. Target position must be within |
visibleRegion
var visibleRegion: MMKVisibleRegion { get } |
Returns |
The map region that is currently visible. Region IS bounded |
cameraBounds
var cameraBounds: MMKCameraBounds { get } |
Undocumented
isNightModeEnabled
var isNightModeEnabled: Bool { get set } |
If enabled, night mode will reduce map brightness and improve contrast.
isZoomGesturesEnabled
var isZoomGesturesEnabled: Bool { get set } |
Enable/disable zoom gestures, for example: - pinch - double tap (zoom in) - tap with two fingers (zoom out)
isScrollGesturesEnabled
var isScrollGesturesEnabled: Bool { get set } |
Enable/disable scroll gestures, such as the pan gesture.
isTiltGesturesEnabled
var isTiltGesturesEnabled: Bool { get set } |
Enable/disable tilt gestures, such as parallel pan with two fingers.
isRotateGesturesEnabled
var isRotateGesturesEnabled: Bool { get set } |
Enable/disable rotation gestures, such as rotation with two fingers.
isFastTapEnabled
var isFastTapEnabled: Bool { get set } |
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
var mapType: MMKMapType { get set } |
Sets the base map type.
mapObjects
var mapObjects: MMKMapObjectCollection { get } |
Returns |
List of map objects associated with the map. The layerId for |
logo
var logo: MMKLogo { get } |
Mappable logo object.
poiLimit
var poiLimit: NSNumber? { get set } |
Limits the number of visible basemap POIs.
Optional property, can be nil.
mode
var mode: MMKMapMode { get set } |
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.
isHdModeEnabled
var isHdModeEnabled: Bool { get set } |
Enables hd mode of displayed content
isAwesomeModelsEnabled
var isAwesomeModelsEnabled: Bool { get set } |
Enables rich textured 3d content on basemap.
isValid
var isValid: Bool { get } |
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.