MapInterface
Map class provides map rendering functionality.
Functions
addPersistentStyleCustomLayer
Link copied to clipboard
abstract fun addPersistentStyleCustomLayer(@NonNull layerId: String, @NonNull layerHost: CustomLayerHost, @Nullable layerPosition: LayerPosition): Expected<String, None>
Content copied to clipboard
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addPersistentStyleLayer
Link copied to clipboard
abstract fun addPersistentStyleLayer(@NonNull properties: Value, @Nullable layerPosition: LayerPosition): Expected<String, None>
Content copied to clipboard
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleCustomGeometrySource
Link copied to clipboard
abstract fun addStyleCustomGeometrySource(@NonNull sourceId: String, @NonNull options: CustomGeometrySourceOptions): Expected<String, None>
Content copied to clipboard
Adds a custom geometry to be used in the style.
addStyleCustomLayer
Link copied to clipboard
abstract fun addStyleCustomLayer(@NonNull layerId: String, @NonNull layerHost: CustomLayerHost, @Nullable layerPosition: LayerPosition): Expected<String, None>
Content copied to clipboard
Adds a new [style custom layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleImage
Link copied to clipboard
abstract fun addStyleImage(@NonNull imageId: String, scale: Float, @NonNull image: Image, sdf: Boolean, @NonNull stretchX: List<ImageStretches>, @NonNull stretchY: List<ImageStretches>, @Nullable content: ImageContent): Expected<String, None>
Content copied to clipboard
Adds an image to be used in the style.
addStyleLayer
Link copied to clipboard
abstract fun addStyleLayer(@NonNull properties: Value, @Nullable layerPosition: LayerPosition): Expected<String, None>
Content copied to clipboard
Adds a new [style layer](https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers).
addStyleModel
Link copied to clipboard
addStyleSource
Link copied to clipboard
addViewAnnotation
Link copied to clipboard
abstract fun addViewAnnotation(@NonNull identifier: String, @NonNull options: ViewAnnotationOptions): Expected<String, None>
Content copied to clipboard
cameraForCoordinateBounds
Link copied to clipboard
abstract fun cameraForCoordinateBounds(@NonNull bounds: CoordinateBounds, @NonNull padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions
Content copied to clipboard
Convenience method that returns the `camera options` object for given parameters.
cameraForCoordinates
Link copied to clipboard
abstract fun cameraForCoordinates(@NonNull coordinates: List<Point>, @NonNull camera: CameraOptions, @NonNull box: ScreenBox): CameraOptions
Content copied to clipboard
Convenience method that adjusts the provided `camera options` object for given parameters.
abstract fun cameraForCoordinates(@NonNull coordinates: List<Point>, @NonNull padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions
Content copied to clipboard
Convenience method that returns the `camera options` object for given parameters.
cameraForGeometry
Link copied to clipboard
abstract fun cameraForGeometry(@NonNull geometry: Geometry, @NonNull padding: EdgeInsets, @Nullable bearing: Double, @Nullable pitch: Double): CameraOptions
Content copied to clipboard
Convenience method that returns the `camera options` object for given parameters.
coordinateBoundsForCamera
Link copied to clipboard
abstract fun coordinateBoundsForCamera(@NonNull camera: CameraOptions): CoordinateBounds
Content copied to clipboard
Returns the `coordinate bounds` for a given camera.
coordinateBoundsForCameraUnwrapped
Link copied to clipboard
abstract fun coordinateBoundsForCameraUnwrapped(@NonNull camera: CameraOptions): CoordinateBounds
Content copied to clipboard
Returns the `coordinate bounds` for a given camera.
coordinateBoundsZoomForCamera
Link copied to clipboard
abstract fun coordinateBoundsZoomForCamera(@NonNull camera: CameraOptions): CoordinateBoundsZoom
Content copied to clipboard
Returns the `coordinate bounds` and the `zoom` for a given `camera`.
coordinateBoundsZoomForCameraUnwrapped
Link copied to clipboard
abstract fun coordinateBoundsZoomForCameraUnwrapped(@NonNull camera: CameraOptions): CoordinateBoundsZoom
Content copied to clipboard
Returns the unwrapped `coordinate bounds` and `zoom` for a given `camera`.
coordinateForPixel
Link copied to clipboard
Calculates a geographical `coordinate` (i.e., longitude-latitude pair) that corresponds to a `screen coordinate`.
coordinateInfoForPixel
Link copied to clipboard
abstract fun coordinateInfoForPixel(@NonNull pixel: ScreenCoordinate): CoordinateInfo
Content copied to clipboard
Calculates the geographical coordinate information that corresponds to a given screen coordinate.
coordinatesForPixels
Link copied to clipboard
abstract fun coordinatesForPixels(@NonNull pixels: List<ScreenCoordinate>): List<Point>
Content copied to clipboard
Calculates geographical `coordinates` (i.e., longitude-latitude pairs) that correspond to `screen coordinates`.
coordinatesInfoForPixels
Link copied to clipboard
abstract fun coordinatesInfoForPixels(@NonNull pixels: List<ScreenCoordinate>): List<CoordinateInfo>
Content copied to clipboard
Calculates the geographical coordinates information that corresponds to the given screen coordinates.
createRenderer
Link copied to clipboard
abstract fun createRenderer()
Content copied to clipboard
Creates the infrastructure needed for rendering the map.
destroyRenderer
Link copied to clipboard
abstract fun destroyRenderer()
Content copied to clipboard
Destroys the infrastructure needed for rendering the map, releasing resources.
dragStart
Link copied to clipboard
Prepares the drag gesture to use the provided screen coordinate as a pivot `point`.
getBounds
Link copied to clipboard
Returns the `camera bounds` of the map.
getCameraState
Link copied to clipboard
Returns the current `camera state`.
getDebug
Link copied to clipboard
Returns the `map debug options`.
getDragCameraOptions
Link copied to clipboard
abstract fun getDragCameraOptions(@NonNull fromPoint: ScreenCoordinate, @NonNull toPoint: ScreenCoordinate): CameraOptions
Content copied to clipboard
Calculates target point where camera should move after drag.
getElevation
Link copied to clipboard
Gets elevation for the given coordinate.
getFeatureState
Link copied to clipboard
abstract fun getFeatureState(@NonNull sourceId: String, @Nullable sourceLayerId: String, @NonNull featureId: String, @NonNull callback: QueryFeatureStateCallback)
Content copied to clipboard
Gets the state map of a feature within a style source.
getFreeCameraOptions
Link copied to clipboard
Gets the map's current free camera options.
getMapOptions
Link copied to clipboard
Returns the `map options`.
getPrefetchZoomDelta
Link copied to clipboard
Returns the map's prefetch zoom delta.
getRenderCacheOptions
Link copied to clipboard
Returns the `render cache options` used by the map.
getRenderWorldCopies
Link copied to clipboard
Returns whether multiple copies of the world are being rendered side by side beyond -180 and 180 degrees longitude.
getResourceOptions
Link copied to clipboard
Gets the resource options for the map.
getStyleAtmosphereProperty
Link copied to clipboard
abstract fun getStyleAtmosphereProperty(@NonNull property: String): StylePropertyValue
Content copied to clipboard
Gets the value of a style atmosphere property.
getStyleDefaultCamera
Link copied to clipboard
Returns the map style's default camera, if any, or a default camera otherwise.
getStyleImage
Link copied to clipboard
Get an `image` from the style.
getStyleJSON
Link copied to clipboard
Get the JSON serialization string of the current style in use.
getStyleLayerProperties
Link copied to clipboard
getStyleLayerProperty
Link copied to clipboard
abstract fun getStyleLayerProperty(@NonNull layerId: String, @NonNull property: String): StylePropertyValue
Content copied to clipboard
Gets the value of style layer property.
getStyleLayers
Link copied to clipboard
Returns the existing style layers.
getStyleLightProperty
Link copied to clipboard
abstract fun getStyleLightProperty(@NonNull property: String): StylePropertyValue
Content copied to clipboard
Gets the value of a style light property.
abstract fun getStyleLightProperty(@NonNull id: String, @NonNull property: String): StylePropertyValue
Content copied to clipboard
getStyleLights
Link copied to clipboard
getStyleProjectionProperty
Link copied to clipboard
abstract fun getStyleProjectionProperty(@NonNull property: String): StylePropertyValue
Content copied to clipboard
Gets the value of a style projection property.
getStyleSourceProperties
Link copied to clipboard
getStyleSourceProperty
Link copied to clipboard
abstract fun getStyleSourceProperty(@NonNull sourceId: String, @NonNull property: String): StylePropertyValue
Content copied to clipboard
Gets the value of style source property.
getStyleSources
Link copied to clipboard
Returns the existing style sources.
getStyleTerrainProperty
Link copied to clipboard
abstract fun getStyleTerrainProperty(@NonNull property: String): StylePropertyValue
Content copied to clipboard
Gets the value of a style terrain property.
getStyleTransition
Link copied to clipboard
Returns the map style's transition options.
getStyleURI
Link copied to clipboard
Get the URI of the current style in use.
getViewAnnotationOptions
Link copied to clipboard
abstract fun getViewAnnotationOptions(@NonNull identifier: String): Expected<String, ViewAnnotationOptions>
Content copied to clipboard
hasStyleImage
Link copied to clipboard
Checks whether an image exists.
hasStyleModel
Link copied to clipboard
Checks whether a model exists.
invalidateStyleCustomGeometrySourceRegion
Link copied to clipboard
abstract fun invalidateStyleCustomGeometrySourceRegion(@NonNull sourceId: String, @NonNull bounds: CoordinateBounds): Expected<String, None>
Content copied to clipboard
Invalidate region for provided custom geometry source.
invalidateStyleCustomGeometrySourceTile
Link copied to clipboard
abstract fun invalidateStyleCustomGeometrySourceTile(@NonNull sourceId: String, @NonNull tileId: CanonicalTileID): Expected<String, None>
Content copied to clipboard
Invalidate tile for provided custom geometry source.
isGestureInProgress
Link copied to clipboard
Returns `true` if a gesture is currently in progress.
isMapLoaded
Link copied to clipboard
Returns `true` when the map is completely rendered, `false` otherwise.
isStyleLayerPersistent
Link copied to clipboard
isStyleLoaded
Link copied to clipboard
Check if the style is completely loaded.
isUserAnimationInProgress
Link copied to clipboard
Returns `true` if user animation is currently in progress.
moveStyleLayer
Link copied to clipboard
abstract fun moveStyleLayer(@NonNull layerId: String, @Nullable layerPosition: LayerPosition): Expected<String, None>
Content copied to clipboard
Moves an existing style layer
pixelForCoordinate
Link copied to clipboard
abstract fun pixelForCoordinate(@NonNull coordinate: Point): ScreenCoordinate
Content copied to clipboard
Calculates a `screen coordinate` that corresponds to a geographical coordinate (i.e., longitude-latitude pair).
pixelsForCoordinates
Link copied to clipboard
abstract fun pixelsForCoordinates(@NonNull coordinates: List<Point>): List<ScreenCoordinate>
Content copied to clipboard
Calculates `screen coordinates` that correspond to geographical `coordinates` (i.e., longitude-latitude pairs).
queryFeatureExtensions
Link copied to clipboard
Queries for feature extension values in a GeoJSON source.
queryRenderedFeatures
Link copied to clipboard
abstract fun queryRenderedFeatures(@NonNull geometry: RenderedQueryGeometry, @NonNull options: RenderedQueryOptions, @NonNull callback: QueryFeaturesCallback): Cancelable
Content copied to clipboard
Content copied to clipboard
Content copied to clipboard
Content copied to clipboard
Queries the map for rendered features.
querySourceFeatures
Link copied to clipboard
abstract fun querySourceFeatures(@NonNull sourceId: String, @NonNull options: SourceQueryOptions, @NonNull callback: QueryFeaturesCallback)
Content copied to clipboard
Queries the map for source features.
reduceMemoryUse
Link copied to clipboard
abstract fun reduceMemoryUse()
Content copied to clipboard
Reduces memory use.
removeFeatureState
Link copied to clipboard
removeStyleImage
Link copied to clipboard
removeStyleLayer
Link copied to clipboard
removeStyleModel
Link copied to clipboard
removeStyleSource
Link copied to clipboard
removeViewAnnotation
Link copied to clipboard
setCamera
Link copied to clipboard
Changes the map view by any combination of center, zoom, bearing, and pitch, without an animated transition.
Sets the map view with the free camera options.
setConstrainMode
Link copied to clipboard
Sets the map `constrain mode`.
setFeatureState
Link copied to clipboard
setGestureInProgress
Link copied to clipboard
Tells the map rendering engine that there is currently a gesture in progress.
setMemoryBudget
Link copied to clipboard
setNorthOrientation
Link copied to clipboard
Sets the north `orientation mode`.
setPrefetchZoomDelta
Link copied to clipboard
When loading a map, if prefetch zoom `delta` is set to any number greater than 0, the map will first request a tile at zoom level lower than `zoom - delta`, with requested zoom level a multiple of `delta`, in an attempt to display a full map at lower resolution as quick as possible.
setRenderCacheOptions
Link copied to clipboard
Enables or disables the experimental render cache feature.
setRenderWorldCopies
Link copied to clipboard
Sets whether multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude.
setStyleAtmosphere
Link copied to clipboard
setStyleAtmosphereProperty
Link copied to clipboard
setStyleCustomGeometrySourceTileData
Link copied to clipboard
setStyleGeoJSONSourceData
Link copied to clipboard
Content copied to clipboard
setStyleJSON
Link copied to clipboard
Load the style from a provided JSON string.
setStyleLayerProperties
Link copied to clipboard
setStyleLight
Link copied to clipboard
setStyleLightProperty
Link copied to clipboard
Sets a value to the the style light property.
setStyleLights
Link copied to clipboard
setStyleProjection
Link copied to clipboard
setStyleProjectionProperty
Link copied to clipboard
setStyleSourceProperties
Link copied to clipboard
setStyleTerrain
Link copied to clipboard
setStyleTerrainProperty
Link copied to clipboard
setStyleTransition
Link copied to clipboard
abstract fun setStyleTransition(@NonNull transitionOptions: TransitionOptions)
Content copied to clipboard
Overrides the map style's transition options with user-provided options.
setStyleURI
Link copied to clipboard
Load style from provided URI.
setUserAnimationInProgress
Link copied to clipboard
Tells the map rendering engine that the animation is currently performed by the user (e.g.
setViewAnnotationPositionsUpdateListener
Link copied to clipboard
abstract fun setViewAnnotationPositionsUpdateListener(@Nullable listener: ViewAnnotationPositionsUpdateListener)
Content copied to clipboard
setViewportMode
Link copied to clipboard
Sets the `viewport mode`.
styleLayerExists
Link copied to clipboard
Checks whether a given style layer exists.
styleSourceExists
Link copied to clipboard
Checks whether a given style source exists.
tileCover
Link copied to clipboard
abstract fun tileCover(@NonNull tileCoverOptions: TileCoverOptions, @Nullable cameraOptions: CameraOptions): List<CanonicalTileID>
Content copied to clipboard
triggerRepaint
Link copied to clipboard
abstract fun triggerRepaint()
Content copied to clipboard
Triggers a repaint of the map.
unsubscribe
Link copied to clipboard
Unsubscribes an `observer` from all events.
updateStyleImageSourceImage
Link copied to clipboard
updateViewAnnotation
Link copied to clipboard
abstract fun updateViewAnnotation(@NonNull identifier: String, @NonNull options: ViewAnnotationOptions): Expected<String, None>
Content copied to clipboard