Class TileFootprint
Selects which map tiles cover the current view.
public static class TileFootprint
- Inheritance
-
objectTileFootprint
Remarks
Not thread-safe: shared scratch buffers mean concurrent calls corrupt each other's results. Call from the main thread only.
Methods
SelectVisible(MapViewTransform, List<TileCoord>, int, bool)
Fills result with identity-level tiles in view,
without world copies.
public static void SelectVisible(MapViewTransform view, List<TileCoord> result, int levelOverride = -1, bool distanceLodEnabled = false)
Parameters
viewMapViewTransformView to cover. Not retained.
resultList<TileCoord>Destination list; cleared then filled.
levelOverrideintInteger zoom to select at, or -1 to use floor of
viewzoom.distanceLodEnabledboolFalse selects the whole viewport at one level. Default false.
Remarks
Use this for scheduling, prefetch, and pinning. Drawing a view
that straddles the antimeridian needs
SelectVisibleWrapped(MapViewTransform, List<VisibleTile>, int, bool) so each copy keeps its offset.
The elevation margin (see NearEdgeTerrainMarginPx(double))
is view's own MaxTerrainElevationMeters,
not a parameter here - it rides on the view so every caller picks
it up without remembering to pass it.
SelectVisibleWrapped(MapViewTransform, List<VisibleTile>, int, bool)
Fills result with drawn tiles, including world copies.
public static void SelectVisibleWrapped(MapViewTransform view, List<VisibleTile> result, int levelOverride = -1, bool distanceLodEnabled = false)
Parameters
viewMapViewTransformView to cover. Not retained.
resultList<VisibleTile>Destination list; cleared then filled.
levelOverrideintInteger zoom to select at, or -1 to use floor of
viewzoom.distanceLodEnabledboolFalse selects the whole viewport at one level. Default false.
Remarks
X is not clamped to the world, so a view straddling the antimeridian
keeps showing tiles, and a view wider than the world repeats a tile
across copies. The elevation margin rides on view's
own MaxTerrainElevationMeters, not a
parameter here - see SelectVisible(MapViewTransform, List<TileCoord>, int, bool).
WorstCaseCount(ScreenSize, int, double, double, double, bool, double, double, double)
Largest identity-level tile count any view of this size can select at this zoom, latitude, and pitch, over a full turn.
public static int WorstCaseCount(ScreenSize screen, int tileSizePx, double latitude, double zoomLevel, double pitchDeg, bool distanceLodEnabled, double maxViewDistanceFactor = 2.366025403784439, double screenPixelScale = 1, double maxElevationMeters = 0)
Parameters
screenScreenSizeViewport size in screen px.
tileSizePxintTile size in screen px.
latitudedoubleCenter latitude in degrees WGS84.
zoomLeveldoubleFractional zoom; selection uses the floor.
pitchDegdoubleTilt in degrees, 0 to 85.
distanceLodEnabledboolFalse selects the whole viewport at one level.
maxViewDistanceFactordoubleHow far the map draws ground, in multiples of the camera distance. See MaxViewDistanceFactor. Pass the map's own value: this is the term that keeps the count finite at steep pitch, so sizing against the default while the map runs a larger one under-sizes the cache.
screenPixelScaledoublePositive device pixels per logical map pixel.
maxElevationMetersdoubleWorst-case ground height above the flat plane, in meters. Zero (the default) sizes byte-identical to a sampler-less view.
Returns
- int
Peak tile count across the rotation sweep.
Remarks
Latitude, pitch and max view distance are the caller's: mercator row height varies with latitude, and a consumer that clamps max pitch below the ceiling should not size for the ceiling.