pub struct VectorTileSource {
pub data: FeatureCollection,
pub source_layers: HashMap<String, FeatureCollection>,
pub factory: Option<VectorTileSourceFactory>,
pub cache_capacity: usize,
pub selection: TileSelectionConfig,
}Expand description
Vector-tile-like feature source.
Fields§
§data: FeatureCollectionFlattened features exposed by the source.
This remains for backward compatibility with earlier runtime code that treated vector sources as one resolved feature collection.
source_layers: HashMap<String, FeatureCollection>Optional source-layer partitioning for style/runtime resolution.
When present, vector style layers may select a specific source layer via
their source_layer field, mirroring MapLibre’s source-layer
behavior. When absent, the flattened data collection is used.
factory: Option<VectorTileSourceFactory>Optional streamed tile source factory.
When present, the style/runtime path builds a source-owned hidden tile
manager that fetches binary vector tiles at runtime. The in-memory
data and source_layers remain available for tests, fallbacks, and
backward-compatible resolved-feature workflows.
cache_capacity: usizeMaximum tile-cache capacity for the streamed vector source runtime.
selection: TileSelectionConfigTile-selection policy for the streamed vector source runtime.
Implementations§
Source§impl VectorTileSource
impl VectorTileSource
Sourcepub fn new(data: FeatureCollection) -> Self
pub fn new(data: FeatureCollection) -> Self
Create a new vector-tile-like source from resolved features.
Sourcepub fn streamed(
factory: impl Fn() -> Box<dyn TileSource> + Send + Sync + 'static,
) -> Self
pub fn streamed( factory: impl Fn() -> Box<dyn TileSource> + Send + Sync + 'static, ) -> Self
Create a new streamed vector tile source from a tile-source factory.
Sourcepub fn from_source_layers(
source_layers: HashMap<String, FeatureCollection>,
) -> Self
pub fn from_source_layers( source_layers: HashMap<String, FeatureCollection>, ) -> Self
Create a new vector-tile-like source from named source-layer feature sets.
Sourcepub fn with_source_layer(
self,
name: impl Into<String>,
data: FeatureCollection,
) -> Self
pub fn with_source_layer( self, name: impl Into<String>, data: FeatureCollection, ) -> Self
Attach a named source layer to this source.
Sourcepub fn source_layer(&self, name: &str) -> Option<&FeatureCollection>
pub fn source_layer(&self, name: &str) -> Option<&FeatureCollection>
Borrow a named source layer if present.
Sourcepub fn has_source_layers(&self) -> bool
pub fn has_source_layers(&self) -> bool
Return true if this source has explicit source-layer partitioning.
Sourcepub fn is_streamed(&self) -> bool
pub fn is_streamed(&self) -> bool
Return true if this source should fetch vector tiles at runtime.
Sourcepub fn with_cache_capacity(self, cache_capacity: usize) -> Self
pub fn with_cache_capacity(self, cache_capacity: usize) -> Self
Set streamed tile cache capacity.
Sourcepub fn with_selection(self, selection: TileSelectionConfig) -> Self
pub fn with_selection(self, selection: TileSelectionConfig) -> Self
Set streamed tile-selection policy.
Sourcepub fn make_tile_source(&self) -> Option<Box<dyn TileSource>>
pub fn make_tile_source(&self) -> Option<Box<dyn TileSource>>
Build a fresh runtime tile source if this vector source is streamed.
Trait Implementations§
Source§impl Clone for VectorTileSource
impl Clone for VectorTileSource
Source§fn clone(&self) -> VectorTileSource
fn clone(&self) -> VectorTileSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more