pub enum SourceDecl {
Brush(FileSource),
Image(FileSource),
Mvt(MvtSource),
Pmtiles(PmtilesSource),
Dem(DemSource),
Raster(RasterSource),
GeoJson(GeoJsonSource),
Sprite(SpriteSource),
Font(FontSource),
Glyphs(GlyphsSource),
}Expand description
Declaration of one external data source. Mixes document-scoped
resources (brush, image, sprite, font) — resolved once per
style from a file
path or http(s):// URL — and tile-scoped pyramids (mvt,
pmtiles, dem) — fetched per tile via a URL template.
The legacy mask-image / gradient kinds from 0.2 are gone:
mask-image was indistinguishable from image at runtime (host
decoded both as RGBA8), so callers compose image →
pick-channel a to get a single-channel mask; gradient was
never wired up and the gradient-* node family covers that use
case directly.
Binding conventions in the host’s TileLoader:
- Document-scoped: looked up by the source name (referenced in
node fields as
@source-name). dembinds a stitchedScalarFieldundertile.<source-name>.mvtandpmtilesbind every layer of the decoded vector tile undertile.<layer-name>(i.e. by the layer’s name inside the tile, not the source key — built-in styles reference layers liketile.water/tile.roads).
Variants§
Brush(FileSource)
Image(FileSource)
Mvt(MvtSource)
Pmtiles(PmtilesSource)
Dem(DemSource)
Raster(RasterSource)
GeoJson(GeoJsonSource)
Sprite(SpriteSource)
Font(FontSource)
Glyphs(GlyphsSource)
Implementations§
Source§impl SourceDecl
impl SourceDecl
Sourcepub fn attribution(&self) -> &Option<String>
pub fn attribution(&self) -> &Option<String>
The source’s declared attribution, if any.
Trait Implementations§
Source§impl Clone for SourceDecl
impl Clone for SourceDecl
Source§fn clone(&self) -> SourceDecl
fn clone(&self) -> SourceDecl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceDecl
impl Debug for SourceDecl
Source§impl<'de> Deserialize<'de> for SourceDecl
impl<'de> Deserialize<'de> for SourceDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SourceDecl
impl RefUnwindSafe for SourceDecl
impl Send for SourceDecl
impl Sync for SourceDecl
impl Unpin for SourceDecl
impl UnsafeUnpin for SourceDecl
impl UnwindSafe for SourceDecl
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