pub trait MapConfig {
// Required methods
fn tile_url(&self, tile: &TileId) -> String;
fn attribution(&self) -> Option<&String>;
fn attribution_url(&self) -> Option<&String>;
fn default_center(&self) -> (f64, f64);
fn default_zoom(&self) -> u8;
// Provided methods
fn min_zoom(&self) -> u8 { ... }
fn max_zoom(&self) -> u8 { ... }
}Expand description
Configuration for a map provider.
Required Methods§
Sourcefn attribution(&self) -> Option<&String>
fn attribution(&self) -> Option<&String>
Returns the attribution text to be displayed on the map. If returns None, no attribution is shown.
Sourcefn attribution_url(&self) -> Option<&String>
fn attribution_url(&self) -> Option<&String>
Returns the attribution URL to be linked from the attribution text.
Sourcefn default_center(&self) -> (f64, f64)
fn default_center(&self) -> (f64, f64)
The default geographical center of the map. (longitude, latitude)
Sourcefn default_zoom(&self) -> u8
fn default_zoom(&self) -> u8
The default zoom level of the map.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl MapConfig for DynMapConfig
impl MapConfig for OpenStreetMapConfig
Available on crate feature
openstreetmap only.