Leaflet Maps examples: Difference between revisions

From Maps for MediaWiki
(chg)
mNo edit summary
 
(8 intermediate revisions by 2 users not shown)
Line 113: Line 113:
  |zoom=3
  |zoom=3
}}
}}
== Copy coords ==
Right-click on a marker to copy its coordinates.
<pre>
{{#leaflet:Hong Kong; Macau
|copycoords=yes
|zoom=10
}}
</pre>
{{#leaflet:Hong Kong; Macau
|copycoords=yes
|height=300px
|scrollzoom=off
|zoom=10
}}
== Inline labels ==
Inline labels are not implemented for Leaflet. [[Google_Maps_examples#Inline_labels|They do work for Google maps]].
<pre>
{{#leaflet:
Berlin~Popup title~Popup text~~Group~Berlin;
London~Popup title~Popup text~~Group~London;
}}
</pre>
{{#leaflet:
Berlin~Popup title~Popup text~~Group~Berlin;
London~Popup title~Popup text~~Group~London;
|height=300px
|scrollzoom=off
}}
== Links and Wikitext in Popups ==
<pre>
{{#display_map:Berlin~~'''Berlin''' is the capital of [https://en.wikipedia.org/wiki/Germany Germany]}}
</pre>
{{#display_map:Berlin~~'''Berlin''' is the capital of [https://en.wikipedia.org/wiki/Germany Germany]}}

Latest revision as of 00:59, 11 February 2024

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

See Displaying Leaflet maps

Layers

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

Note: Maps code repository → List of available layers.

Overlays

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

Fullscreen

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

Resizable

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

Click target

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

Image layers

{{#display_map:image layers=NewYorkSubway.jpg, NewYorkSubwaySmall.jpg }}
Loading map...
{{#display_map:image layers=NewYorkSubway.jpg | geojson=NewYorkSubway }}
Loading map...

Copy coords

Right-click on a marker to copy its coordinates.

{{#leaflet:Hong Kong; Macau
 |copycoords=yes
 |zoom=10
}}
Loading map...

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;
}}
Loading map...

Links and Wikitext in Popups

{{#display_map:Berlin~~'''Berlin''' is the capital of [https://en.wikipedia.org/wiki/Germany Germany]}}
Loading map...