Table of Contents

Class ElevationCoverageDriftMonitor

Namespace
LansMap.Map.Elevation

Watches a map view for enough pan, zoom, rotation, or pitch to invalidate the coverage its live DEM fetch was built for, and re-triggers that fetch through a TilePipelineHost when it has.

public sealed class ElevationCoverageDriftMonitor
Inheritance
object
ElevationCoverageDriftMonitor

Remarks

Owns only the "has this view drifted far enough to need new terrain" decision - the fetch/dispose mechanics stay on TilePipelineHost, which already owns ElevationTileSet's lifecycle. Construct one instance per view and call CheckAndRefresh() once per frame from that view's own update loop.

Constructors

ElevationCoverageDriftMonitor(TilePipelineHost, Func<bool>, Func<double>, Func<double>, Func<double>, Func<double>, Func<double>, Func<IEnumerable<TileCoord>>)

public ElevationCoverageDriftMonitor(TilePipelineHost pipeline, Func<bool> elevationEnabled, Func<double> latitude, Func<double> longitude, Func<double> zoom, Func<double> rotationDeg, Func<double> pitchDeg, Func<IEnumerable<TileCoord>> resolveCoverageTiles)

Parameters

pipeline TilePipelineHost

Pipeline whose elevation fetch gets re-triggered on drift.

elevationEnabled Func<bool>

Whether elevation is currently on for the owning view.

latitude Func<double>

Current view center latitude, degrees WGS84.

longitude Func<double>

Current view center longitude, degrees WGS84.

zoom Func<double>

Current fractional map zoom.

rotationDeg Func<double>

Current map bearing, degrees.

pitchDeg Func<double>

Current map pitch, degrees from straight down.

resolveCoverageTiles Func<IEnumerable<TileCoord>>

Computes the elevation coverage tiles for the view's current location; called only after the cheap scalar check trips.

Methods

CheckAndRefresh()

Re-fetches elevation if the view has drifted past the pan/zoom/ rotation/pitch thresholds since the last check. No-op (and zero-GC) while elevation is off or the view has not moved enough.

public void CheckAndRefresh()