Skip to main content

StyleLayer

Enum StyleLayer 

Source
pub enum StyleLayer {
    Background(BackgroundStyleLayer),
    Hillshade(HillshadeStyleLayer),
    Raster(RasterStyleLayer),
    Vector(VectorStyleLayer),
    Fill(FillStyleLayer),
    Line(LineStyleLayer),
    Circle(CircleStyleLayer),
    Heatmap(HeatmapStyleLayer),
    FillExtrusion(FillExtrusionStyleLayer),
    Symbol(SymbolStyleLayer),
    Model(ModelStyleLayer),
}
Expand description

Supported style-layer variants.

Variants§

§

Background(BackgroundStyleLayer)

Solid background style layer.

§

Hillshade(HillshadeStyleLayer)

Terrain hillshade style layer.

§

Raster(RasterStyleLayer)

Raster imagery style layer.

§

Vector(VectorStyleLayer)

Generic vector style layer.

§

Fill(FillStyleLayer)

Polygon fill style layer.

§

Line(LineStyleLayer)

Polyline stroke style layer.

§

Circle(CircleStyleLayer)

Point circle style layer.

§

Heatmap(HeatmapStyleLayer)

Heatmap style layer.

§

FillExtrusion(FillExtrusionStyleLayer)

Extruded polygon fill style layer.

§

Symbol(SymbolStyleLayer)

Text and icon symbol style layer.

§

Model(ModelStyleLayer)

3D model placement style layer.

Implementations§

Source§

impl StyleLayer

Source

pub fn id(&self) -> &str

Layer id.

Source

pub fn meta(&self) -> &StyleLayerMeta

Shared metadata.

Source

pub fn meta_mut(&mut self) -> &mut StyleLayerMeta

Shared metadata, mutable.

Source

pub fn to_runtime_layer_with_context( &self, sources: &HashMap<StyleSourceId, StyleSource>, ctx: StyleEvalContext, ) -> Result<Box<dyn Layer>, StyleError>

Evaluate into a concrete runtime layer with a context.

Source

pub fn apply_to_runtime_layer_with_context( &self, runtime: &mut dyn Layer, sources: &HashMap<StyleSourceId, StyleSource>, ctx: StyleEvalContext, ) -> Result<(), StyleError>

Apply evaluated paint/layout state onto an existing runtime layer.

Source

pub fn source_id(&self) -> Option<&str>

Return the referenced source id, if this layer is source-backed.

Source

pub fn source_layer(&self) -> Option<&str>

Return the referenced source-layer name, if this layer targets a named source layer within a vector-tile-like source.

Source

pub fn uses_source(&self, source_id: &str) -> bool

Return true if this layer references the given source id.

Source

pub fn has_feature_state_driven_paint(&self) -> bool

Whether any paint property on this layer uses a FeatureState value.

This lets callers skip per-feature re-evaluation for layers that only use constant or zoom-keyed paint properties.

Source

pub fn resolve_style_with_feature_state( &self, ctx: &StyleEvalContextFull<'_>, ) -> Option<VectorStyle>

Resolve the layer’s paint properties against a full evaluation context that includes per-feature mutable state.

Returns Some(VectorStyle) for vector-backed layer families, or None for layer types that do not produce a VectorStyle (background, hillshade, raster, model).

This is the primary entry point for hover/selection-driven restyling: the caller builds a StyleEvalContextFull with the target feature’s current state, then receives a resolved VectorStyle that can be compared or applied to the feature’s visual representation.

Trait Implementations§

Source§

impl Clone for StyleLayer

Source§

fn clone(&self) -> StyleLayer

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StyleLayer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.