Class ZoomLevelLatch
Holds the integer tile level across zoom jitter near a level boundary.
public sealed class ZoomLevelLatch
- Inheritance
-
objectZoomLevelLatch
Remarks
Selecting on floor(zoom) alone flips the footprint every frame while zoom oscillates around an integer. Going down, a level is left only once zoom is clear of the boundary by Deadband. Going up, the commit fires as soon as the next level is clearly reached (offset >= 1.0), not 1.0 + Deadband: a zoom animation or a programmatic fly that lands EXACTLY on held-level + 1.0 (offset 1.0) must commit the finer level immediately, or the map rests drawn 2.0x magnified under the coarser one - the asymmetry is deliberate, not a mirror of the down side.
Properties
Deadband
Hysteresis in zoom units, default 0.15 of a level.
public double Deadband { get; set; }
Property Value
Level
Currently held integer zoom, or -1 before the first Update(double).
public int Level { get; }
Property Value
Methods
Reset()
Clears the latch so the next Update(double) takes floor(zoom).
public void Reset()
Update(double)
Advances the latch for the current zoom.
public int Update(double zoom)
Parameters
Returns
- int
The held integer level.