Skip to content

Map viewer ​

Shows where records are: their geometries, points or density on a map.

components-wktmap--defaultOpen in Storybook ↗

When to use ​

  • Records with a location or an area: sampling stations, sites, finds.
  • The map view of a list, to see where the results are and filter by the visible area.
  • A record's location on its detail page.

When not to use ​

  • An address without coordinates: show it as text.
  • The only place a location is given: the coordinates should also be readable as a value in the record's fields.

Anatomy ​

  1. Base map: OpenStreetMap tiles, or satellite imagery where the map is configured for it. On geometry, point and heat maps the attribution sits at the bottom right and never collapses.
  2. Features: the records on the map, in the client accent (--color-accent): an area has an accent outline and a 25% accent fill; an area too small to see at the current zoom shows as an accent dot with a white ring.
  3. Map controls: a white capsule at the top left with zoom in, zoom out and, on point and heat maps, fullscreen. They use the same viewer buttons as the media viewer.
  4. Popup: a click on a feature opens a small card on --radius-overlay with an overlay shadow: a close button, the configured values of the record, and Open in new tab.

Geometry and point maps fit themselves around their features when they load.

Variants ​

VariantWhereWhat it shows
Geometry mapdetail panels, list map viewareas and points from WKT; at low zoom, large result sets show as numbered accent discs
Point maplist map viewone point per record; with clustering on, a single record shows as a pin and nearby records merge into a numbered accent disc
Heat maplist map view, detail panelsthe density of records as a heat layer
Locationmediafile detailsone pin at the mediafile's location, with its own zoom buttons, and its location fields below
components-pointmap--clusteredOpen in Storybook ↗
base-basemap--defaultOpen in Storybook ↗

A click on a numbered disc zooms in on it. In the list's map view, moving the map can filter the list to the visible area, when the view is configured to.

States ​

StateWhat you seeTrigger
Loading resultsa small spinner capsule at the top centre of the mapthe list's results load
Pointer on a featurepointer cursorhover over a feature on a geometry map
Popup loadingthe popup with a spinnera feature is clicked
Popupthe record's values and Open in new tab; an empty value reads No valueloaded
components-mapfeaturepopup--statesOpen in Storybook ↗

Keyboard & accessibility ​

  • Each map is a role="region" named Map.
  • Zoom in, zoom out and fullscreen are real buttons named Zoom in, Zoom out and Fullscreen.
  • The popup is a role="dialog" named after its first value. Its close button is named Close, and Escape closes it.
  • Panning and selecting features need a pointer, so the record's coordinates and values must also be available as text.

Content ​

  • Popup labels are the record's field labels: Name, Station code.
  • Translation keys: map.label, map.open-in-new-tab, and the viewer buttons' media-viewer.zoom-in, media-viewer.zoom-out, media-viewer.fullscreen.

Media viewer · Entity list element · Preview panel

Powered by Elody - Open Source Semantic Data Platform