Struct mapboxgl::Map

source ·
pub struct Map { /* private fields */ }

Implementations§

source§

impl Map

source

pub fn new(options: MapOptions) -> Result<Rc<Map>>

source

pub fn on<F: MapEventListener + 'static>(&self, f: F) -> Result<MapListenerId>

Add a listener to a specified event type.

source

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.

source

pub fn add_marker(&self, marker: Rc<Marker>) -> MarkerId

source

pub fn remove_marker(&self, id: &MarkerId)

source§

impl Map

source

pub fn get_container(&self) -> HtmlElement

source

pub fn get_bounds(&self) -> Result<LngLatBounds>

source

pub fn get_min_zoom(&self) -> f64

source

pub fn is_moving(&self) -> bool

source

pub fn is_zooming(&self) -> bool

source

pub fn is_rotating(&self) -> bool

source

pub fn show_tile_boundaries(&self, value: bool)

source

pub fn show_terrain_wireframe(&self, value: bool)

source

pub fn show_padding(&self, value: bool)

source

pub fn show_collision_boxes(&self, value: bool)

source

pub fn get_box_zoom_handler(&self) -> Option<BoxZoomHandler>

source

pub fn set_box_zoom_handler(&self, handler: BoxZoomHandler)

source

pub fn set_style(&self, style: impl Into<String>, options: StyleOptions)

source

pub fn add_image( &self, id: impl Into<String>, image: Image, options: ImageOptions ) -> Result<()>

Add image resource.

source

pub fn update_image(&self, id: impl Into<String>, image: Image) -> Result<()>

Update an existing image in a style.

source

pub fn has_image(&self, id: impl Into<String>) -> bool

Check whether or not an image with a specific ID exists in the style.

source

pub fn remove_image(&self, id: impl Into<String>)

Remove an image from a style.

source

pub fn load_image( &self, url: impl Into<String>, callback: impl FnMut(Result<Image>) + 'static )

Load an image from an external URL.

source

pub fn list_images(&self) -> Result<Vec<String>>

Returns an Array of strings containing the IDs of all images currently available in the map.

source

pub fn add_layer(&self, layer: &Layer) -> Result<()>

source

pub fn query_rendered_features<G: IntoQueryGeometry>( &self, geometry: Option<G>, options: QueryFeatureOptions ) -> Result<Vec<Feature>>

source

pub fn add_geojson_source( &self, id: impl Into<String>, data: GeoJson ) -> Result<()>

source

pub fn get_geojson_source(&self, id: impl Into<String>) -> Option<GeoJsonSource>

source

pub fn is_source_loaded(&self, id: impl Into<String>) -> bool

source

pub fn are_tiles_loaded(&self) -> bool

source

pub fn remove_source(&self, id: impl Into<String>)

source

pub fn pan_to(&self, latlng: LngLat)

source

pub fn loaded(&self) -> bool

source

pub fn get_zoom(&self) -> f64

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.