An embeddable, framework-agnostic MapLibre elevation-profile control (a
maplibregl.IControl): draw a line on the map (double-click / Enter to finish)
and the widget samples the MapLibre terrain along it (queryTerrainElevation)
into an inline SVG elevation-vs-distance chart with min / max / gain / loss
stats. Hover is synced BOTH ways — moving over the chart drives a crosshair and
a marker on the map at that station; moving along the drawn line on the map
drives the chart crosshair.
Stations sampled before their DEM tile streamed re-sample automatically on the
map's next 'idle' (bounded, convergence-gated). With MapLibre terrain
disabled the profile is flat zero and the panel says so. On every change the
widget dispatches CustomEvent('profilechange', { detail: ProfileRun | null, bubbles: true }), and 'profilehover' with the hovered station (or null).
An embeddable, framework-agnostic MapLibre elevation-profile control (a
maplibregl.IControl): draw a line on the map (double-click / Enter to finish) and the widget samples the MapLibre terrain along it (queryTerrainElevation) into an inline SVG elevation-vs-distance chart with min / max / gain / loss stats. Hover is synced BOTH ways — moving over the chart drives a crosshair and a marker on the map at that station; moving along the drawn line on the map drives the chart crosshair.Stations sampled before their DEM tile streamed re-sample automatically on the map's next
'idle'(bounded, convergence-gated). With MapLibre terrain disabled the profile is flat zero and the panel says so. On every change the widget dispatchesCustomEvent('profilechange', { detail: ProfileRun | null, bubbles: true }), and'profilehover'with the hovered station (or null).Example
See
ElevationProfileWidgetOptions for the configuration fields.