pub struct TileLayer { /* private fields */ }Expand description
A raster tile layer that fetches slippy-map tiles from a source.
Implementations§
Source§impl TileLayer
impl TileLayer
Sourcepub fn new(
name: impl Into<String>,
source: Box<dyn TileSource>,
cache_capacity: usize,
) -> Self
pub fn new( name: impl Into<String>, source: Box<dyn TileSource>, cache_capacity: usize, ) -> Self
Create a new tile layer.
Sourcepub fn new_with_selection_config(
name: impl Into<String>,
source: Box<dyn TileSource>,
cache_capacity: usize,
selection_config: TileSelectionConfig,
) -> Self
pub fn new_with_selection_config( name: impl Into<String>, source: Box<dyn TileSource>, cache_capacity: usize, selection_config: TileSelectionConfig, ) -> Self
Create a new tile layer with an explicit tile-selection policy.
Sourcepub fn update(
&mut self,
viewport_bounds: &WorldBounds,
zoom: u8,
camera_world: (f64, f64),
camera_distance: f64,
)
pub fn update( &mut self, viewport_bounds: &WorldBounds, zoom: u8, camera_world: (f64, f64), camera_distance: f64, )
Update tile fetching for the current frame.
Sourcepub fn update_with_view(
&mut self,
viewport_bounds: &WorldBounds,
zoom: u8,
camera_world: (f64, f64),
camera_distance: f64,
flat_view: Option<&FlatTileView>,
)
pub fn update_with_view( &mut self, viewport_bounds: &WorldBounds, zoom: u8, camera_world: (f64, f64), camera_distance: f64, flat_view: Option<&FlatTileView>, )
Update tile fetching for the current frame with optional footprint-aware flat-view selection parameters.
Sourcepub fn update_with_frustum(
&mut self,
frustum: &Frustum,
zoom: u8,
camera_world: (f64, f64),
)
pub fn update_with_frustum( &mut self, frustum: &Frustum, zoom: u8, camera_world: (f64, f64), )
Update tile fetching for the current frame using frustum-based
quadtree traversal (MapLibre-equivalent coveringTiles path).
Sourcepub fn update_with_covering(
&mut self,
frustum: &Frustum,
cam: &CoveringCamera,
opts: &CoveringTilesOptions,
camera_world: (f64, f64),
)
pub fn update_with_covering( &mut self, frustum: &Frustum, cam: &CoveringCamera, opts: &CoveringTilesOptions, camera_world: (f64, f64), )
Update tile fetching using MapLibre-equivalent covering-tiles traversal with per-tile variable zoom heuristics.
This is the preferred path for steep-pitch terrain views where distant tiles should use lower zoom levels than near tiles.
Sourcepub fn visible_tiles(&self) -> &VisibleTileSet
pub fn visible_tiles(&self) -> &VisibleTileSet
The set of tiles visible in the last update.
Sourcepub fn desired_tiles(&self) -> &HashSet<TileId>
pub fn desired_tiles(&self) -> &HashSet<TileId>
The set of source tiles the manager last considered the desired view.
Sourcepub fn last_selection_stats(&self) -> &TileSelectionStats
pub fn last_selection_stats(&self) -> &TileSelectionStats
Read-only access to the most recent tile-selection/update stats.
Sourcepub fn counters(&self) -> &TileManagerCounters
pub fn counters(&self) -> &TileManagerCounters
Read-only access to cumulative tile-manager counters.
Sourcepub fn cache_stats(&self) -> TileCacheStats
pub fn cache_stats(&self) -> TileCacheStats
Snapshot counts of the current tile-cache state.
Sourcepub fn source_diagnostics(&self) -> Option<TileSourceDiagnostics>
pub fn source_diagnostics(&self) -> Option<TileSourceDiagnostics>
Optional runtime diagnostics from the underlying tile source.
Sourcepub fn lifecycle_diagnostics(&self) -> TileLifecycleDiagnostics
pub fn lifecycle_diagnostics(&self) -> TileLifecycleDiagnostics
Snapshot of recent tile lifecycle diagnostics.
Sourcepub fn selection_config(&self) -> &TileSelectionConfig
pub fn selection_config(&self) -> &TileSelectionConfig
Read-only access to the tile-selection policy.
Sourcepub fn set_selection_config(&mut self, config: TileSelectionConfig)
pub fn set_selection_config(&mut self, config: TileSelectionConfig)
Replace the tile-selection policy.
Sourcepub fn manager(&self) -> &TileManager
pub fn manager(&self) -> &TileManager
Access the underlying tile manager.
Sourcepub fn promote_decoded(&mut self, decoded: Vec<(TileId, TileResponse)>)
pub fn promote_decoded(&mut self, decoded: Vec<(TileId, TileResponse)>)
Promote externally decoded tiles into the tile manager’s cache.
See TileManager::promote_decoded for details.
Sourcepub fn prefetch_with_view(
&mut self,
viewport_bounds: &WorldBounds,
zoom: u8,
camera_world: (f64, f64),
flat_view: Option<&FlatTileView>,
max_requests: usize,
) -> usize
pub fn prefetch_with_view( &mut self, viewport_bounds: &WorldBounds, zoom: u8, camera_world: (f64, f64), flat_view: Option<&FlatTileView>, max_requests: usize, ) -> usize
Speculatively prefetch tiles for a predicted viewport without changing the current visible tile set.
Sourcepub fn prefetch_zoom_direction(
&mut self,
camera_world: (f64, f64),
direction: ZoomPrefetchDirection,
max_requests: usize,
) -> usize
pub fn prefetch_zoom_direction( &mut self, camera_world: (f64, f64), direction: ZoomPrefetchDirection, max_requests: usize, ) -> usize
Speculatively prefetch tiles implied by the current desired set and a zoom direction.
Sourcepub fn prefetch_route(
&mut self,
route: &[GeoCoord],
zoom: u8,
camera_world: (f64, f64),
max_requests: usize,
) -> usize
pub fn prefetch_route( &mut self, route: &[GeoCoord], zoom: u8, camera_world: (f64, f64), max_requests: usize, ) -> usize
Speculatively prefetch tiles along a geographic route polyline.
See TileManager::prefetch_route for details.