pub struct HttpVectorTileSource { /* private fields */ }Expand description
A TileSource that fetches and decodes Mapbox Vector Tiles (PBF)
over HTTP.
See the module-level documentation for the full pipeline description.
Implementations§
Source§impl HttpVectorTileSource
impl HttpVectorTileSource
Sourcepub fn new(url_template: impl Into<String>, client: Box<dyn HttpClient>) -> Self
pub fn new(url_template: impl Into<String>, client: Box<dyn HttpClient>) -> Self
Create a new HTTP vector tile source.
The URL template should produce PBF/MVT binary responses,
e.g. "https://demotiles.maplibre.org/tiles/{z}/{x}/{y}.pbf".
Sourcepub fn with_deferred_decode(self, deferred: bool) -> Self
pub fn with_deferred_decode(self, deferred: bool) -> Self
Enable deferred decoding mode.
When enabled, poll returns
TileData::RawVector payloads carrying the raw PBF bytes
instead of performing the MVT decode inline. The caller is
responsible for submitting the decode work to a background
thread and promoting the tile cache entry once complete.
Sourcepub fn deferred_decode(&self) -> bool
pub fn deferred_decode(&self) -> bool
Whether deferred decoding is enabled.
Sourcepub fn with_tilejson(self, tilejson: TileJson) -> Self
pub fn with_tilejson(self, tilejson: TileJson) -> Self
Attach TileJSON metadata to configure source zoom range and bounds filtering.
Sourcepub fn with_decode_options(self, options: MvtDecodeOptions) -> Self
pub fn with_decode_options(self, options: MvtDecodeOptions) -> Self
Set MVT decode options (e.g. layer filter).
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a default header sent with every tile request.
Sourcepub fn url_template(&self) -> &str
pub fn url_template(&self) -> &str
The URL template this source was constructed with.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
The number of requests currently in flight.