Leaflet map

This example story is part of the SHMARQL documentation. It demonstrates the Leaflet Map Special Node. To open it as an editable project, download leaflet-map.lodeon.zip and import it in the story editor (/lodeon/ → Import).

A map node shows points, lines and areas on an OpenStreetMap background. It has three sources: a SPARQL query, points entered by hand, and GeoJSON. Markers can have a category (coloured, with a legend) and a popup with selected fields.

From a SPARQL query

A query for a map returns ?latitude and ?longitude, or one ?geometry (WKT such as Wikidata's coordinates, or GeoJSON). ?label, ?resource and ?category are used for the popup and the legend; other variables become extra popup fields.

Where Vermeer's paintings are (and were) kept

Map data ready: 20 features.

Collections of paintings by Johannes Vermeer, from Wikidata (property P195, 'collection'). Wikidata also records former owners, so some historical collections appear on the map.

Points entered by hand

Painting towns of the Dutch Golden Age

Map data ready: 4 features.

Four points entered by hand in the map node, with a category and an extra 'painters' property.

From GeoJSON

Rembrandt moves to Amsterdam

Map data ready: 3 features.

A GeoJSON FeatureCollection pasted into the map node: two points and a line.

Try it in the editor:

  • Add a fifth town in the points table of the second map.
  • Switch the initial view from fit to data to a fixed centre and zoom.
  • Turn marker clustering on or off.