Skip to main content

MapConfig

Trait MapConfig 

Source
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§

Source

fn tile_url(&self, tile: &TileId) -> String

Returns the URL for a given tile.

Source

fn attribution(&self) -> Option<&String>

Returns the attribution text to be displayed on the map. If returns None, no attribution is shown.

Source

fn attribution_url(&self) -> Option<&String>

Returns the attribution URL to be linked from the attribution text.

Source

fn default_center(&self) -> (f64, f64)

The default geographical center of the map. (longitude, latitude)

Source

fn default_zoom(&self) -> u8

The default zoom level of the map.

Provided Methods§

Source

fn min_zoom(&self) -> u8

Returns the minimum zoom level allowed by this provider.

Source

fn max_zoom(&self) -> u8

Returns the maximum zoom level allowed by this provider.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl MapConfig for DynMapConfig

Source§

impl MapConfig for OpenStreetMapConfig

Available on crate feature openstreetmap only.