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.
Map data ready: 20 features.
Points entered by hand¶
Map data ready: 4 features.
From GeoJSON¶
Map data ready: 3 features.
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.