Leaflet Maps examples
Leaflet maps can be customized using various parameters.
This page lists examples. For an overview of available parameters and how to use them, see Customizing Leaflet Maps.
Markers, Polygons, Lines, etc
Layers
{{#display_map:
|layers=OpenTopoMap,OpenStreetMap
|zoom=1
}}
Note: The available layers come from the Leaflet-providers collection. The full list is in the $egMapsLeafletAvailableLayers setting of the DefaultSettings.php file. You can also define your own with the custom layers setting.
Overlays
{{#display_map:Calais; Dover
|overlaylayers=OpenSeaMap
}}
Custom layers
Besides the built-in layers, wikis running Maps 13.1.0 or later can define their own tile and WMS layers with the $egMapsLeafletLayerDefinitions configuration setting. A defined layer is then used by name, like a built-in one. A custom base layer goes in the layers parameter:
{{#display_map:Berlin |layers=Historic 1904 }}
A custom WMS layer, defined with 'wms' => true, works as an overlay through the overlaylayers parameter:
{{#display_map:Hamburg |overlaylayers=Weather }}
Fullscreen
{{#display_map:Berlin
|fullscreen=on
}}
Resizable
{{#display_map:New York City
|resizable=on
}}
Click target
{{#display_map:Berlin
|clicktarget=https://www.google.com/maps/@%lat%,%long%,8z
|zoom=8
}}
Image layers
{{#display_map:image layers=NewYorkSubway.jpg, NewYorkSubwaySmall.jpg }}
{{#display_map:image layers=NewYorkSubway.jpg | geojson=NewYorkSubway }}
Copy coords
Right-click on a marker to copy its coordinates.
{{#leaflet:Hong Kong; Macau
|copycoords=yes
|zoom=10
}}
Inline labels
Inline labels are not implemented for Leaflet. They do work for Google maps.
{{#leaflet:
Berlin~Popup title~Popup text~~Group~Berlin;
London~Popup title~Popup text~~Group~London;
}}
Links and Wikitext in Popups
{{#display_map:Berlin~~'''Berlin''' is the capital of [https://en.wikipedia.org/wiki/Germany Germany]}}