Struct VanWijkPath
Van Wijk and Nuij smooth zoom-and-pan path from one view to another.
public readonly struct VanWijkPath
- Inherited Members
Remarks
Long jumps zoom out, translate, and zoom back in along the optimal arc. A jump with no translation is a pure exponential zoom. Longitude uses the wrap-aware shortest delta, so a path never crosses the long way around the world. Rho 1.42 and 1.2 screenfuls/s keep the scale change gradual.
Fields
Rho
Path curvature, dimensionless.
public const double Rho = 1.42
Field Value
SpeedScreenfullsPerSecond
Path speed in screenfuls per second.
public const double SpeedScreenfullsPerSecond = 1.2
Field Value
Properties
DurationSeconds
Duration of the path in seconds, at least 0.001.
public double DurationSeconds { get; }
Property Value
PanScreenfulls
Pan distance from start to target, in screenfuls (screen's larger dimension) at the start zoom. Zero for a pure zoom.
public double PanScreenfulls { get; }
Property Value
Methods
Create(LatLon, double, LatLon, double, ScreenSize, int)
Builds a path between two WGS84 centers and zoom levels.
public static VanWijkPath Create(LatLon fromLl, double fromZoom, LatLon toLl, double toZoom, ScreenSize screen, int tileSizePx)
Parameters
fromLlLatLonStart center in degrees WGS84.
fromZoomdoubleStart fractional Web Mercator zoom.
toLlLatLonTarget center in degrees WGS84.
toZoomdoubleTarget fractional Web Mercator zoom.
screenScreenSizeViewport size in pixels.
tileSizePxintTile size in pixels, used to convert mercator distance to screen px at
fromZoom.
Returns
- VanWijkPath
A path to sample from t=0 to t=1 over DurationSeconds.
Sample(double)
Samples center and zoom along the optimal path.
public (LatLon Center, double Zoom) Sample(double t)
Parameters
tdoubleNormalized time, 0 to 1; values outside are clamped.