MapHandle class final
Owner of one native handle.
A map, with its style and camera.
See mln_map in the
C API reference.
- Implemented types
Properties
- discarding → MapHandleDiscarding
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
The native handle id, which runtime events report as their source.
no setter
- isClosed → bool
-
Whether the binding has accepted a release, dispose, or discard of
this handle.
no setter
-
ready
→ Future<
void> -
Completes once the map is ready, and fails with a MaplibreException when
it fails to become ready. Asynchronous calls on the map before then wait
for it. A failure that nothing awaits isn't reported to the zone.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addCustomGeometrySource(
String sourceId, CustomGeometrySourceOptions options) → Future< CommandCompletion> - Adds a source whose GeoJSON tiles come from callbacks.
-
addCustomVectorSource(
String sourceId, CustomVectorSourceOptions options) → Future< CommandCompletion> - Adds a source whose vector tiles come from callbacks.
-
addGeoJsonSource(
String sourceId, {GeoJsonSourceOptions? options, String? attribution}) → Future< CommandCompletion> - Adds a GeoJSON source with no data.
-
addImageSourceImage(
String sourceId, List< LatLng> coordinates, PremultipliedRgba8Image image) → Future<CommandCompletion> -
Adds an image source that shows
image. -
addStyleLayerJson(
Object? layerJson, {String? beforeLayerId}) → Future< CommandCompletion> - Adds a layer to the map's style.
-
addStyleSourceJson(
String sourceId, Object? sourceJson) → Future< CommandCompletion> - Adds a source to the map's style.
-
applyCameraDelta(
CameraDelta delta) → Future< CommandCompletion> - Moves the camera relative to where it is, as a gesture does.
-
attachAndroidHardwareBufferRing(
AndroidHardwareBufferRingDescriptor descriptor, RenderSessionAttachOptions options, {VulkanDeviceHandle? device}) → RenderSessionHandle - Creates a session that renders the map into a ring of Android hardware buffers that the library allocates.
-
attachAndroidSurface(
AndroidSurfaceDescriptor descriptor, RenderSessionAttachOptions options, {VulkanDeviceHandle? device}) → RenderSessionHandle - Creates a session that presents the map to an Android window, with a graphics context that the library creates.
-
attachDmaBufRing(
DmaBufRingDescriptor descriptor, RenderSessionAttachOptions options, {VulkanDeviceHandle? device}) → RenderSessionHandle - Creates a session that renders the map into a ring of dmabufs that the library allocates.
- Creates a session that renders the map into a ring of DXGI shared textures that the library allocates.
-
attachIoSurfaceRing(
IoSurfaceRingDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map into a ring of IOSurfaces that the library allocates.
-
attachMetalBorrowedTexture(
MetalBorrowedTextureDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map into a ring of your Metal textures.
-
attachMetalSurface(
MetalSurfaceDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map to a Metal layer.
-
attachOffscreen(
OffscreenDescriptor descriptor, RenderSessionAttachOptions options, {OffscreenDeviceHandle? device}) → RenderSessionHandle - Attaches a render session that renders the map offscreen.
-
attachOpenGlBorrowedTexture(
OpenGlBorrowedTextureDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map into a ring of your OpenGL textures.
-
attachOpenGlSurface(
OpenGlSurfaceDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map to an OpenGL surface.
-
attachVulkanBorrowedTexture(
VulkanBorrowedTextureDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map into a ring of your Vulkan images.
-
attachVulkanSurface(
VulkanSurfaceDescriptor descriptor, RenderSessionAttachOptions options) → RenderSessionHandle - Creates a session that renders the map to a Vulkan surface.
-
attachWaylandSurface(
WaylandSurfaceDescriptor descriptor, RenderSessionAttachOptions options, {VulkanDeviceHandle? device}) → RenderSessionHandle - Creates a session that presents the map to a Wayland surface, with a graphics context that the library creates.
-
attachWin32Window(
Win32WindowDescriptor descriptor, RenderSessionAttachOptions options, {VulkanDeviceHandle? device}) → RenderSessionHandle - Creates a session that presents the map to a Win32 window, with a graphics context that the library creates.
-
beginCommandGroup(
) → Future< CommandCompletion> -
Holds back the map's changes from rendering until
MapHandle.endCommandGroup(), so they show in the same frame. -
cameraForGeometry(
Object? geometry, {CameraFitOptions? fitOptions}) → Future< CameraOptions> - Computes a camera that fits a GeoJSON geometry in the map's view.
-
cameraForLatLngBounds(
LatLngBounds bounds, {CameraFitOptions? fitOptions}) → Future< CameraOptions> -
Computes a camera that fits
boundsin the map's view. -
cameraForLatLngs(
List< LatLng> coordinates, {CameraFitOptions? fitOptions}) → Future<CameraOptions> -
Computes a camera that fits
coordinatesin the map's view. -
cancelCameraTransitions(
) → Future< CommandCompletion> - Stops every running camera animation where it is.
-
cancelCameraTransitionsWithId(
int transitionId) → Future< CommandCompletion> -
Stops the running camera animations whose animation options set
transitionId. -
dispose(
) → void - Releases the map in any state, and finishes in the background.
-
dumpDebugLogs(
) → Future< CommandCompletion> - Logs debugging information about the map's style and sources.
-
endCommandGroup(
) → Future< CommandCompletion> -
Ends the group that
MapHandle.beginCommandGroup()began. -
fitCameraToGeometry(
Object? geometry, CameraFitUpdate update) → Future< CommandCompletion> - Moves the camera to fit a GeoJSON geometry in the map's view, at once or with an animation.
-
fitCameraToLatLngBounds(
LatLngBounds bounds, CameraFitUpdate update) → Future< CommandCompletion> -
Moves the camera to fit
boundsin the map's view, at once or with an animation. -
fitCameraToLatLngs(
List< LatLng> coordinates, CameraFitUpdate update) → Future<CommandCompletion> -
Moves the camera to fit
coordinatesin the map's view, at once or with an animation. -
getCamera(
) → Future< CameraQueryResult> - Reads the map's camera.
-
getFeatureState(
FeatureStateSelector selector) → Future< Object?> - Reads the state of a feature, as a JSON object.
-
getGlobalState(
) → Future< Object?> - Reads the global state of the map's style as a JSON object.
-
getImageSourceCoordinates(
String sourceId) → Future< List< LatLng> > - Reads the corners of an image source's image, clockwise from the top left.
-
getLoadedStyleJson(
) → Future< Object?> - Reads the JSON of the style that the map loaded.
-
getSnapshot(
) → MapSnapshot - Copies the map's state.
-
getStyleImage(
String imageId) → Future< StyleImageInfo?> - Reads an image of the map's style.
-
getStyleLayer(
String layerId) → Future< StyleLayerInfo?> - Reads a layer of the map's style.
-
getStyleLayerJson(
String layerId) → Future< Object?> - Reads a layer of the map's style as a [layer](https://maplibre.org/maplibre-style-spec/layers/) object.
-
getStyleLayerProperty(
String layerId, String propertyName) → Future< Object?> - Reads a property of a layer in the map's style.
-
getStyleLightProperty(
String propertyName) → Future< Object?> - Reads a property of the light of the map's style.
-
getStyleSource(
String sourceId) → Future< StyleSourceInfo?> - Reads a source of the map's style.
-
getStyleTransitionOptions(
) → Future< StyleTransitionOptions> - Reads the default transition of the map's style.
-
getStyleUrl(
) → Future< String> - Reads the URL of the map's style.
-
invalidateCustomGeometrySourceRegion(
String sourceId, LatLngBounds bounds) → Future< CommandCompletion> -
Makes a custom geometry source ask again for the tiles in
boundsthat the map still needs. -
invalidateCustomGeometrySourceTile(
String sourceId, CanonicalTileId tileId) → Future< CommandCompletion> - Makes a custom geometry source ask for a tile again when the map needs it.
-
invalidateCustomVectorSourceRegion(
String sourceId, LatLngBounds bounds) → Future< CommandCompletion> -
Makes a custom vector source ask again for the tiles in
boundsthat the map still needs. -
invalidateCustomVectorSourceTile(
String sourceId, CanonicalTileId tileId) → Future< CommandCompletion> - Makes a custom vector source ask for a tile again when the map needs it.
-
latLngBoundsForCamera(
CameraOptions camera) → Future< LatLngBounds> -
Computes the area that the map would show with
camera. -
listStyleLayers(
) → Future< List< StyleLayerInfo> > - Lists the layers of the map's style, from bottom to top.
-
listStyleSources(
) → Future< List< StyleSourceInfo> > - Lists the sources of the map's style.
-
moveStyleLayer(
String layerId, {String? beforeLayerId}) → Future< CommandCompletion> -
Moves a layer of the map's style below the layer named
beforeLayerId, or above every layer whenbeforeLayerIdis empty. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → Future< void> - Releases the map.
-
removeFeatureState(
FeatureStateSelector selector) → Future< CommandCompletion> -
Removes the feature state that
selectorselects. -
removeStyleImage(
String imageId) → Future< CommandCompletion> - Removes an image from the map's style.
-
removeStyleLayer(
String layerId) → Future< CommandCompletion> - Removes a layer from the map's style.
-
removeStyleSource(
String sourceId) → Future< CommandCompletion> - Removes a source from the map's style.
-
requestRepaint(
) → Future< CommandCompletion> - Renders a new frame of a continuous map, even when nothing changed.
-
requestStillImage(
) → Future< void> - Renders a still image of a static or tile map.
-
resize(
LogicalSize logicalSize) → Future< CommandCompletion> - Sets the map's size.
-
setBounds(
BoundOptions options) → Future< CommandCompletion> - Limits the camera's center to an area, and its zoom and pitch to ranges.
-
setCustomGeometrySourceTileData(
String sourceId, CanonicalTileId tileId, Object? data) → Future< CommandCompletion> - Sets the data of a tile in a custom geometry source.
-
setCustomGeometrySourceTileError(
String sourceId, CanonicalTileId tileId, String message) → Future< CommandCompletion> - Reports that a tile of a custom geometry source failed to load.
-
setCustomVectorSourceTileData(
String sourceId, CanonicalTileId tileId, StyleVectorTileEncoding encoding, Uint8List data) → Future< CommandCompletion> - Sets the data of a tile in a custom vector source.
-
setCustomVectorSourceTileError(
String sourceId, CanonicalTileId tileId, String message) → Future< CommandCompletion> - Reports that a tile of a custom vector source failed to load.
-
setDebugFlags(
MapDebugFlag flags) → Future< CommandCompletion> - Draws debugging overlays, such as tile borders, on the map.
-
setEventMask(
RuntimeEventFlag mask) → Future< CommandCompletion> - Selects the events that the map reports.
-
setFeatureState(
FeatureStateSelector selector, Object? state) → Future< CommandCompletion> -
Merges
stateinto the state of a feature. -
setFreeCameraOptions(
FreeCameraOptions options) → Future< CommandCompletion> - Places the camera at a position and orientation in space.
-
setGeoJsonSourceData(
String sourceId, Object? data) → Future< CommandCompletion> - Replaces the data of a GeoJSON source.
-
setGeoJsonSourceSynchronousTiling(
String sourceId, bool enabled) → Future< CommandCompletion> - Sets whether a GeoJSON source builds its tiles while the map renders.
-
setGeoJsonSourceUrl(
String sourceId, String url) → Future< CommandCompletion> -
Makes a GeoJSON source load its data from
url. -
setGlobalStateProperty(
String propertyName, Object? value) → Future< CommandCompletion> -
Sets a value that the style's
global-state[expressions](https://maplibre.org/maplibre-style-spec/expressions/) read. -
setImageSourceCoordinates(
String sourceId, List< LatLng> coordinates) → Future<CommandCompletion> - Moves the image of an image source.
-
setImageSourceImage(
String sourceId, PremultipliedRgba8Image image) → Future< CommandCompletion> - Replaces the image of an image source.
-
setImageSourceUrl(
String sourceId, String url) → Future< CommandCompletion> -
Makes an image source load its image from
url. -
setProjectionMode(
ProjectionModeOptions options) → Future< CommandCompletion> - Sets whether the map draws in perspective or axonometric projection, and how much it skews the view.
-
setRenderingStatsViewEnabled(
bool enabled) → Future< CommandCompletion> - Shows or hides an overlay of rendering statistics on the map.
-
setStyleImage(
String imageId, PremultipliedRgba8Image image, {StyleImageOptions? options}) → Future< CommandCompletion> -
Adds an image to the map's style, or replaces the image named
imageId. -
setStyleJson(
Object? json) → Future< CommandCompletion> -
Loads the map's style from
json. -
setStyleLayerProperty(
String layerId, String propertyName, Object? value) → Future< CommandCompletion> - Sets a property of a layer in the map's style.
-
setStyleLightJson(
Object? lightJson) → Future< CommandCompletion> - Replaces the [light](https://maplibre.org/maplibre-style-spec/light/) of the map's style.
-
setStyleLightProperty(
String propertyName, Object? value) → Future< CommandCompletion> - Sets a property of the light of the map's style.
-
setStyleSourceVolatile(
String sourceId, bool isVolatile) → Future< CommandCompletion> - Sets whether a source is volatile.
-
setStyleTransitionOptions(
StyleTransitionOptions options) → Future< CommandCompletion> - Sets the default transition of the map's style.
-
setStyleUrl(
String url) → Future< CommandCompletion> -
Loads the map's style from
url. -
setTileOptions(
MapTileOptions options) → Future< CommandCompletion> - Sets how the map chooses which tiles to load, and at what detail.
-
setViewportOptions(
MapViewportOptions options) → Future< CommandCompletion> - Sets how the map orients and constrains its view.
-
toString(
) → String -
A string representation of this object.
override
-
updateCamera(
CameraUpdate update) → Future< CommandCompletion> - Moves the camera, at once or with an animation.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited