pub struct Map { /* private fields */ }
Implementations§
source§impl Map
impl Map
pub fn new(options: MapOptions) -> Result<Rc<Map>>
sourcepub fn on<F: MapEventListener + 'static>(&self, f: F) -> Result<MapListenerId>
pub fn on<F: MapEventListener + 'static>(&self, f: F) -> Result<MapListenerId>
Add a listener to a specified event type.
sourcepub fn on_layer<F: MapEventListener + 'static>(
&self,
layer_id: &str,
f: F,
) -> Result<MapListenerId>
pub fn on_layer<F: MapEventListener + 'static>( &self, layer_id: &str, f: F, ) -> Result<MapListenerId>
Add a listener to a specified event type and layer.
pub fn add_marker(&self, marker: Rc<Marker>) -> MarkerId
pub fn remove_marker(&self, id: &MarkerId)
source§impl Map
impl Map
pub fn get_container(&self) -> HtmlElement
pub fn get_bounds(&self) -> Result<LngLatBounds>
pub fn get_min_zoom(&self) -> f64
pub fn is_moving(&self) -> bool
pub fn is_zooming(&self) -> bool
pub fn is_rotating(&self) -> bool
pub fn show_tile_boundaries(&self, value: bool)
pub fn show_terrain_wireframe(&self, value: bool)
pub fn show_padding(&self, value: bool)
pub fn show_collision_boxes(&self, value: bool)
pub fn get_box_zoom_handler(&self) -> Option<BoxZoomHandler>
pub fn set_box_zoom_handler(&self, handler: BoxZoomHandler)
pub fn set_style(&self, style: Style, options: StyleOptions)
pub fn set_style_ref(&self, style: impl Into<String>, options: StyleOptions)
sourcepub fn add_image(
&self,
id: impl Into<String>,
image: Image,
options: ImageOptions,
) -> Result<()>
pub fn add_image( &self, id: impl Into<String>, image: Image, options: ImageOptions, ) -> Result<()>
Add image resource.
sourcepub fn update_image(&self, id: impl Into<String>, image: Image) -> Result<()>
pub fn update_image(&self, id: impl Into<String>, image: Image) -> Result<()>
Update an existing image in a style.
sourcepub fn has_image(&self, id: impl Into<String>) -> bool
pub fn has_image(&self, id: impl Into<String>) -> bool
Check whether or not an image with a specific ID exists in the style.
sourcepub fn remove_image(&self, id: impl Into<String>)
pub fn remove_image(&self, id: impl Into<String>)
Remove an image from a style.
sourcepub fn load_image(
&self,
url: impl Into<String>,
callback: impl FnMut(Result<Image>) + 'static,
)
pub fn load_image( &self, url: impl Into<String>, callback: impl FnMut(Result<Image>) + 'static, )
Load an image from an external URL.
sourcepub fn list_images(&self) -> Result<Vec<String>>
pub fn list_images(&self) -> Result<Vec<String>>
Returns an Array of strings containing the IDs of all images currently available in the map.
pub fn add_layer(&self, layer: &Layer) -> Result<()>
pub fn query_rendered_features<G: IntoQueryGeometry>( &self, geometry: Option<G>, options: QueryFeatureOptions, ) -> Result<Vec<Feature>>
pub fn add_vector_source( &self, id: impl Into<String>, url: impl Into<String>, ) -> Result<()>
pub fn add_geojson_source( &self, id: impl Into<String>, data: GeoJson, ) -> Result<()>
pub fn add_geojson_source_from_url( &self, id: impl Into<String>, data: impl Into<String>, ) -> Result<()>
pub fn get_geojson_source(&self, id: impl Into<String>) -> Option<GeoJsonSource>
pub fn is_source_loaded(&self, id: impl Into<String>) -> bool
pub fn are_tiles_loaded(&self) -> bool
pub fn remove_source(&self, id: impl Into<String>)
pub fn pan_to(&self, latlng: LngLat)
pub fn loaded(&self) -> bool
pub fn get_zoom(&self) -> f64
pub fn jump_to(&self, options: CameraOptions)
pub fn ease_to( &self, camera_options: CameraOptions, animation_options: AnimationOptions, )
pub fn fly_to( &self, camera_options: CameraOptions, animation_options: AnimationOptions, )
Auto Trait Implementations§
impl !Freeze for Map
impl !RefUnwindSafe for Map
impl !Send for Map
impl !Sync for Map
impl Unpin for Map
impl !UnwindSafe for Map
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
Mutably borrows from an owned value. Read more