Class ElevationCoverageDriftMonitor
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
-
objectElevationCoverageDriftMonitor
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
pipelineTilePipelineHostPipeline whose elevation fetch gets re-triggered on drift.
elevationEnabledFunc<bool>Whether elevation is currently on for the owning view.
latitudeFunc<double>Current view center latitude, degrees WGS84.
longitudeFunc<double>Current view center longitude, degrees WGS84.
zoomFunc<double>Current fractional map zoom.
rotationDegFunc<double>Current map bearing, degrees.
pitchDegFunc<double>Current map pitch, degrees from straight down.
resolveCoverageTilesFunc<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()