Help:Map format

Maps extension
Installation and Configuration
Displaying maps
Customizing maps
    ↪  Leaflet  •  Google Maps
Displaying GeoJSON
Converting coordinates
SMW integration
Storing coordinates
Aggregating onto a map
    ↪  Leaflet  •  Google Maps
On this page

Map format
Displays queried geographical data onto an interactive map
Further Information
Provided by: Extension "Maps"
Added: 0.1
Removed: still supported
Requirements: none
Format name: map
Enabled? Indicates whether the result format is enabled by default upon installation of the respective extension. yes
Authors: Jeroen De Dauw
Categories: geo
Table of Contents

The Maps extension can aggregate geographical data stored in Semantic MediaWiki onto dynamic and interactive maps such as Google Maps. Each coordinate is shown as a marker on the map, with associated data being displayed when clicking the marker. Coordinate aggregation is done via the Leaflet result format.


The map result format can be used in inline queries and in other semantic queries.

Simple query[edit]

{{#ask: [[Category:City]]
 | format=map
 | ?Has coordinates
Loading map...

For more information on the query syntax, see the SMW inline query documentation.

Distance query[edit]

A distance query for all cities within a 420 km radius of Brussels, using the Distance Popup template:

{{#ask: [[Has location type::City]] [[Has coordinates::50° 50' 48" N, 4° 21' 10" E  (420 km)]]
 | format=map
 | ?Has coordinates
 | ?Located in
 | template=Distance Popup
Loading map...

Compound query[edit]

This example makes use of the Extension "Semantic Compound Queries" extension to pick the used marker per type of location.

  [[Has location type::City]]
  [[Has location type::Local place]]
 ; ?Has coordinates
 ; ?Located in
 [[Has location type::Country]]
 ; ?Has coordinates
 ; ?Located in
 ; icon=Green marker.png
 [[Has location type::Continent]]
 ; ?Has coordinates
 ; ?Located in
 ; icon=Blue marker.png
 | format=map
 | height=400
Loading map...

Customizing maps[edit]

When using format=map, the default mapping service is used. Use format=leaflet or format=googlemaps to specify which mapping service should be used. See their respective documentation pages for mapping service specific customization options and examples.

This documentation page applies to all SMW versions from 1.6.0 to the most current version.
      Other languages: dezh-hans

Help:Map format en 1.6.0