Table of Contents

Class TileFootprint

Selects which map tiles cover the current view.

public static class TileFootprint
Inheritance
object
TileFootprint

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

view MapViewTransform

View to cover. Not retained.

result List<TileCoord>

Destination list; cleared then filled.

levelOverride int

Integer zoom to select at, or -1 to use floor of view zoom.

distanceLodEnabled bool

False 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

view MapViewTransform

View to cover. Not retained.

result List<VisibleTile>

Destination list; cleared then filled.

levelOverride int

Integer zoom to select at, or -1 to use floor of view zoom.

distanceLodEnabled bool

False 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

screen ScreenSize

Viewport size in screen px.

tileSizePx int

Tile size in screen px.

latitude double

Center latitude in degrees WGS84.

zoomLevel double

Fractional zoom; selection uses the floor.

pitchDeg double

Tilt in degrees, 0 to 85.

distanceLodEnabled bool

False selects the whole viewport at one level.

maxViewDistanceFactor double

How 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.

screenPixelScale double

Positive device pixels per logical map pixel.

maxElevationMeters double

Worst-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.