Skip to main content

TileLayer

Struct TileLayer 

Source
pub struct TileLayer { /* private fields */ }
Expand description

A raster tile layer that fetches slippy-map tiles from a source.

Implementations§

Source§

impl TileLayer

Source

pub fn new( name: impl Into<String>, source: Box<dyn TileSource>, cache_capacity: usize, ) -> Self

Create a new tile layer.

Source

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.

Source

pub fn update( &mut self, viewport_bounds: &WorldBounds, zoom: u8, camera_world: (f64, f64), camera_distance: f64, )

Update tile fetching for the current frame.

Source

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.

Source

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).

Source

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.

Source

pub fn visible_tiles(&self) -> &VisibleTileSet

The set of tiles visible in the last update.

Source

pub fn desired_tiles(&self) -> &HashSet<TileId>

The set of source tiles the manager last considered the desired view.

Source

pub fn last_selection_stats(&self) -> &TileSelectionStats

Read-only access to the most recent tile-selection/update stats.

Source

pub fn counters(&self) -> &TileManagerCounters

Read-only access to cumulative tile-manager counters.

Source

pub fn cache_stats(&self) -> TileCacheStats

Snapshot counts of the current tile-cache state.

Source

pub fn source_diagnostics(&self) -> Option<TileSourceDiagnostics>

Optional runtime diagnostics from the underlying tile source.

Source

pub fn lifecycle_diagnostics(&self) -> TileLifecycleDiagnostics

Snapshot of recent tile lifecycle diagnostics.

Source

pub fn selection_config(&self) -> &TileSelectionConfig

Read-only access to the tile-selection policy.

Source

pub fn set_selection_config(&mut self, config: TileSelectionConfig)

Replace the tile-selection policy.

Source

pub fn manager(&self) -> &TileManager

Access the underlying tile manager.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Layer for TileLayer

Source§

fn id(&self) -> LayerId

A process-unique identifier for this layer. Read more
Source§

fn kind(&self) -> LayerKind

The concrete layer type for enum-based dispatch. Read more
Source§

fn name(&self) -> &str

Human-readable name for UI and debug output. Read more
Source§

fn visible(&self) -> bool

Whether this layer participates in the current frame. Read more
Source§

fn set_visible(&mut self, visible: bool)

Toggle visibility on or off.
Source§

fn opacity(&self) -> f32

Layer opacity in the range [0.0, 1.0]. Read more
Source§

fn set_opacity(&mut self, opacity: f32)

Set the layer opacity. Read more
Source§

fn as_any(&self) -> &dyn Any

Borrow the layer as &dyn Any for concrete type access. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Borrow the layer as &mut dyn Any for mutable concrete type access.
Source§

fn z_index(&self) -> i32

Hint for render ordering within the layer stack. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.