Components / Maps

Map

An OpenLayers map styled by the design tokens: markers, GeoJSON, popups, themed controls and dark-mode tiles.

@ruckc/truss-ol Maps

Import

import { Map as OLMap } from '@ruckc/truss-ol';

Playground

basemap
selected

API

PropTypeDefaultDescription
center bindable [number, number][0, 20][lon, lat]
zoom bindable number2Map zoom level. Bind it to track zooming.
basemap Basemap'osm'Tile source: `osm`, `none` (a themed graticule that works offline) or a custom XYZ URL.
markers MapMarker[][]Points to show on the map.
geojson object—GeoJSON FeatureCollection/Feature. Optional `properties.kind` picks the intent color.
selected bindable string—Selected marker id.
height number | string420Height in pixels (or any CSS length).
fitOnLoad booleantrueFit the view to markers/features on first load.
popup snippet Snippet<[marker: MapMarker]>—Custom popup body for the selected marker.
toolbar snippet Snippet—Extra controls appended to the toolbar.
onselect event(s: MapSelection | null) => void—Called when an item is chosen.
/docs/map Truss UI · MIT