Leaflet GeoJSON: Difference between revisions

From Maps for MediaWiki
mNo edit summary
mNo edit summary
Line 18: Line 18:
== In-wiki GeoJSON ==
== In-wiki GeoJSON ==


Since version 6.0, you can store your GeoJSON in wiki pages that are in the GeoJson namespace. For instance [[GeoJson:Berlin]]. You can use this GeoJSON in the [[Extension:Maps/Displaying_maps|<code>#display_map</code>]] parser function via the <code>geojson</code> parameter, by giving it the page name. The GeoJSON stored in a page can be used by as many maps as you like.
Since version 6.0, you can store your GeoJSON in wiki pages that are in the GeoJson namespace. For instance [[GeoJson:Berlin]]. You can use this GeoJSON via the <code>geojson</code> parameter, by giving it the page name. The GeoJSON stored in a page can be used by as many maps as you like.


<pre>{{#display_map: center=Berlin | geojson=Berlin}}</pre>
<pre>{{#display_map: center=Berlin | geojson=Berlin}}</pre>

Revision as of 07:15, 17 May 2020

Maps supports working with GeoJSON since version 6.

Since GeoJSON is an open standard, there are many tools that allow you to create an consume GeoJson. A simple online visual map editor that outputs GeoJSON is geojson.io.

GeoJSON files

{{#display_map: center=Berlin
 | geojson = https://raw.githubusercontent.com/leakyMirror/map-of-europe/master/GeoJSON/europe.geojson
}}
Loading map...

In-wiki GeoJSON

Since version 6.0, you can store your GeoJSON in wiki pages that are in the GeoJson namespace. For instance GeoJson:Berlin. You can use this GeoJSON via the geojson parameter, by giving it the page name. The GeoJSON stored in a page can be used by as many maps as you like.

{{#display_map: center=Berlin | geojson=Berlin}}
Loading map...

The pages in the GeoJson namespace make sure they contain valid JSON. Once saved, the pages show a preview of the GeoJSON on a Leaflet map.

Visual editor

Since version 6.7 pages in the GeoJson namespace contain a visual map editor. The editor is only shown to those with permissions to edit the page.

Since version 7.13 the editor is also shown on regular maps that use GeoJson.

Semantic MediaWiki integration

Since Maps version 7.16 there is experimental SMW integration that stores GeoJson data as SubObjects. Contact Jeroen De Dauw for more information.

Limitations

As of version 7.16:

You can hire Jeroen De Dauw (creator of Maps) to work on the above via Professional.Wiki.

See also