The driven headless controller (dispatch actions / read state programmatically).
Default control position.
MapLibre IControl hook — builds the DOM, wires the controller + map handlers.
MapLibre IControl hook — full teardown (handlers, handles, styles, owned controller).
An embeddable, framework-agnostic MapLibre slice control (a
maplibregl.IControl) — an interactive BOUNDED clipping volume cutting through the scene's Bitruvius 3D layers."New slice" arms placement; the next map click drops the slice box through the clicked point (on 3D content when SliceWidgetOptions.pickPosition is provided, else on the terrain/basemap), facing the camera. The cut affects ONLY the box footprint — bounded by the plane's width and the cut depth (shown as a ground outline), unbounded vertically so buildings are cut floor-to-roof. Four on-map handles adjust it live:
Panel sliders mirror heading/tilt/width/depth, plus Flip (swap kept side), an enable toggle, and Reset. On each change it pushes the plane set to the scene's clipping controller and dispatches a DOM
CustomEvent('slicechange', { detail: SliceState, bubbles: true }).The slice affects Bitruvius 3D layers only — the basemap, MapLibre terrain, and native MapLibre layers are not clipped.
Example
See
SliceWidgetOptions for the configuration fields.