pub struct VectorLayer {
pub query_layer_id: Option<String>,
pub query_source_id: Option<String>,
pub query_source_layer: Option<String>,
pub features: FeatureCollection,
pub feature_provenance: Vec<Option<FeatureProvenance>>,
pub style: VectorStyle,
/* private fields */
}Expand description
A vector layer holding parsed geographic features with a render style.
See the module-level documentation for the tessellation pipeline and coordinate flow.
Fields§
§query_layer_id: Option<String>Optional originating style layer id for query APIs.
query_source_id: Option<String>Optional originating style source id for query APIs.
query_source_layer: Option<String>Optional originating style source-layer id for streamed vector sources.
features: FeatureCollectionThe feature data.
feature_provenance: Vec<Option<FeatureProvenance>>Per-feature tile/source-layer provenance.
style: VectorStyleRender style.
Implementations§
Source§impl VectorLayer
impl VectorLayer
Sourcepub fn new(
name: impl Into<String>,
features: FeatureCollection,
style: VectorStyle,
) -> Self
pub fn new( name: impl Into<String>, features: FeatureCollection, style: VectorStyle, ) -> Self
Create a new vector layer.
Sourcepub fn with_query_metadata(
self,
layer_id: impl Into<Option<String>>,
source_id: impl Into<Option<String>>,
) -> Self
pub fn with_query_metadata( self, layer_id: impl Into<Option<String>>, source_id: impl Into<Option<String>>, ) -> Self
Attach style/runtime query metadata to this layer.
Sourcepub fn with_source_layer(self, source_layer: Option<String>) -> Self
pub fn with_source_layer(self, source_layer: Option<String>) -> Self
Attach the originating source-layer id used by style/runtime evaluation.
Sourcepub fn set_features_with_provenance(
&mut self,
features: FeatureCollection,
provenance: Vec<Option<FeatureProvenance>>,
)
pub fn set_features_with_provenance( &mut self, features: FeatureCollection, provenance: Vec<Option<FeatureProvenance>>, )
Replace the feature set together with per-feature provenance.
Sourcepub fn data_generation(&self) -> u64
pub fn data_generation(&self) -> u64
Monotonically increasing generation counter for feature data changes.
Bumped by set_features_with_provenance.
Used by the sync-path tessellation cache to detect data staleness.
Sourcepub fn set_query_metadata(
&mut self,
layer_id: Option<String>,
source_id: Option<String>,
)
pub fn set_query_metadata( &mut self, layer_id: Option<String>, source_id: Option<String>, )
Attach style/runtime query metadata to this layer in place.
Sourcepub fn feature_count(&self) -> usize
pub fn feature_count(&self) -> usize
Number of features in this layer.
Sourcepub fn total_coords(&self) -> usize
pub fn total_coords(&self) -> usize
Total number of coordinate vertices across all features.
Sourcepub fn drape_on_terrain(&mut self, terrain: &TerrainManager)
pub fn drape_on_terrain(&mut self, terrain: &TerrainManager)
Drape all vector features onto terrain by querying elevation for each vertex and setting its altitude.
Does nothing if terrain is disabled or elevation data is unavailable for a given coordinate (the vertex retains its original altitude).
Sourcepub fn tessellate(&self, projection: CameraProjection) -> VectorMeshData
pub fn tessellate(&self, projection: CameraProjection) -> VectorMeshData
Tessellate all features into GPU-ready mesh data.
- Polygons are fan-triangulated (exterior ring only; holes are not yet subtracted).
- Line strings are stroke-expanded into ribbon quads with
the configured
stroke_width. - Points are rendered as small axis-aligned quads.
- Multi* and GeometryCollection types recurse into their children.
When the style carries data-driven expressions for width or colour, those are evaluated per feature against each feature’s properties.
All output positions are in the active planar world-space meters.
Sourcepub fn symbol_candidates(&self) -> Vec<SymbolCandidate>
pub fn symbol_candidates(&self) -> Vec<SymbolCandidate>
Build symbol-placement candidates for this layer.
Sourcepub fn symbol_candidates_for_features(
&self,
features: &FeatureCollection,
feature_provenance: &[Option<FeatureProvenance>],
) -> Vec<SymbolCandidate>
pub fn symbol_candidates_for_features( &self, features: &FeatureCollection, feature_provenance: &[Option<FeatureProvenance>], ) -> Vec<SymbolCandidate>
Build symbol-placement candidates from an explicit feature/provenance set.
Trait Implementations§
Source§impl Debug for VectorLayer
impl Debug for VectorLayer
Source§impl Layer for VectorLayer
impl Layer for VectorLayer
Source§fn set_visible(&mut self, visible: bool)
fn set_visible(&mut self, visible: bool)
Source§fn set_opacity(&mut self, opacity: f32)
fn set_opacity(&mut self, opacity: f32)
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any for mutable concrete type access.