Part of #2259. Cesium parity roadmap, tier 3.
Problem
CesiumCanvas only enables terrain when a Cesium Ion token is present (terrainEnabled && Boolean(ionToken)), because setTerrainEnabled calls createWorldTerrainAsync. getTerrainCogSource returns null, hasCustomTerrainSource is false, and setTerrainCogSource resolves false. So the Controls → Terrain toggle and the Terrain Settings dialog do nothing on a keyless globe, while the 2D map has keyless AWS Terrarium terrain plus COG-backed terrain.
Proposal
- Write a
TerrariumTerrainProvider implementing Cesium's TerrainProvider: fetch the AWS Terrain Tiles PNG, decode RGB → metres, downsample to a HeightmapTerrainData grid (65×65 or 33×33), with a WebMercatorTilingScheme and availability derived from the source's max zoom. Cesium consumes heightmap terrain natively, so no quantized-mesh work is required.
- Point the same provider at the existing COG → Terrarium tile producer in
cog-dem-source.ts to implement setTerrainCogSource, making the Terrain Settings dialog engine-neutral.
- Keep Cesium World Terrain as the upgrade when a token exists; drop the token gate in
CesiumCanvas.
- Mount
TerrainSettingsDialog on the globe (it is in the MapLibre-only subtree in DesktopShell).
Effort
Medium.
Part of #2259. Cesium parity roadmap, tier 3.
Problem
CesiumCanvasonly enables terrain when a Cesium Ion token is present (terrainEnabled && Boolean(ionToken)), becausesetTerrainEnabledcallscreateWorldTerrainAsync.getTerrainCogSourcereturnsnull,hasCustomTerrainSourceisfalse, andsetTerrainCogSourceresolvesfalse. So the Controls → Terrain toggle and the Terrain Settings dialog do nothing on a keyless globe, while the 2D map has keyless AWS Terrarium terrain plus COG-backed terrain.Proposal
TerrariumTerrainProviderimplementing Cesium'sTerrainProvider: fetch the AWS Terrain Tiles PNG, decode RGB → metres, downsample to aHeightmapTerrainDatagrid (65×65 or 33×33), with aWebMercatorTilingSchemeandavailabilityderived from the source's max zoom. Cesium consumes heightmap terrain natively, so no quantized-mesh work is required.cog-dem-source.tsto implementsetTerrainCogSource, making the Terrain Settings dialog engine-neutral.CesiumCanvas.TerrainSettingsDialogon the globe (it is in the MapLibre-only subtree inDesktopShell).Effort
Medium.