pub struct SourceTypeOptions<'a> {
pub name: &'a str,
pub kind: SourceKindOptions,
pub min_zoom: Option<f64>,
pub max_zoom: Option<f64>,
pub tile_size: Option<u32>,
pub scheme: Option<TileScheme>,
pub bounds: Option<LatLngBounds>,
pub attribution: Option<&'a str>,
pub fetches_optional: Option<bool>,
}Expand description
Configuration and defaults for registering a SourcePlugin.
When style JSON creates a source of this type, standard members (minzoom,
maxzoom, tileSize, scheme, bounds, attribution, and kind-specific
members such as encoding, buffer, tolerance, clip, and wrap)
override these defaults for that source instance, while the raw JSON object
is passed to SourcePlugin::fetch_tile and SourcePlugin::cancel_tile.
Fields§
§name: &'a str§kind: SourceKindOptions§min_zoom: Option<f64>§max_zoom: Option<f64>§tile_size: Option<u32>§scheme: Option<TileScheme>§bounds: Option<LatLngBounds>§attribution: Option<&'a str>§fetches_optional: Option<bool>Implementations§
Source§impl<'a> SourceTypeOptions<'a>
impl<'a> SourceTypeOptions<'a>
pub const fn new(name: &'a str, kind: SourceKindOptions) -> Self
Sourcepub const fn geometry(name: &'a str) -> Self
pub const fn geometry(name: &'a str) -> Self
Creates options for a geometry (GeoJSON / MVT / MLT) plugin source with default tiling options.
Sourcepub const fn raster_dem(name: &'a str) -> Self
pub const fn raster_dem(name: &'a str) -> Self
Creates options for a raster-DEM plugin source with default elevation options.
pub const fn min_zoom(self, min_zoom: f64) -> Self
pub const fn max_zoom(self, max_zoom: f64) -> Self
pub const fn tile_size(self, tile_size: u32) -> Self
pub const fn scheme(self, scheme: TileScheme) -> Self
pub const fn bounds(self, bounds: LatLngBounds) -> Self
pub const fn attribution(self, attribution: &'a str) -> Self
pub const fn fetches_optional(self, fetches_optional: bool) -> Self
Trait Implementations§
Source§impl<'a> Clone for SourceTypeOptions<'a>
impl<'a> Clone for SourceTypeOptions<'a>
impl<'a> Copy for SourceTypeOptions<'a>
Auto Trait Implementations§
impl<'a> Forget for SourceTypeOptions<'a>
impl<'a> Freeze for SourceTypeOptions<'a>
impl<'a> Move for SourceTypeOptions<'a>
impl<'a> RefUnwindSafe for SourceTypeOptions<'a>
impl<'a> Send for SourceTypeOptions<'a>
impl<'a> Sync for SourceTypeOptions<'a>
impl<'a> Unpin for SourceTypeOptions<'a>
impl<'a> UnsafeUnpin for SourceTypeOptions<'a>where
&'a str: UnsafeUnpin,
impl<'a> UnwindSafe for SourceTypeOptions<'a>where
&'a str: UnwindSafe,
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