ui/map/TerrainToggleControl¶
Classes¶
TerrainToggleControl¶
Defined in: ui/map/TerrainToggleControl.ts:16
TerrainToggleControl - Always-present terrain toggle button.
Unlike MapLibre's built-in TerrainControl, this control stays in the DOM
across style changes. When the active style declares a raster-dem source,
the button is enabled and toggles 3D terrain. Otherwise it shows greyed-out
with a tooltip explaining that the current style has no terrain data.
Implements¶
IControl
Constructors¶
Constructor¶
Defined in: ui/map/TerrainToggleControl.ts:24
Parameters¶
exaggeration?¶
number = 1
Returns¶
Methods¶
onAdd()¶
Defined in: ui/map/TerrainToggleControl.ts:28
Register a control on the map and give it a chance to register event listeners and resources. This method is called by Map.addControl internally.
Parameters¶
map¶
Map$1
the Map this control will be added to
Returns¶
HTMLElement
The control's container element. This should be created by the control and returned by onAdd without being attached to the DOM: the map will insert the control's element into the DOM as necessary.
Implementation of¶
onRemove()¶
Defined in: ui/map/TerrainToggleControl.ts:53
Unregister a control on the map and give it a chance to detach event listeners and resources. This method is called by Map.removeControl internally.
Returns¶
void
Implementation of¶
refresh()¶
Defined in: ui/map/TerrainToggleControl.ts:64
Re-scan the active style for a raster-dem source and update button state.
Should be called after every style.load.
Returns¶
void