Struct Mapbox

Source
pub struct Mapbox<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Mapbox<'a>

Source

pub fn domain(&mut self) -> &mut Domain<'a>

Source

pub fn accesstoken(&mut self, accesstoken: &'a str) -> &mut Self

Sets the mapbox access token to be used for this mapbox map. Alternatively, the mapbox access token can be set in the configuration options under mapboxAccessToken. Note that accessToken are only required when style (e.g with values : basic, streets, outdoors, light, dark, satellite, satellite-streets ) and/or a layout layer references the Mapbox server.

Source

pub fn style(&mut self, style: Any) -> &mut Self

Defines the map layers that are rendered by default below the trace layers defined in data, which are themselves by default rendered below the layers defined in layout.mapbox.layers. These layers can be defined either explicitly as a Mapbox Style object which can contain multiple layer definitions that load data from any public or private Tile Map Service (TMS or XYZ) or Web Map Service (WMS) or implicitly by using one of the built-in style objects which use WMSes which do not require any access tokens, or by using a default Mapbox style or custom Mapbox style URL, both of which require a Mapbox access token Note that Mapbox access token can be set in the accesstoken attribute or in the mapboxAccessToken config option. Mapbox Style objects are of the form described in the Mapbox GL JS documentation available at https://docs.mapbox.com/mapbox-gl-js/style-spec The built-in plotly.js styles objects are: open-street-map, white-bg, carto-positron, carto-darkmatter, stamen-terrain, stamen-toner, stamen-watercolor The built-in Mapbox styles are: basic, streets, outdoors, light, dark, satellite, satellite-streets Mapbox style URLs are of the form: mapbox://mapbox.mapbox--

default: basic

Source

pub fn center(&mut self) -> &mut Center

Source

pub fn zoom(&mut self, zoom: f64) -> &mut Self

Sets the zoom level of the map (mapbox.zoom).

default: 1

Source

pub fn bearing(&mut self, bearing: f64) -> &mut Self

Sets the bearing angle of the map in degrees counter-clockwise from North (mapbox.bearing).

default: 0

Source

pub fn pitch(&mut self, pitch: f64) -> &mut Self

Sets the pitch angle of the map (in degrees, where 0 means perpendicular to the surface of the map) (mapbox.pitch).

default: 0

Source

pub fn uirevision(&mut self, uirevision: Any) -> &mut Self

Controls persistence of user-driven changes in the view: center, zoom, bearing, pitch. Defaults to layout.uirevision.

Trait Implementations§

Source§

impl<'a> Default for Mapbox<'a>

Source§

fn default() -> Mapbox<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Serialize for Mapbox<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Mapbox<'a>

§

impl<'a> RefUnwindSafe for Mapbox<'a>

§

impl<'a> Send for Mapbox<'a>

§

impl<'a> Sync for Mapbox<'a>

§

impl<'a> Unpin for Mapbox<'a>

§

impl<'a> UnwindSafe for Mapbox<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.