Interface Map
- Summary
- Methods
- getCameraPosition
- cameraPosition
- cameraPosition
- cameraPosition
- getVisibleRegion
- visibleRegion
- move
- move
- getCameraBounds
- isNightModeEnabled
- setNightModeEnabled
- isZoomGesturesEnabled
- setZoomGesturesEnabled
- isScrollGesturesEnabled
- setScrollGesturesEnabled
- isTiltGesturesEnabled
- setTiltGesturesEnabled
- isRotateGesturesEnabled
- setRotateGesturesEnabled
- isFastTapEnabled
- setFastTapEnabled
- getMapType
- setMapType
- addInputListener
- removeInputListener
- addCameraListener
- removeCameraListener
- setMapLoadedListener
- getMapObjects
- addTapListener
- removeTapListener
- deselectGeoObject
- selectGeoObject
- getLogo
- getPoiLimit
- setPoiLimit
- isIndoorEnabled
- setIndoorEnabled
- addIndoorStateListener
- removeIndoorStateListener
- setMapStyle
- setMapStyle
- resetMapStyles
- set2DMode
- addMapObjectLayer
- projection
- getMode
- setMode
- isHdModeEnabled
- setHdModeEnabled
- wipe
- isAwesomeModelsEnabled
- setAwesomeModelsEnabled
- addTileLayer
- isValid
Package world.mappable.mapkit.map
interface Map
The object that is used to interact with the map.
Summary
Methods
|
Type and modifiers |
Method and Description |
|
cameraPosition(@NonNull Geometry geometry) |
|
|
cameraPosition(@NonNull Geometry geometry, |
|
|
cameraPosition(@NonNull Geometry geometry, |
|
|
visibleRegion(@NonNull CameraPosition cameraPosition) |
|
|
void |
move(@NonNull CameraPosition cameraPosition, |
|
void |
move(@NonNull CameraPosition cameraPosition) |
|
boolean |
isNightModeEnabled() |
|
void |
setNightModeEnabled(boolean nightModeEnabled) |
|
boolean |
isZoomGesturesEnabled() |
|
void |
setZoomGesturesEnabled(boolean zoomGesturesEnabled) |
|
boolean |
isScrollGesturesEnabled() |
|
void |
setScrollGesturesEnabled(boolean scrollGesturesEnabled) |
|
boolean |
isTiltGesturesEnabled() |
|
void |
setTiltGesturesEnabled(boolean tiltGesturesEnabled) |
|
boolean |
isRotateGesturesEnabled() |
|
void |
setRotateGesturesEnabled(boolean rotateGesturesEnabled) |
|
boolean |
isFastTapEnabled() |
|
void |
setFastTapEnabled(boolean fastTapEnabled) |
|
getMapType() |
|
|
void |
setMapType(@NonNull MapType mapType) |
|
void |
addInputListener(@NonNull InputListener inputListener) |
|
void |
removeInputListener(@NonNull InputListener inputListener) |
|
void |
addCameraListener(@NonNull CameraListener cameraListener) |
|
void |
removeCameraListener(@NonNull CameraListener cameraListener) |
|
void |
setMapLoadedListener(@Nullable MapLoadedListener mapLoadedListener) |
|
void |
addTapListener(@NonNull GeoObjectTapListener tapListener) |
|
void |
removeTapListener(@NonNull GeoObjectTapListener tapListener) |
|
void |
deselectGeoObject() |
|
void |
selectGeoObject(@NonNull GeoObjectSelectionMetadata selectionMetaData) |
|
getLogo() |
|
|
java.lang.Integer |
getPoiLimit() |
|
void |
setPoiLimit(@Nullable java.lang.Integer poiLimit) |
|
boolean |
isIndoorEnabled() |
|
void |
setIndoorEnabled(boolean indoorEnabled) |
|
void |
addIndoorStateListener(@NonNull IndoorStateListener indoorStateListener) |
|
void |
removeIndoorStateListener(@NonNull IndoorStateListener indoorStateListener) |
|
boolean |
setMapStyle(@NonNull java.lang.String style) |
|
boolean |
setMapStyle(int id, |
|
void |
resetMapStyles() |
|
void |
set2DMode(boolean enable) |
|
addMapObjectLayer(@NonNull java.lang.String layerId) |
|
|
projection() |
|
|
getMode() |
|
|
void |
|
|
boolean |
isHdModeEnabled() |
|
void |
setHdModeEnabled(boolean hdModeEnabled) |
|
void |
wipe() |
|
boolean |
isAwesomeModelsEnabled() |
|
void |
setAwesomeModelsEnabled(boolean awesomeModelsEnabled) |
|
addTileLayer(@NonNull java.lang.String layerId, |
|
|
boolean |
isValid() |
Methods
getCameraPosition
|
@NonNull |
|
Returns |
|
Current camera position. Target position must be within latitude [-90, 90] and longitude [-180, 180]. |
cameraPosition
|
@NonNull |
Calculates the camera position that projects the specified geometry into the current focusRect, or the full view if the focusRect is not set.
cameraPosition
|
@NonNull |
Calculates the camera position that projects the specified geometry into the custom focusRect.
cameraPosition
|
@NonNull |
|
Returns |
|
Camera position that projects the specified geometry into the custom focusRect, with custom azimuth and tilt camera parameters. If focus rect is not provided, current focus rect is used. |
getVisibleRegion
|
@NonNull |
|
Returns |
|
The map region that is currently visible. Region IS bounded by latitude limits [-90, 90] and IS NOT bounded by longitude limits [-180, 180]. If the longitude exceeds its limits, we see the world's edge and another instance of the world beyond this edge. |
visibleRegion
|
@NonNull |
|
Returns |
|
The map region that is visible from the given camera position. Region IS bounded by latitude limits [-90, 90] and IS NOT bounded by longitude limits [-180, 180]. If the longitude exceeds its limits, we see the world's edge and another instance of the world beyond this edge. |
move
|
void move(@NonNull CameraPosition cameraPosition, |
Changes camera position.
Can cancel a previous unfinished movement.
|
Parameters |
|
|
|
Required. Defines animation parameters. @see mapkit.Animation for more details. |
|
|
A function that takes the bool argument marking the camera action complete. Invoked when:
|
move
|
void move(@NonNull CameraPosition cameraPosition) |
Immediately changes the camera position.
Can cancel a previous unfinished movement.
getCameraBounds
|
@NonNull |
isNightModeEnabled
|
boolean isNightModeEnabled() |
If enabled, night mode will reduce map brightness and improve contrast.
setNightModeEnabled
|
void setNightModeEnabled(boolean nightModeEnabled) |
isZoomGesturesEnabled
|
boolean isZoomGesturesEnabled() |
Enable/disable zoom gestures, for example: - pinch - double tap (zoom in) - tap with two fingers (zoom out)
setZoomGesturesEnabled
|
void setZoomGesturesEnabled(boolean zoomGesturesEnabled) |
isScrollGesturesEnabled
|
boolean isScrollGesturesEnabled() |
Enable/disable scroll gestures, such as the pan gesture.
setScrollGesturesEnabled
|
void setScrollGesturesEnabled(boolean scrollGesturesEnabled) |
isTiltGesturesEnabled
|
boolean isTiltGesturesEnabled() |
Enable/disable tilt gestures, such as parallel pan with two fingers.
setTiltGesturesEnabled
|
void setTiltGesturesEnabled(boolean tiltGesturesEnabled) |
isRotateGesturesEnabled
|
boolean isRotateGesturesEnabled() |
Enable/disable rotation gestures, such as rotation with two fingers.
setRotateGesturesEnabled
|
void setRotateGesturesEnabled(boolean rotateGesturesEnabled) |
isFastTapEnabled
|
boolean isFastTapEnabled() |
Removes the 300 ms delay in emitting a tap gesture.
However, a double-tap will emit a tap gesture along with a double-tap.
setFastTapEnabled
|
void setFastTapEnabled(boolean fastTapEnabled) |
getMapType
|
@NonNull |
Sets the base map type.
setMapType
|
void setMapType(@NonNull MapType mapType) |
addInputListener
|
void addInputListener(@NonNull InputListener inputListener) |
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
|
void removeInputListener(@NonNull InputListener inputListener) |
Removes input listeners.
addCameraListener
|
void addCameraListener(@NonNull CameraListener cameraListener) |
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
|
void removeCameraListener(@NonNull CameraListener cameraListener) |
Removes camera listeners.
setMapLoadedListener
|
void setMapLoadedListener(@Nullable MapLoadedListener mapLoadedListener) |
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.
getMapObjects
|
@NonNull |
|
Returns |
|
List of map objects associated with the map. The layerId for this collection can be retrieved via LayerIds.mapObjectsLayerId |
addTapListener
|
void addTapListener(@NonNull GeoObjectTapListener tapListener) |
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
|
void removeTapListener(@NonNull GeoObjectTapListener tapListener) |
Removes a tap listener that is used to obtain brief geo object info.
deselectGeoObject
|
void deselectGeoObject() |
Resets the currently selected geo object.
selectGeoObject
|
void selectGeoObject(@NonNull GeoObjectSelectionMetadata selectionMetaData) |
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.
getLogo
|
@NonNull |
Mappable logo object.
getPoiLimit
|
@Nullable |
Limits the number of visible basemap POIs.
Optional property, can be null.
setPoiLimit
|
void setPoiLimit(@Nullable java.lang.Integer poiLimit) |
isIndoorEnabled
|
boolean isIndoorEnabled() |
Enables/disables indoor plans on the map.
Disabled by default.
setIndoorEnabled
|
void setIndoorEnabled(boolean indoorEnabled) |
addIndoorStateListener
|
void addIndoorStateListener(@NonNull IndoorStateListener indoorStateListener) |
Subscribe to indoor state change events.
The class does not retain the object in the 'indoorStateListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
removeIndoorStateListener
|
void removeIndoorStateListener(@NonNull IndoorStateListener indoorStateListener) |
Unsubscribe from indoor state change events.
setMapStyle
|
boolean setMapStyle(@NonNull java.lang.String 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.
setMapStyle
|
boolean setMapStyle(int id, |
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.
set2DMode
|
void set2DMode(boolean 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.
addMapObjectLayer
|
@NonNull |
Creates a new independent map object collection linked to the specified layer ID.
Sublayers will be added after corresponding sublayers of the topmost layer.
projection
|
@NonNull |
Provides map projection
getMode
|
@NonNull |
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.
setMode
|
void setMode(@NonNull MapMode mode) |
isHdModeEnabled
|
boolean isHdModeEnabled() |
Enables hd mode of displayed content
setHdModeEnabled
|
void setHdModeEnabled(boolean hdModeEnabled) |
wipe
|
void wipe() |
Erases tiles, caches, etc.
Does not trigger the next frame generation.
isAwesomeModelsEnabled
|
boolean isAwesomeModelsEnabled() |
Enables rich textured 3d content on basemap.
setAwesomeModelsEnabled
|
void setAwesomeModelsEnabled(boolean awesomeModelsEnabled) |
addTileLayer
|
@NonNull |
Adds tile layer.
isValid
|
boolean isValid() |
Tells if this Map is valid or not.
Any other method (except for this one) called on an invalid Map will throw java.lang.RuntimeException. An instance 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.