Class StaticElevationTileSet
public sealed class StaticElevationTileSet : IElevationTileSet, IDisposable
- Inheritance
-
objectStaticElevationTileSet
- Implements
Properties
HeightArray
Terrarium-encoded heights for the displaced tile shader, or null when nothing loaded.
public Texture2DArray HeightArray { get; }
Property Value
- Texture2DArray
LayerCount
Layers actually present in HeightArray.
public int LayerCount { get; }
Property Value
LoadFailed
True once the fetch found zero usable Terrarium tiles - no network, every request failed, or the coverage list was empty. The map stays flat when this is true; a warning is logged exactly once, matching TerrariumElevationDrape's degrade-to-flat behavior.
public bool LoadFailed { get; }
Property Value
MaxHeightMercator
The largest sampled height across every fetched tile, converted
to normalized mercator at that tile's own center latitude. Feeds
the displaced shader's skirt depth uniform and the
NeedsReanchor(anchor, maxAltitudeMercator) overload for
layers drawn over the elevated map. Zero when LoadFailed.
public double MaxHeightMercator { get; }
Property Value
Sampler
Ground height source for MapViewTransform's terrain constructor. FlatElevationSampler when the fetch found nothing, so the map degrades to flat rather than crashing or leaving a hole.
public IElevationSampler Sampler { get; }
Property Value
Methods
Build(IEnumerable<TileCoord>, ZoomLevel, string)
Fetches and uploads the tile set. Never throws on a fetch failure: the returned set degrades to flat (LoadFailed true, Sampler a FlatElevationSampler, no array), with exactly one warning logged here.
public static StaticElevationTileSet Build(IEnumerable<TileCoord> coverageTiles, ZoomLevel zoom, string cacheDir)
Parameters
coverageTilesIEnumerable<TileCoord>The bounded set of Terrarium tiles to fetch, all at
zoom.zoomZoomLevelTerrarium zoom level every tile in
coverageTilesis at.cacheDirstringDisk cache directory for downloaded tiles, or null to disable caching, passed straight through to TerrariumTileFetch.
Returns
BuildFromDecoded(IReadOnlyDictionary<long, TerrariumHeightTile>, ZoomLevel)
Same construction as Build(IEnumerable<TileCoord>, ZoomLevel, string), from an already-decoded tile set rather than a live fetch. The seam a caller with its own decoded tiles - or a test that must not touch the network - uses to exercise the array upload, coverage lookup and degrade-to-flat behavior directly.
public static StaticElevationTileSet BuildFromDecoded(IReadOnlyDictionary<long, TerrariumHeightTile> decoded, ZoomLevel zoom)
Parameters
decodedIReadOnlyDictionary<long, TerrariumHeightTile>zoomZoomLevel
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EncodeMeters(double, out byte, out byte, out byte)
public static void EncodeMeters(double meters, out byte r, out byte g, out byte b)
Parameters
TryGetCoverage(TileCoord, out ElevationCoverage)
GPU coverage for one base tile: which array layer and UV subrect hold its heightmap.
public bool TryGetCoverage(TileCoord baseTile, out ElevationCoverage coverage)
Parameters
baseTileTileCoordcoverageElevationCoverage
Returns
Remarks
None when the tile's exact elevation-zoom ancestor was not in the fetched set (as well as when nothing was fetched at all, LoadFailed, or the base tile is shallower than the elevation zoom - a known slice 1 gap, not handled by spanning multiple layers), matching HeightmapElevationSampler's flat-outside-coverage contract on the CPU side.