Extension:Maps/Leaflet

From semantic-mediawiki.org
< Extension "Maps"
Extension "Maps"Extension:Maps/Leaflet
Maps extension
Overview
Installation and Configuration
Usage
Displaying maps
Customizing maps
    ↪  Leaflet  •  Google Maps
Displaying GeoJSON
Geocoding
Converting coordinates
SMW integration
Storing coordinates
Aggregating onto a map


Maps shown with the #display_map parser function can be customized using various parameters. This page lists the Leaflet specific parameters. Example demonstrating usage of the Leaflet-only geojson parameter:

Syntax
{{#display_map:
 | service=leaflet
 | geojson=Berlin
}}
Result
Loading map...


Table of contents

Parameters[edit]

Parameter Type Default Description
zoom whole number no The zoom level for the map. For maps with markers this will default to the most zoomed in level that still shows all markers.
width number and dimensional unit auto Allows setting the width of the map. By default pixels will be assumed as unit, but you can explicitly specify one of these units: px, ex, em, %.
height number and dimensional unit 350 Allows setting the height of the map. By default pixels will be assumed as unit, but you can explicitly specify one of these units: px, ex, em.
centre text no The location on which the map should be centered
title text empty Allows setting text that will be displayed in the pop-ups of all markers that do not have a specific title.

When used together with label, the title will be bold and underlined.

label text empty Allows setting text that will be displayed in the pop-ups of all markers that do not have a specific label.
icon text empty Allows setting the icon used for all markers.
lines List of lines empty Lines to display
polygons List of geographical polygons empty Polygons to display
circles List of circles empty Circles to display
rectangles List of rectangles empty Rectangles to display
maxzoom whole number no The maximum zoom level
minzoom whole number no The minimum zoom level
copycoords yes/no no Show a dialog when clicking on a location from which its coordinates may be copied
static yes/no no Make the map static
defzoom whole number 14 Allows setting the default zoom level of the map.
layers list of texts OpenStreetMap The layers that will be available in the layer selector. The first layer will be shown when the map loads.
overlays list of texts empty The overlay layers that will be shown when the map loads.
resizable yes/no no Makes the map resizable by dragging at its lower right corner.
fullscreen yes/no no Enable fullscreen button
scrollwheelzoom yes/no yes Indicates if mouse scrolling should be enabled or not.
cluster yes/no no Allows merging of multiple nearby markers into one marker
clustermaxzoom whole number 20 The maximum zoom level where clusters may exist.
clusterzoomonclick yes/no yes Whether the default behaviour of clicking on a cluster is to zoom into it.
clustermaxradius whole number 80 The maximum radius that a cluster will cover.
clusterspiderfy yes/no yes When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers.
geojson text empty URL of a file or name of the page containing GeoJSON data
clicktarget text empty When clicking on the map you will be send to this URL. %lat% is replaced by the latitude and %long% by the longitude

Examples[edit]

Layers[edit]

{{#display_map:
 | layers=OpenTopoMap,OpenStreetMap
 | zoom=1
}}
Loading map...

Overlays[edit]

{{#display_map:Calais; Dover
 | overlaylayers=OpenSeaMap
}}
Loading map...

Fullscreen[edit]

{{#display_map:Berlin
 | fullscreen=on
}}
Loading map...

Resizable[edit]

{{#display_map:New York City
 | resizable=on
}}
Loading map...

Click target[edit]

{{#display_map:Berlin
 | clicktarget=https://www.google.com/maps/@%lat%,%long%,8z
 | zoom=8
}}
Loading map...