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
impl StyleLayer
Sourcepub fn meta(&self) -> &StyleLayerMeta
pub fn meta(&self) -> &StyleLayerMeta
Shared metadata.
Sourcepub fn meta_mut(&mut self) -> &mut StyleLayerMeta
pub fn meta_mut(&mut self) -> &mut StyleLayerMeta
Shared metadata, mutable.
Sourcepub fn to_runtime_layer_with_context(
&self,
sources: &HashMap<StyleSourceId, StyleSource>,
ctx: StyleEvalContext,
) -> Result<Box<dyn Layer>, StyleError>
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.
Sourcepub fn apply_to_runtime_layer_with_context(
&self,
runtime: &mut dyn Layer,
sources: &HashMap<StyleSourceId, StyleSource>,
ctx: StyleEvalContext,
) -> Result<(), StyleError>
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.
Sourcepub fn source_id(&self) -> Option<&str>
pub fn source_id(&self) -> Option<&str>
Return the referenced source id, if this layer is source-backed.
Sourcepub fn source_layer(&self) -> Option<&str>
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.
Sourcepub fn uses_source(&self, source_id: &str) -> bool
pub fn uses_source(&self, source_id: &str) -> bool
Return true if this layer references the given source id.
Sourcepub fn has_feature_state_driven_paint(&self) -> bool
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.
Sourcepub fn resolve_style_with_feature_state(
&self,
ctx: &StyleEvalContextFull<'_>,
) -> Option<VectorStyle>
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
impl Clone for StyleLayer
Source§fn clone(&self) -> StyleLayer
fn clone(&self) -> StyleLayer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more