pub struct MapHandle { /* private fields */ }Expand description
Implementations§
Source§impl MapHandle
impl MapHandle
Sourcepub fn add_custom_geometry_source(
&self,
source_id: &str,
options: CustomGeometrySourceOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn add_custom_geometry_source( &self, source_id: &str, options: CustomGeometrySourceOptions, ) -> Result<NativeFuture<CommandCompletion>>
Adds a source whose GeoJSON tiles come from callbacks.
See mln_map_add_custom_geometry_source in the
C API reference.
§Errors
Status::AlreadyExistswhen the style already has a source namedsource_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn add_custom_vector_source(
&self,
source_id: &str,
options: CustomVectorSourceOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn add_custom_vector_source( &self, source_id: &str, options: CustomVectorSourceOptions, ) -> Result<NativeFuture<CommandCompletion>>
Adds a source whose vector tiles come from callbacks.
See mln_map_add_custom_vector_source in the
C API reference.
§Errors
Status::AlreadyExistswhen the style already has a source namedsource_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn add_geo_json_source(
&self,
source_id: &str,
options: Option<&GeoJsonSourceOptions>,
attribution: Option<&str>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn add_geo_json_source( &self, source_id: &str, options: Option<&GeoJsonSourceOptions>, attribution: Option<&str>, ) -> Result<NativeFuture<CommandCompletion>>
Adds a GeoJSON source with no data.
Give it data with MapHandle::set_geo_json_source_data() or
MapHandle::set_geo_json_source_url(). Its options stay fixed for as
long as the style holds it.
attribution is the source’s
[attribution](https://maplibre.org/maplibre-style-spec/sources/#attribution),
or empty for none.
See mln_map_add_geo_json_source in the
C API reference.
§Errors
Status::InvalidArgumentwhen an option inoptionsis out of range.Status::AlreadyExistswhen the style already has a source namedsource_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn add_image_source_image(
&self,
source_id: &str,
coordinates: &[LatLng],
image: &PremultipliedRgba8Image<'_>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn add_image_source_image( &self, source_id: &str, coordinates: &[LatLng], image: &PremultipliedRgba8Image<'_>, ) -> Result<NativeFuture<CommandCompletion>>
Adds an image source that shows image.
coordinates are the image’s four corners, clockwise from the top left.
See mln_map_add_image_source_image in the
C API reference.
§Errors
Status::AlreadyExistswhen the style already has a source namedsource_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn add_style_layer_json(
&self,
layer_json: &str,
before_layer_id: Option<&str>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn add_style_layer_json( &self, layer_json: &str, before_layer_id: Option<&str>, ) -> Result<NativeFuture<CommandCompletion>>
Adds a layer to the map’s style.
layer_json is a
[layer](https://maplibre.org/maplibre-style-spec/layers/) object. The
layer goes below the layer named before_layer_id, or above every layer
when before_layer_id is empty.
See mln_map_add_style_layer_json in the
C API reference.
§Errors
Status::NotFoundwhen the style has no layer namedbefore_layer_id, or no source with the ID that the layer uses.Status::AlreadyExistswhen the style already has a layer with the new layer’s ID.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn add_style_source_json(
&self,
source_id: &str,
source_json: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn add_style_source_json( &self, source_id: &str, source_json: &str, ) -> Result<NativeFuture<CommandCompletion>>
Adds a source to the map’s style.
source_json is a
[source](https://maplibre.org/maplibre-style-spec/sources/) object.
See mln_map_add_style_source_json in the
C API reference.
§Errors
Status::AlreadyExistswhen the style already has a source namedsource_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn apply_camera_delta(
&self,
delta: &CameraDelta,
) -> Result<NativeFuture<CommandCompletion>>
pub fn apply_camera_delta( &self, delta: &CameraDelta, ) -> Result<NativeFuture<CommandCompletion>>
Moves the camera relative to where it is, as a gesture does.
delta can pan the map’s content by an offset on the screen, scale the
zoom, and add to the bearing and pitch. An anchor keeps one screen point
in place while the scale, bearing, or pitch changes. An anchor needs one
of those changes, and combines with an offset only when the delta has no
animation. The function finishes when the map applies the delta, before
an animation ends.
A delta that replaces an animated one starts from where that animation
left the camera, so the rest of the replaced change never happens. To
reach an exact camera, use MapHandle::update_camera().
A delta in the end phase can carry momentum, which keeps the camera
moving from the gesture’s release velocities and slows it on each
rendered frame. The gesture lasts until the momentum ends: the snapshot
keeps gesture_in_progress set, and camera events report
CameraChangeSource::Momentum. With momentum, animation sets only
transition_id and the end handler, which runs when the gesture ends.
A delta in the begin phase, MapHandle::cancel_camera_transitions(), or
a cancellation by that ID stops the momentum. A later command that sets
a field stops only the parts of the momentum that move that field. On a
tilted map, the pan moves the map’s content the same distance on the
screen in every direction.
See mln_map_apply_camera_delta in the
C API reference.
Sourcepub fn attach_dma_buf_ring(
&self,
descriptor: &DmaBufRingDescriptor,
device: Option<&VulkanDeviceHandle>,
options: &RenderSessionAttachOptions,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub fn attach_dma_buf_ring( &self, descriptor: &DmaBufRingDescriptor, device: Option<&VulkanDeviceHandle>, options: &RenderSessionAttachOptions, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Creates a session that renders the map into a ring of dmabufs that the library allocates.
Acquire each frame with RenderSessionHandle::acquire_frame(), and get
its buffer with AcquiredFrameView::get_dma_buf().
RenderSessionHandle::resize() gives the ring new buffers of the new
size.
A Vulkan build renders with device, or, when device is null, with a
device that the library creates. An OpenGL build uses an EGL context of
its own, and device must be null. Attach with
RenderDriverKind::CoreWorker.
For a reader that waits on no sync file, such as a Wayland compositor
without explicit synchronization, attach without
GpuSyncKindFlag::SYNC_FD in
RenderSessionAttachOptions::producer_sync_kinds, so that each frame
finishes before you acquire it. Keep each frame acquired until its
reader is done with the buffer. Give the ring 3 buffers, so the session
can render while you hold two frames.
See mln_map_attach_dma_buf_ring in the
C API reference.
§Errors
Status::Unsupportedwhen the graphics context can’t render into a dmabuf of any offormats.Status::NativeErrorwhen the library can’t create its Vulkan device or initialize an EGL display.
Sourcepub fn attach_offscreen(
&self,
descriptor: &OffscreenDescriptor,
options: &RenderSessionAttachOptions,
device: Option<&OffscreenDeviceHandle>,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub fn attach_offscreen( &self, descriptor: &OffscreenDescriptor, options: &RenderSessionAttachOptions, device: Option<&OffscreenDeviceHandle>, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Attaches a render session that renders the map offscreen.
Read each image’s pixels with RenderSessionHandle::read_texture().
The session renders on device. When device is null, the session
creates a device with the default options, and releases it when the
session ends.
See mln_map_attach_offscreen in the
C API reference.
§Errors
Status::InvalidStatewhen the map already has a render session.Status::NativeErrorwhendeviceis null and the platform can’t create a device.
Sourcepub unsafe fn attach_open_gl_borrowed_texture(
&self,
descriptor: &OpenGlBorrowedTextureDescriptor<'_>,
options: &RenderSessionAttachOptions,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub unsafe fn attach_open_gl_borrowed_texture( &self, descriptor: &OpenGlBorrowedTextureDescriptor<'_>, options: &RenderSessionAttachOptions, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Creates a session that renders the map into a ring of your OpenGL textures.
See mln_map_attach_open_gl_borrowed_texture in the
C API reference.
§Errors
Status::Unsupportedwhenopen_gl_supported_context_provider_mask()lacks the context’s platform, or when the target supports none of theproducer_sync_kindsinoptions.
§Safety
Native graphics objects must have the types, lifetimes, and synchronization required by the C operation.
Sourcepub unsafe fn attach_open_gl_surface(
&self,
descriptor: &OpenGlSurfaceDescriptor<'_>,
options: &RenderSessionAttachOptions,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub unsafe fn attach_open_gl_surface( &self, descriptor: &OpenGlSurfaceDescriptor<'_>, options: &RenderSessionAttachOptions, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Creates a session that renders the map to an OpenGL surface.
See mln_map_attach_open_gl_surface in the
C API reference.
§Errors
Status::Unsupportedwhenopen_gl_supported_context_provider_mask()lacks the context’s platform.
§Safety
Native graphics objects must have the types, lifetimes, and synchronization required by the C operation.
Sourcepub unsafe fn attach_vulkan_borrowed_texture(
&self,
descriptor: &VulkanBorrowedTextureDescriptor,
options: &RenderSessionAttachOptions,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub unsafe fn attach_vulkan_borrowed_texture( &self, descriptor: &VulkanBorrowedTextureDescriptor, options: &RenderSessionAttachOptions, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Creates a session that renders the map into a ring of your Vulkan images.
See mln_map_attach_vulkan_borrowed_texture in the
C API reference.
§Errors
Status::Unsupportedwhensupported_render_backend_mask()lacksRenderBackendFlag::VULKAN, or when the target supports none of theproducer_sync_kindsinoptions.
§Safety
Native graphics objects must have the types, lifetimes, and synchronization required by the C operation.
Sourcepub unsafe fn attach_vulkan_surface(
&self,
descriptor: &VulkanSurfaceDescriptor,
options: &RenderSessionAttachOptions,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub unsafe fn attach_vulkan_surface( &self, descriptor: &VulkanSurfaceDescriptor, options: &RenderSessionAttachOptions, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Creates a session that renders the map to a Vulkan surface.
See mln_map_attach_vulkan_surface in the
C API reference.
§Errors
Status::Unsupportedwhensupported_render_backend_mask()lacksRenderBackendFlag::VULKAN.
§Safety
Native graphics objects must have the types, lifetimes, and synchronization required by the C operation.
Sourcepub unsafe fn attach_wayland_surface(
&self,
descriptor: &WaylandSurfaceDescriptor,
device: Option<&VulkanDeviceHandle>,
options: &RenderSessionAttachOptions,
) -> Result<(RenderSessionHandle, NativeFuture<()>)>
pub unsafe fn attach_wayland_surface( &self, descriptor: &WaylandSurfaceDescriptor, device: Option<&VulkanDeviceHandle>, options: &RenderSessionAttachOptions, ) -> Result<(RenderSessionHandle, NativeFuture<()>)>
Creates a session that presents the map to a Wayland surface, with a graphics context that the library creates.
A Vulkan build presents with device, or, when device is null, with a
device that the library creates. An OpenGL build uses an EGL context on
the display, and device must be null. Attach with
RenderDriverKind::CoreWorker.
The session presents without waiting for the compositor, so demand at most one frame per display refresh.
Keep the surface until a release or replacement of the target, or a detach of the session, completes. Keep the display connected until the session’s detach completes. In an OpenGL build, if you also use EGL on the display, initialize it before you attach.
See mln_map_attach_wayland_surface in the
C API reference.
§Errors
Status::Unsupportedwhen you createddevicewithoutVulkanDeviceOptions::presentation.Status::Unsupportedwhen the GPU or the Vulkan loader can’t present to Wayland.Status::NativeErrorwhen the library can’t create the graphics context or present to the surface.
§Safety
Native graphics objects must have the types, lifetimes, and synchronization required by the C operation.
Sourcepub fn begin_command_group(&self) -> Result<NativeFuture<CommandCompletion>>
pub fn begin_command_group(&self) -> Result<NativeFuture<CommandCompletion>>
Holds back the map’s changes from rendering until
MapHandle::end_command_group(), so they show in the same frame.
Groups nest, and the changes render when the outermost group ends.
See mln_map_begin_command_group in the
C API reference.
Sourcepub fn camera_for_geometry(
&self,
geometry: &str,
fit_options: Option<&CameraFitOptions>,
) -> Result<NativeFuture<CameraOptions>>
pub fn camera_for_geometry( &self, geometry: &str, fit_options: Option<&CameraFitOptions>, ) -> Result<NativeFuture<CameraOptions>>
Computes a camera that fits a GeoJSON geometry in the map’s view.
geometry is a GeoJSON geometry object with at least one coordinate,
not a feature. The camera keeps the map’s bearing and pitch unless
fit_options sets them, and its zoom stays within the map’s zoom
limits.
See mln_map_camera_for_geometry in the
C API reference.
§Errors
Status::InvalidArgumentwhen the padding infit_optionsleaves no room for the area.
Sourcepub fn camera_for_lat_lng_bounds(
&self,
bounds: LatLngBounds,
fit_options: Option<&CameraFitOptions>,
) -> Result<NativeFuture<CameraOptions>>
pub fn camera_for_lat_lng_bounds( &self, bounds: LatLngBounds, fit_options: Option<&CameraFitOptions>, ) -> Result<NativeFuture<CameraOptions>>
Computes a camera that fits bounds in the map’s view.
The camera keeps the map’s bearing and pitch unless fit_options sets
them, and its zoom stays within the map’s zoom limits.
See mln_map_camera_for_lat_lng_bounds in the
C API reference.
§Errors
Status::InvalidArgumentwhen the padding infit_optionsleaves no room for the area.
Sourcepub fn camera_for_lat_lngs(
&self,
coordinates: &[LatLng],
fit_options: Option<&CameraFitOptions>,
) -> Result<NativeFuture<CameraOptions>>
pub fn camera_for_lat_lngs( &self, coordinates: &[LatLng], fit_options: Option<&CameraFitOptions>, ) -> Result<NativeFuture<CameraOptions>>
Computes a camera that fits coordinates in the map’s view.
coordinates must not be empty. The camera keeps the map’s bearing and
pitch unless fit_options sets them, and its zoom stays within the
map’s zoom limits.
See mln_map_camera_for_lat_lngs in the
C API reference.
§Errors
Status::InvalidArgumentwhen the padding infit_optionsleaves no room for the area.
Sourcepub fn cancel_camera_transitions(
&self,
) -> Result<NativeFuture<CommandCompletion>>
pub fn cancel_camera_transitions( &self, ) -> Result<NativeFuture<CommandCompletion>>
Stops every running camera animation where it is.
The end handler of each stopped animation reports
CameraTransitionOutcome::Cancelled.
See mln_map_cancel_camera_transitions in the
C API reference.
Sourcepub fn cancel_camera_transitions_with_id(
&self,
transition_id: u64,
) -> Result<NativeFuture<CommandCompletion>>
pub fn cancel_camera_transitions_with_id( &self, transition_id: u64, ) -> Result<NativeFuture<CommandCompletion>>
Stops the running camera animations whose animation options set
transition_id.
Other animations keep running. The end handler of each stopped animation
reports CameraTransitionOutcome::Cancelled.
See mln_map_cancel_camera_transitions_with_id in the
C API reference.
Sourcepub fn dispose(self) -> Result<(), ReleaseError<Self>>
pub fn dispose(self) -> Result<(), ReleaseError<Self>>
Releases the map in any state, and finishes in the background.
Use it from destructors and finalizers. Otherwise, use
MapHandle::release().
See mln_map_dispose in the
C API reference.
Sourcepub fn dump_debug_logs(&self) -> Result<NativeFuture<CommandCompletion>>
pub fn dump_debug_logs(&self) -> Result<NativeFuture<CommandCompletion>>
Logs debugging information about the map’s style and sources.
See mln_map_dump_debug_logs in the
C API reference.
Sourcepub fn end_command_group(&self) -> Result<NativeFuture<CommandCompletion>>
pub fn end_command_group(&self) -> Result<NativeFuture<CommandCompletion>>
Ends the group that MapHandle::begin_command_group() began.
See mln_map_end_command_group in the
C API reference.
Sourcepub fn fit_camera_to_geometry(
&self,
geometry: &str,
update: &CameraFitUpdate,
) -> Result<NativeFuture<CommandCompletion>>
pub fn fit_camera_to_geometry( &self, geometry: &str, update: &CameraFitUpdate, ) -> Result<NativeFuture<CommandCompletion>>
Moves the camera to fit a GeoJSON geometry in the map’s view, at once or with an animation.
geometry is a GeoJSON geometry object with at least one coordinate,
not a feature. The camera is the one that
MapHandle::camera_for_geometry() computes after the commands sent
before this one apply. The function finishes when the map applies the
change, before an animation ends.
See mln_map_fit_camera_to_geometry in the
C API reference.
§Errors
Status::InvalidArgumentwhen the padding inupdateleaves no room for the area. The camera doesn’t move.
Sourcepub fn fit_camera_to_lat_lng_bounds(
&self,
bounds: LatLngBounds,
update: &CameraFitUpdate,
) -> Result<NativeFuture<CommandCompletion>>
pub fn fit_camera_to_lat_lng_bounds( &self, bounds: LatLngBounds, update: &CameraFitUpdate, ) -> Result<NativeFuture<CommandCompletion>>
Moves the camera to fit bounds in the map’s view, at once or with an
animation.
The camera is the one that MapHandle::camera_for_lat_lng_bounds()
computes after the commands sent before this one apply. The function
finishes when the map applies the change, before an animation ends.
See mln_map_fit_camera_to_lat_lng_bounds in the
C API reference.
§Errors
Status::InvalidArgumentwhen the padding inupdateleaves no room for the area. The camera doesn’t move.
Sourcepub fn fit_camera_to_lat_lngs(
&self,
coordinates: &[LatLng],
update: &CameraFitUpdate,
) -> Result<NativeFuture<CommandCompletion>>
pub fn fit_camera_to_lat_lngs( &self, coordinates: &[LatLng], update: &CameraFitUpdate, ) -> Result<NativeFuture<CommandCompletion>>
Moves the camera to fit coordinates in the map’s view, at once or with
an animation.
coordinates must not be empty. The camera is the one that
MapHandle::camera_for_lat_lngs() computes after the commands sent
before this one apply. The function finishes when the map applies the
change, before an animation ends.
See mln_map_fit_camera_to_lat_lngs in the
C API reference.
§Errors
Status::InvalidArgumentwhen the padding inupdateleaves no room for the area. The camera doesn’t move.
Sourcepub fn get_camera(&self) -> Result<NativeFuture<CameraQueryResult>>
pub fn get_camera(&self) -> Result<NativeFuture<CameraQueryResult>>
Reads the map’s camera.
The query reads the camera after the map applies the commands sent before it.
See mln_map_get_camera in the
C API reference.
Sourcepub fn get_feature_state(
&self,
selector: &FeatureStateSelector<'_>,
) -> Result<NativeFuture<String>>
pub fn get_feature_state( &self, selector: &FeatureStateSelector<'_>, ) -> Result<NativeFuture<String>>
Reads the state of a feature, as a JSON object.
The object is empty when the feature has no state.
See mln_map_get_feature_state in the
C API reference.
Sourcepub fn get_global_state(&self) -> Result<NativeFuture<String>>
pub fn get_global_state(&self) -> Result<NativeFuture<String>>
Reads the global state of the map’s style as a JSON object.
See mln_map_get_global_state in the
C API reference.
Sourcepub fn get_image_source_coordinates(
&self,
source_id: &str,
) -> Result<NativeFuture<Vec<LatLng>>>
pub fn get_image_source_coordinates( &self, source_id: &str, ) -> Result<NativeFuture<Vec<LatLng>>>
Reads the corners of an image source’s image, clockwise from the top left.
See mln_map_get_image_source_coordinates in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t an image source.
Sourcepub fn get_loaded_style_json(&self) -> Result<NativeFuture<String>>
pub fn get_loaded_style_json(&self) -> Result<NativeFuture<String>>
Reads the JSON of the style that the map loaded.
The JSON doesn’t include the changes made to the style since it loaded.
See mln_map_get_loaded_style_json in the
C API reference.
Sourcepub fn get_snapshot(&self) -> Result<MapSnapshot>
pub fn get_snapshot(&self) -> Result<MapSnapshot>
Copies the map’s state.
The copy doesn’t wait for pending commands. To read the camera after
they apply, use MapHandle::get_camera().
See mln_map_get_snapshot in the
C API reference.
§Errors
Status::InvalidStateuntilRuntimeHandle::create_map()completes withStatus::Ok.
Sourcepub fn get_style_image(
&self,
image_id: &str,
) -> Result<NativeFuture<Option<StyleImageInfo>>>
pub fn get_style_image( &self, image_id: &str, ) -> Result<NativeFuture<Option<StyleImageInfo>>>
Reads an image of the map’s style.
Completes with no value when the style has no image named image_id.
See mln_map_get_style_image in the
C API reference.
Sourcepub fn get_style_layer(
&self,
layer_id: &str,
) -> Result<NativeFuture<Option<StyleLayerInfo>>>
pub fn get_style_layer( &self, layer_id: &str, ) -> Result<NativeFuture<Option<StyleLayerInfo>>>
Reads a layer of the map’s style.
Completes with no value when the style has no layer named layer_id.
See mln_map_get_style_layer in the
C API reference.
Sourcepub fn get_style_layer_json(
&self,
layer_id: &str,
) -> Result<NativeFuture<Option<String>>>
pub fn get_style_layer_json( &self, layer_id: &str, ) -> Result<NativeFuture<Option<String>>>
Reads a layer of the map’s style as a [layer](https://maplibre.org/maplibre-style-spec/layers/) object.
Completes with no value when the style has no layer named layer_id.
See mln_map_get_style_layer_json in the
C API reference.
Sourcepub fn get_style_layer_property(
&self,
layer_id: &str,
property_name: &str,
) -> Result<NativeFuture<Option<String>>>
pub fn get_style_layer_property( &self, layer_id: &str, property_name: &str, ) -> Result<NativeFuture<Option<String>>>
Reads a property of a layer in the map’s style.
The value can differ in form from the value that was set: a color set as
"#ff0000" reads back as ["rgba", 255, 0, 0, 1].
Completes with no value when the layer doesn’t set the property.
See mln_map_get_style_layer_property in the
C API reference.
§Errors
Status::NotFoundwhen the style has no layer namedlayer_id.
Sourcepub fn get_style_light_property(
&self,
property_name: &str,
) -> Result<NativeFuture<Option<String>>>
pub fn get_style_light_property( &self, property_name: &str, ) -> Result<NativeFuture<Option<String>>>
Reads a property of the light of the map’s style.
The value can differ in form from the value that was set: a color set as
"#ff0000" reads back as ["rgba", 255, 0, 0, 1].
Completes with no value when the light doesn’t set the property.
See mln_map_get_style_light_property in the
C API reference.
Sourcepub fn get_style_source(
&self,
source_id: &str,
) -> Result<NativeFuture<Option<StyleSourceInfo>>>
pub fn get_style_source( &self, source_id: &str, ) -> Result<NativeFuture<Option<StyleSourceInfo>>>
Reads a source of the map’s style.
A tile source with a url has an empty attribution until its TileJSON
loads, which raises RuntimeEventType::MapSourceChanged.
Completes with no value when the style has no source named source_id.
See mln_map_get_style_source in the
C API reference.
Sourcepub fn get_style_transition_options(
&self,
) -> Result<NativeFuture<StyleTransitionOptions>>
pub fn get_style_transition_options( &self, ) -> Result<NativeFuture<StyleTransitionOptions>>
Reads the default transition of the map’s style.
See mln_map_get_style_transition_options in the
C API reference.
Sourcepub fn get_style_url(&self) -> Result<NativeFuture<String>>
pub fn get_style_url(&self) -> Result<NativeFuture<String>>
Reads the URL of the map’s style.
The URL is empty when the style came from MapHandle::set_style_json().
See mln_map_get_style_url in the
C API reference.
Sourcepub fn invalidate_custom_geometry_source_region(
&self,
source_id: &str,
bounds: LatLngBounds,
) -> Result<NativeFuture<CommandCompletion>>
pub fn invalidate_custom_geometry_source_region( &self, source_id: &str, bounds: LatLngBounds, ) -> Result<NativeFuture<CommandCompletion>>
Makes a custom geometry source ask again for the tiles in bounds that
the map still needs.
See mln_map_invalidate_custom_geometry_source_region in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom geometry source.
Sourcepub fn invalidate_custom_geometry_source_tile(
&self,
source_id: &str,
tile_id: CanonicalTileId,
) -> Result<NativeFuture<CommandCompletion>>
pub fn invalidate_custom_geometry_source_tile( &self, source_id: &str, tile_id: CanonicalTileId, ) -> Result<NativeFuture<CommandCompletion>>
Makes a custom geometry source ask for a tile again when the map needs it.
See mln_map_invalidate_custom_geometry_source_tile in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom geometry source.
Sourcepub fn invalidate_custom_vector_source_region(
&self,
source_id: &str,
bounds: LatLngBounds,
) -> Result<NativeFuture<CommandCompletion>>
pub fn invalidate_custom_vector_source_region( &self, source_id: &str, bounds: LatLngBounds, ) -> Result<NativeFuture<CommandCompletion>>
Makes a custom vector source ask again for the tiles in bounds that
the map still needs.
See mln_map_invalidate_custom_vector_source_region in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom vector source.
Sourcepub fn invalidate_custom_vector_source_tile(
&self,
source_id: &str,
tile_id: CanonicalTileId,
) -> Result<NativeFuture<CommandCompletion>>
pub fn invalidate_custom_vector_source_tile( &self, source_id: &str, tile_id: CanonicalTileId, ) -> Result<NativeFuture<CommandCompletion>>
Makes a custom vector source ask for a tile again when the map needs it.
See mln_map_invalidate_custom_vector_source_tile in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom vector source.
Sourcepub fn lat_lng_bounds_for_camera(
&self,
camera: &CameraOptions,
) -> Result<NativeFuture<LatLngBounds>>
pub fn lat_lng_bounds_for_camera( &self, camera: &CameraOptions, ) -> Result<NativeFuture<LatLngBounds>>
Computes the area that the map would show with camera.
Camera fields that camera doesn’t set come from the map’s camera. The
longitudes can fall outside -180 to 180, so a view across the
antimeridian gives one continuous range.
See mln_map_lat_lng_bounds_for_camera in the
C API reference.
Sourcepub fn list_style_layers(&self) -> Result<NativeFuture<Vec<StyleLayerInfo>>>
pub fn list_style_layers(&self) -> Result<NativeFuture<Vec<StyleLayerInfo>>>
Lists the layers of the map’s style, from bottom to top.
See mln_map_list_style_layers in the
C API reference.
Sourcepub fn list_style_sources(&self) -> Result<NativeFuture<Vec<StyleSourceInfo>>>
pub fn list_style_sources(&self) -> Result<NativeFuture<Vec<StyleSourceInfo>>>
Lists the sources of the map’s style.
See mln_map_list_style_sources in the
C API reference.
Sourcepub fn move_style_layer(
&self,
layer_id: &str,
before_layer_id: Option<&str>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn move_style_layer( &self, layer_id: &str, before_layer_id: Option<&str>, ) -> Result<NativeFuture<CommandCompletion>>
Moves a layer of the map’s style below the layer named
before_layer_id, or above every layer when before_layer_id is empty.
See mln_map_move_style_layer in the
C API reference.
§Errors
Status::NotFoundwhen the style has no layer namedlayer_idorbefore_layer_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn release(self) -> Result<NativeFuture<()>, ReleaseError<Self>>
pub fn release(self) -> Result<NativeFuture<()>, ReleaseError<Self>>
Releases the map.
Detach the map’s render session first.
See mln_map_release in the
C API reference.
Sourcepub fn remove_feature_state(
&self,
selector: &FeatureStateSelector<'_>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn remove_feature_state( &self, selector: &FeatureStateSelector<'_>, ) -> Result<NativeFuture<CommandCompletion>>
Removes the feature state that selector selects.
See mln_map_remove_feature_state in the
C API reference.
Sourcepub fn remove_style_image(
&self,
image_id: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn remove_style_image( &self, image_id: &str, ) -> Result<NativeFuture<CommandCompletion>>
Removes an image from the map’s style.
See mln_map_remove_style_image in the
C API reference.
§Errors
Status::NotFoundwhen the style has no image namedimage_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn remove_style_layer(
&self,
layer_id: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn remove_style_layer( &self, layer_id: &str, ) -> Result<NativeFuture<CommandCompletion>>
Removes a layer from the map’s style.
See mln_map_remove_style_layer in the
C API reference.
§Errors
Status::NotFoundwhen the style has no layer namedlayer_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn remove_style_source(
&self,
source_id: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn remove_style_source( &self, source_id: &str, ) -> Result<NativeFuture<CommandCompletion>>
Removes a source from the map’s style.
See mln_map_remove_style_source in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidStatewhen a layer still uses the source, or while the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn request_repaint(&self) -> Result<NativeFuture<CommandCompletion>>
pub fn request_repaint(&self) -> Result<NativeFuture<CommandCompletion>>
Renders a new frame of a continuous map, even when nothing changed.
See mln_map_request_repaint in the
C API reference.
Sourcepub fn request_still_image(&self) -> Result<NativeFuture<()>>
pub fn request_still_image(&self) -> Result<NativeFuture<()>>
Renders a still image of a static or tile map.
The map’s render session draws the image once every resource that the image needs has loaded.
See mln_map_request_still_image in the
C API reference.
§Errors
Status::Cancelledwhen the map is released before the image is done.Status::NativeErrorwhen the style or a resource that the image needs fails to load.
Sourcepub fn resize(
&self,
logical_size: LogicalSize,
) -> Result<NativeFuture<CommandCompletion>>
pub fn resize( &self, logical_size: LogicalSize, ) -> Result<NativeFuture<CommandCompletion>>
Sets the map’s size.
A map with a render session takes its size from the session, so resize
the session with RenderSessionHandle::resize() instead.
See mln_map_resize in the
C API reference.
§Errors
Status::InvalidStatewhen the map has a render session.Status::InvalidStatewhen a render session attached to the map before the resize applied.
Sourcepub fn set_bounds(
&self,
options: &BoundOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_bounds( &self, options: &BoundOptions, ) -> Result<NativeFuture<CommandCompletion>>
Limits the camera’s center to an area, and its zoom and pitch to ranges.
Limits that options doesn’t set keep their current values. When the
camera is outside the new limits, it moves inside them.
See mln_map_set_bounds in the
C API reference.
Sourcepub fn set_custom_geometry_source_tile_data(
&self,
source_id: &str,
tile_id: CanonicalTileId,
data: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_custom_geometry_source_tile_data( &self, source_id: &str, tile_id: CanonicalTileId, data: &str, ) -> Result<NativeFuture<CommandCompletion>>
Sets the data of a tile in a custom geometry source.
data is a GeoJSON feature collection, feature, or geometry. The source
ignores data for a tile that it hasn’t asked for, or has since
cancelled.
See mln_map_set_custom_geometry_source_tile_data in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom geometry source.
Sourcepub fn set_custom_geometry_source_tile_error(
&self,
source_id: &str,
tile_id: CanonicalTileId,
message: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_custom_geometry_source_tile_error( &self, source_id: &str, tile_id: CanonicalTileId, message: &str, ) -> Result<NativeFuture<CommandCompletion>>
Reports that a tile of a custom geometry source failed to load.
See mln_map_set_custom_geometry_source_tile_error in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom geometry source.
Sourcepub fn set_custom_vector_source_tile_data(
&self,
source_id: &str,
tile_id: CanonicalTileId,
encoding: StyleVectorTileEncoding,
data: &[u8],
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_custom_vector_source_tile_data( &self, source_id: &str, tile_id: CanonicalTileId, encoding: StyleVectorTileEncoding, data: &[u8], ) -> Result<NativeFuture<CommandCompletion>>
Sets the data of a tile in a custom vector source.
data is the tile, encoded as encoding. The source ignores data for a
tile that it hasn’t asked for, or has since cancelled.
See mln_map_set_custom_vector_source_tile_data in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom vector source.
Sourcepub fn set_custom_vector_source_tile_error(
&self,
source_id: &str,
tile_id: CanonicalTileId,
message: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_custom_vector_source_tile_error( &self, source_id: &str, tile_id: CanonicalTileId, message: &str, ) -> Result<NativeFuture<CommandCompletion>>
Reports that a tile of a custom vector source failed to load.
See mln_map_set_custom_vector_source_tile_error in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a custom vector source.
Sourcepub fn set_debug_flags(
&self,
flags: MapDebugFlag,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_debug_flags( &self, flags: MapDebugFlag, ) -> Result<NativeFuture<CommandCompletion>>
Draws debugging overlays, such as tile borders, on the map.
flags replaces the overlays set before.
See mln_map_set_debug_flags in the
C API reference.
Sourcepub fn set_event_mask(
&self,
mask: RuntimeEventFlag,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_event_mask( &self, mask: RuntimeEventFlag, ) -> Result<NativeFuture<CommandCompletion>>
Selects the events that the map reports.
See mln_map_set_event_mask in the
C API reference.
Sourcepub fn set_feature_state(
&self,
selector: &FeatureStateSelector<'_>,
state: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_feature_state( &self, selector: &FeatureStateSelector<'_>, state: &str, ) -> Result<NativeFuture<CommandCompletion>>
Merges state into the state of a feature.
state is a JSON object. Its keys replace the same keys in the
feature’s state, and the other keys stay.
See mln_map_set_feature_state in the
C API reference.
Sourcepub fn set_free_camera_options(
&self,
options: &FreeCameraOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_free_camera_options( &self, options: &FreeCameraOptions, ) -> Result<NativeFuture<CommandCompletion>>
Places the camera at a position and orientation in space.
The map adjusts them to a camera that it can show. It stops running
camera animations first, and their end handlers report
CameraTransitionOutcome::Cancelled.
See mln_map_set_free_camera_options in the
C API reference.
Sourcepub fn set_geo_json_source_data(
&self,
source_id: &str,
data: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_geo_json_source_data( &self, source_id: &str, data: &str, ) -> Result<NativeFuture<CommandCompletion>>
Replaces the data of a GeoJSON source.
data is a GeoJSON feature collection, feature, or geometry. The
library prepares it for the source with the source’s options, off the
threads that the caller and the runtime use, and the command completes
once the source holds it. Later commands don’t wait for it. While the
source is still preparing earlier data, only the newest data waits to
follow it.
With synchronous tiling on, as
MapHandle::set_geo_json_source_synchronous_tiling() describes, the
command prepares data before later commands run, so the data shows in
the next frame.
See mln_map_set_geo_json_source_data in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a GeoJSON source, whendataisn’t valid GeoJSON, or when the source clusters anddataisn’t a feature collection of points. The source keeps its data.Status::Cancelledwhen newer data for the source replacesdatawhile it waits, or when the source’s URL, its removal, a style load, or the map’s release replaces the source’s data beforedatais ready.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_geo_json_source_synchronous_tiling(
&self,
source_id: &str,
enabled: bool,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_geo_json_source_synchronous_tiling( &self, source_id: &str, enabled: bool, ) -> Result<NativeFuture<CommandCompletion>>
Sets whether a GeoJSON source builds its tiles while the map renders.
Building tiles while the map renders, instead of in the background,
makes new data show in the next frame. The setting replaces the
synchronousUpdate member of the source’s JSON, which defaults to
false.
See mln_map_set_geo_json_source_synchronous_tiling in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a GeoJSON source.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_geo_json_source_url(
&self,
source_id: &str,
url: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_geo_json_source_url( &self, source_id: &str, url: &str, ) -> Result<NativeFuture<CommandCompletion>>
Makes a GeoJSON source load its data from url.
See mln_map_set_geo_json_source_url in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t a GeoJSON source.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_global_state_property(
&self,
property_name: &str,
value: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_global_state_property( &self, property_name: &str, value: &str, ) -> Result<NativeFuture<CommandCompletion>>
Sets a value that the style’s global-state
[expressions](https://maplibre.org/maplibre-style-spec/expressions/)
read.
See mln_map_set_global_state_property in the
C API reference.
§Errors
Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_image_source_coordinates(
&self,
source_id: &str,
coordinates: &[LatLng],
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_image_source_coordinates( &self, source_id: &str, coordinates: &[LatLng], ) -> Result<NativeFuture<CommandCompletion>>
Moves the image of an image source.
coordinates are the image’s four corners, clockwise from the top left.
See mln_map_set_image_source_coordinates in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t an image source.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_image_source_image(
&self,
source_id: &str,
image: &PremultipliedRgba8Image<'_>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_image_source_image( &self, source_id: &str, image: &PremultipliedRgba8Image<'_>, ) -> Result<NativeFuture<CommandCompletion>>
Replaces the image of an image source.
See mln_map_set_image_source_image in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t an image source.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_image_source_url(
&self,
source_id: &str,
url: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_image_source_url( &self, source_id: &str, url: &str, ) -> Result<NativeFuture<CommandCompletion>>
Makes an image source load its image from url.
See mln_map_set_image_source_url in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidArgumentwhen the source namedsource_idisn’t an image source.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_projection_mode(
&self,
options: &ProjectionModeOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_projection_mode( &self, options: &ProjectionModeOptions, ) -> Result<NativeFuture<CommandCompletion>>
Sets whether the map draws in perspective or axonometric projection, and how much it skews the view.
Settings that options doesn’t set keep their current values.
See mln_map_set_projection_mode in the
C API reference.
Sourcepub fn set_rendering_stats_view_enabled(
&self,
enabled: bool,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_rendering_stats_view_enabled( &self, enabled: bool, ) -> Result<NativeFuture<CommandCompletion>>
Shows or hides an overlay of rendering statistics on the map.
See mln_map_set_rendering_stats_view_enabled in the
C API reference.
Sourcepub fn set_style_image(
&self,
image_id: &str,
image: &PremultipliedRgba8Image<'_>,
options: Option<&StyleImageOptions>,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_image( &self, image_id: &str, image: &PremultipliedRgba8Image<'_>, options: Option<&StyleImageOptions>, ) -> Result<NativeFuture<CommandCompletion>>
Adds an image to the map’s style, or replaces the image named
image_id.
See mln_map_set_style_image in the
C API reference.
§Errors
Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_style_json(
&self,
json: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_json( &self, json: &str, ) -> Result<NativeFuture<CommandCompletion>>
Loads the map’s style from json.
The command completes once the style has parsed, and the map’s style is
then loaded, as MapHandle::set_style_url() describes. The style’s
sources, sprites, and glyphs load in the background.
See mln_map_set_style_json in the
C API reference.
§Errors
Status::NativeErrorwhenjsonisn’t a valid style. The map keeps its current style.
Sourcepub fn set_style_layer_property(
&self,
layer_id: &str,
property_name: &str,
value: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_layer_property( &self, layer_id: &str, property_name: &str, value: &str, ) -> Result<NativeFuture<CommandCompletion>>
Sets a property of a layer in the map’s style.
property_name is one of the layer’s layout or paint
[properties](https://maplibre.org/maplibre-style-spec/layers/), or
filter, minzoom, maxzoom, source, or source-layer. A null
value resets any of these but source and source-layer to its
default.
See mln_map_set_style_layer_property in the
C API reference.
§Errors
Status::NotFoundwhen the style has no layer namedlayer_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_style_light_json(
&self,
light_json: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_light_json( &self, light_json: &str, ) -> Result<NativeFuture<CommandCompletion>>
Replaces the [light](https://maplibre.org/maplibre-style-spec/light/) of the map’s style.
See mln_map_set_style_light_json in the
C API reference.
§Errors
Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_style_light_property(
&self,
property_name: &str,
value: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_light_property( &self, property_name: &str, value: &str, ) -> Result<NativeFuture<CommandCompletion>>
Sets a property of the light of the map’s style.
See mln_map_set_style_light_property in the
C API reference.
§Errors
Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_style_source_volatile(
&self,
source_id: &str,
is_volatile: bool,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_source_volatile( &self, source_id: &str, is_volatile: bool, ) -> Result<NativeFuture<CommandCompletion>>
Sets whether a source is volatile.
The map doesn’t store the tiles of a volatile source in the persistent cache.
See mln_map_set_style_source_volatile in the
C API reference.
§Errors
Status::NotFoundwhen the style has no source namedsource_id.Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_style_transition_options(
&self,
options: &StyleTransitionOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_transition_options( &self, options: &StyleTransitionOptions, ) -> Result<NativeFuture<CommandCompletion>>
Sets the default transition of the map’s style.
See mln_map_set_style_transition_options in the
C API reference.
§Errors
Status::InvalidStatewhile the style isn’t loaded, asMapHandle::set_style_url()describes.
Sourcepub fn set_style_url(
&self,
url: &str,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_style_url( &self, url: &str, ) -> Result<NativeFuture<CommandCompletion>>
Loads the map’s style from url.
The command completes once the style document has loaded and parsed. The style’s sources, sprites, and glyphs then load in the background.
The map’s style is loaded from the time a style document parses until
the next call to this function. While the style isn’t loaded, the
commands that change it complete with Status::InvalidState. To change
a new map’s style without a style document, first load an empty style,
such as {"version":8,"sources":{},"layers":[]}.
See mln_map_set_style_url in the
C API reference.
§Errors
Status::NativeErrorwhen the style document fails to load or isn’t a valid style.Status::Cancelledwhen the map is released, or this function orMapHandle::set_style_json()loads another style, before the style document parses.
Sourcepub fn set_tile_options(
&self,
options: &MapTileOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_tile_options( &self, options: &MapTileOptions, ) -> Result<NativeFuture<CommandCompletion>>
Sets how the map chooses which tiles to load, and at what detail.
Settings that options doesn’t set keep their current values.
See mln_map_set_tile_options in the
C API reference.
Sourcepub fn set_viewport_options(
&self,
options: &MapViewportOptions,
) -> Result<NativeFuture<CommandCompletion>>
pub fn set_viewport_options( &self, options: &MapViewportOptions, ) -> Result<NativeFuture<CommandCompletion>>
Sets how the map orients and constrains its view.
Settings that options doesn’t set keep their current values.
See mln_map_set_viewport_options in the
C API reference.
Sourcepub fn update_camera(
&self,
update: &CameraUpdate,
) -> Result<NativeFuture<CommandCompletion>>
pub fn update_camera( &self, update: &CameraUpdate, ) -> Result<NativeFuture<CommandCompletion>>
Moves the camera, at once or with an animation.
Camera fields that update doesn’t set keep their values, and the
update stops any running animation of the fields it sets. The function
finishes when the map applies the update, before an animation ends. To
learn when an animation ends, set an CameraTransitionHandler in its
animation options.
See mln_map_update_camera in the
C API reference.
Source§impl MapHandle
impl MapHandle
pub fn discarding(&self) -> MapHandleDiscarding<'_>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MapHandle
impl RefUnwindSafe for MapHandle
impl Send for MapHandle
impl Sync for MapHandle
impl Unpin for MapHandle
impl UnsafeUnpin for MapHandle
impl UnwindSafe for MapHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more