pub struct TileManager { /* private fields */ }Expand description
Orchestrates tile fetching, caching, and visible-set computation.
Implementations§
Source§impl TileManager
impl TileManager
Sourcepub fn new(source: Box<dyn TileSource>, cache_capacity: usize) -> Self
pub fn new(source: Box<dyn TileSource>, cache_capacity: usize) -> Self
Create a new tile manager with the given source and cache capacity.
Sourcepub fn new_with_config(
source: Box<dyn TileSource>,
cache_capacity: usize,
selection_config: TileSelectionConfig,
) -> Self
pub fn new_with_config( source: Box<dyn TileSource>, cache_capacity: usize, selection_config: TileSelectionConfig, ) -> Self
Create a new tile manager with an explicit tile-selection policy.
Sourcepub fn update(
&mut self,
viewport_bounds: &WorldBounds,
zoom: u8,
camera_world: (f64, f64),
camera_distance: f64,
) -> VisibleTileSet
pub fn update( &mut self, viewport_bounds: &WorldBounds, zoom: u8, camera_world: (f64, f64), camera_distance: f64, ) -> VisibleTileSet
Update the tile manager for the current frame.
Sourcepub fn update_with_frustum(
&mut self,
frustum: &Frustum,
zoom: u8,
camera_world: (f64, f64),
) -> VisibleTileSet
pub fn update_with_frustum( &mut self, frustum: &Frustum, zoom: u8, camera_world: (f64, f64), ) -> VisibleTileSet
Update the tile manager using frustum-based quadtree traversal.
This is the MapLibre-equivalent covering-tiles path. Instead of enumerating a rectangular AABB tile range and then filtering against a sampled ground footprint, this performs a depth-first quadtree descent from zoom 0, pruning any subtree whose world-space AABB does not intersect the camera frustum.
Sourcepub fn update_with_covering(
&mut self,
frustum: &Frustum,
cam: &CoveringCamera,
opts: &CoveringTilesOptions,
camera_world: (f64, f64),
) -> VisibleTileSet
pub fn update_with_covering( &mut self, frustum: &Frustum, cam: &CoveringCamera, opts: &CoveringTilesOptions, camera_world: (f64, f64), ) -> VisibleTileSet
Update the tile manager using MapLibre-equivalent covering-tiles quadtree traversal with per-tile variable zoom heuristics.
This is the preferred path for perspective cameras at steep pitch.
It performs frustum-culled depth-first traversal where distant tiles
may use lower zoom levels than near tiles, matching MapLibre’s
coveringTiles() behaviour.
Sourcepub fn update_with_view(
&mut self,
viewport_bounds: &WorldBounds,
zoom: u8,
camera_world: (f64, f64),
_camera_distance: f64,
flat_view: Option<&FlatTileView>,
) -> VisibleTileSet
pub fn update_with_view( &mut self, viewport_bounds: &WorldBounds, zoom: u8, camera_world: (f64, f64), _camera_distance: f64, flat_view: Option<&FlatTileView>, ) -> VisibleTileSet
Update the tile manager with optional shared flat-view selection parameters for pitched perspective raster rendering.
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 desired_tiles(&self) -> &HashSet<TileId>
pub fn desired_tiles(&self) -> &HashSet<TileId>
Read-only access to the last desired source-tile set used for request selection.
Sourcepub fn counters(&self) -> &TileManagerCounters
pub fn counters(&self) -> &TileManagerCounters
Read-only access to cumulative tile-manager counters.
Sourcepub fn selection_config(&self) -> &TileSelectionConfig
pub fn selection_config(&self) -> &TileSelectionConfig
Read-only access to the current 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 used by future updates.
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 cached_count(&self) -> usize
pub fn cached_count(&self) -> usize
The number of tiles currently cached in any state.
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 affecting the visible tile set.
Only tiles outside the current frame’s last_desired_tiles are
requested, and existing cached or pending entries are skipped.
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.
The route is walked from the segment nearest to the camera position forward, sampling tile boundaries at the given zoom level. Only tiles that are ahead of the camera (further along the route) and not already in the current desired set or cache are requested.
Returns the number of new tile requests issued.
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 cache.
This is the integration point for the background MVT decode
pipeline: after poll() returns a TileData::RawVector entry
and the async pipeline decodes it, the decoded TileResponse
is fed back here to replace the raw entry with a fully decoded
TileData::Vector entry.