//! - **Tile cache survives relayout** via a `DatasetMergeCallback`. Every relayout creates a fresh
//! `MapTileCache` skeleton; the merge callback transfers all `Ready` / `Pending` entries from the
//! - **MVT + MapCSS → SVG → DOM.** The decode pipeline (MVT protobuf bytes + a MapCSS stylesheet →
pub fn with_on_mount<C: Into<MapMountCallback>>(mut self, data: RefAny, callback: C) -> Self {
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
if let Some(TileEntry::Ready { svg }) = self.tiles.get(&TileStyleKey { tile, look: want }) {
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // bounded layout/render numeric
fn tile_viewport_score(viewport: &MapViewport, layer: &MapTileLayer, id: MapTileId) -> f64 {
// to `with_viewport()` / `create()` for THIS build. Adopt those into the persistent cache: app callbacks (zoom
cache_guard.viewport.bearing_deg = normalize_bearing(cache_guard.viewport.bearing_deg + delta);
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma;
pub fn camera_overscan(viewport: &MapViewport, width_px: f32, height_px: f32) -> (f32, f32) {
let mercator = (1.0 - (lat_rad.tan() + 1.0 / lat_rad.cos()).ln() / core::f64::consts::PI) / 2.0;
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma;
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
/// - writeback `RefAny` = a clone of the cache dataset, so `map_tile_writeback` mutates the same
#[allow(clippy::cast_possible_truncation, clippy::cast_possible_wrap)] // bounded layout/render
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // bounded layout/render numeric
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] // bounded layout/render numeric cast
#[allow(clippy::suboptimal_flops)] // mul_add not guaranteed faster/available without target +fma; keep explicit a*b+c
#[allow(clippy::too_many_lines)] // large but cohesive: single-purpose layout/render/parse routine
extern "C" fn map_widget_render(data: RefAny, info: VirtualViewCallbackInfo) -> VirtualViewReturn {