You can add maps to the wiki. Adding maps to your wiki page can be useful when:
- you are writing an article about regions/countries.
- you want to show the venue of the event.
- you want to organize multiple wiki pages using map.
Examples
Creating Basics Maps
| It is recommended to switch to wikitext mode when you add a map to your page |
{{#display_map:Vancouver,BC}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"","title":"","link":"","lat":49.2608724,"lon":-123.113952,"icon":""}],"imageoverlays":null}
Adding description to the marker
You can add the description to the marker in the format Location~Title~Label
{{#display_map:Vancouver,BC~Title of the marker~This is Vancouver}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003ETitle of the marker\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Vancouver\n\u003C/p\u003E\u003C/div\u003E","title":"Title of the marker\n","link":"","lat":49.2608724,"lon":-123.113952,"icon":""}],"imageoverlays":null}
Maps with multiple points
You can add multiple points to the map using the comma.
{{
#display_points:
Vancouver, BC;
Calgary, AB;
Saskatoon, SK
}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"","title":"","link":"","lat":49.2608724,"lon":-123.113952,"icon":""},{"text":"","title":"","link":"","lat":51.0456064,"lon":-114.057541,"icon":""},{"text":"","title":"","link":"","lat":52.131802,"lon":-106.660767,"icon":""}],"imageoverlays":null}
Adding descriptions to multiple markers
Similar to maps with single points, you can add descriptions to maps with multiple points as well.
{{
#display_map:
Vancouver, BC~Vancouver~This is Vancouver;
Calgary, AB~Calgary~This is Calgary;
Saskatoon, SK~Saskatoon~This is Saskatoon;
}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EVancouver\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Vancouver\n\u003C/p\u003E\u003C/div\u003E","title":"Vancouver\n","link":"","lat":49.2608724,"lon":-123.113952,"icon":""},{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003ECalgary\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Calgary\n\u003C/p\u003E\u003C/div\u003E","title":"Calgary\n","link":"","lat":51.0456064,"lon":-114.057541,"icon":""},{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003ESaskatoon\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Saskatoon\n\u003C/p\u003E\u003C/div\u003E","title":"Saskatoon\n","link":"","lat":52.131802,"lon":-106.660767,"icon":""}],"imageoverlays":null}
Alternative syntax
When you have many customized markers, using the #display_map parser function can get unwieldy. For this reason you can also use the <display_map> tag. It has all the same parameters as the parser function, the only difference is the syntax. Each location goes own its own line and they do not need to be separated with a semicolon.
<display_map height="600" service="leaflet">
Vancouver, BC~Vancouver~This is Vancouver~
Calgary, AB~Calgary~This is Calgary~
Saskatoon, SK~Saskatoon~This is Saskatoon~
</display_map>
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"600px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EVancouver\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Vancouver\n\u003C/p\u003E\u003C/div\u003E","title":"Vancouver\n","link":"","lat":49.2608724,"lon":-123.113952,"icon":""},{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003ECalgary\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Calgary\n\u003C/p\u003E\u003C/div\u003E","title":"Calgary\n","link":"","lat":51.0456064,"lon":-114.057541,"icon":""},{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003ESaskatoon\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EThis is Saskatoon\n\u003C/p\u003E\u003C/div\u003E","title":"Saskatoon\n","link":"","lat":52.131802,"lon":-106.660767,"icon":""}],"imageoverlays":null}
Add maps via Geo-coordinates
You can create a map through Geo-coordinates. This feature is useful if you want to map specific location.
You can find out Geo-coordinates through websites such as GPS Coordinates.
{{
#display_map:
49.2673031,-123.2524766~Irving K. Barber Learning Centre~Centre for Teaching, Learning and Technology is located at the Irving K. Barber Learning Centre.;
}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EIrving K. Barber Learning Centre\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003ECentre for Teaching, Learning and Technology is located at the Irving K. Barber Learning Centre.\n\u003C/p\u003E\u003C/div\u003E","title":"Irving K. Barber Learning Centre\n","link":"","lat":49.2673031,"lon":-123.2524766,"icon":""}],"imageoverlays":null}
Formatting within the marker description
you can add formats to the marker description including adding [Help:Links|links]].
{{
#display_map:
49.2673031,-123.2524766~Irving K. Barber Learning Centre~[[Center for Teaching, Learning and Technology|Centre for Teaching, Learning and Technology]] is located at the Irving K. Barber Learning Centre.;}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EIrving K. Barber Learning Centre\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003E\u003Ca href=\"/Center_for_Teaching,_Learning_and_Technology\" class=\"mw-redirect\" title=\"Center for Teaching, Learning and Technology\"\u003ECentre for Teaching, Learning and Technology\u003C/a\u003E is located at the Irving K. Barber Learning Centre.\n\u003C/p\u003E\u003C/div\u003E","title":"Irving K. Barber Learning Centre\n","link":"","lat":49.2673031,"lon":-123.2524766,"icon":""}],"imageoverlays":null}
Advanced Maps
Circles
Via the circles parameter you can display circles on the map. Each circles has a center and a diameter. You can specify the popup title and text and the looks of the circle. The syntax is:
Address of the center:Diameter~Popup title~Popup text~Border color~Border opacity~Border thickness~Fill color~Fill opacity
Example:
{#display_map:circles=
University of British Columbia:500;
University of British Columbia:100~I am a title~And I am a description~green~0.7~10~blue~0.5
| zoom=14
}}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[{"text":"","title":"","link":"","strokeColor":"#FF0000","strokeOpacity":"1","strokeWeight":"2","fillColor":"#FF0000","fillOpacity":"0.5","centre":{"lon":-123.24624198622213,"lat":49.25783145},"radius":500},{"text":"\u003Cb\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EI am a title\n\u003C/p\u003E\u003C/div\u003E\u003C/b\u003E\u003Cdiv class=\"mw-parser-output\"\u003E\u003Cp\u003EAnd I am a description\n\u003C/p\u003E\u003C/div\u003E","title":"I am a title\n","link":"","strokeColor":"green","strokeOpacity":"0.7","strokeWeight":"10","fillColor":"blue","fillOpacity":"0.5","centre":{"lon":-123.24624198622213,"lat":49.25783145},"radius":100}],"rectangles":[],"copycoords":false,"static":false,"zoom":14,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":true,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[],"imageoverlays":null}
Parameters
Maps an be customized using the below various parameters.
Customization syntax
{{#display_map: height=200px | Vancouver | centre=UBC | scrollzoom=off }}
Loading map...
{"minzoom":false,"maxzoom":false,"mappingservice":"leaflet","width":"auto","height":"200px","centre":{"text":"","title":"","link":"","lat":49.25783145,"lon":-123.24624198622213,"icon":""},"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"zoom":false,"defzoom":14,"layers":["OpenStreetMap"],"image layers":[],"overlays":[],"resizable":false,"fullscreen":false,"scrollwheelzoom":false,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","imageLayers":[],"locations":[{"text":"","title":"","link":"","lat":49.2608724,"lon":-123.113952,"icon":""}],"imageoverlays":null}
Parameter
|
Default
|
⧼validator-describe-header-description⧽
|
zoom
|
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
|
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
|
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
|
no
|
The location on which the map should be centered
|
title
|
|
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
|
|
Allows setting text that will be displayed in the pop-ups of all markers that do not have a specific label.
|
icon
|
|
Allows setting the icon used for all markers.
|
lines
|
|
Lines to display
|
polygons
|
|
Polygons to display
|
circles
|
|
Circles to display
|
rectangles
|
|
Rectangles to display
|
maxzoom
|
no
|
The maximum zoom level
|
minzoom
|
no
|
The minimum zoom level
|
copycoords
|
no
|
Show a dialog when clicking on a marker from which its coordinates may be copied
|
static
|
no
|
Make the map static
|
defzoom
|
14
|
Allows setting the default zoom level of the map.
|
layers
|
OpenStreetMap
|
The layers that will be available in the layer selector. The first layer will be shown when the map loads.
|
image layers
|
|
Image base layers. The first layer will be shown by default. If any images are specified, they will be used instead of the regular map layers.
|
overlays
|
|
The overlay layers that will be shown when the map loads.
|
resizable
|
no
|
Makes the map resizable by dragging at its lower right corner.
|
fullscreen
|
no
|
Enable fullscreen button
|
scrollwheelzoom
|
yes
|
Indicates if mouse scrolling should be enabled or not.
|
cluster
|
no
|
Allows merging of multiple nearby markers into one marker
|
clustermaxzoom
|
20
|
The maximum zoom level where clusters may exist.
|
clusterzoomonclick
|
yes
|
Whether the default behaviour of clicking on a cluster is to zoom into it.
|
clustermaxradius
|
80
|
The maximum radius that a cluster will cover.
|
clusterspiderfy
|
yes
|
When you click a cluster at the bottom zoom level we spiderfy it so you can see all of its markers.
|
geojson
|
|
URL of a file or name of the page containing GeoJSON data
|
clicktarget
|
|
When clicking on the map you will be sent to this URL. %lat% is replaced by the latitude and %long% by the longitude
|
Resources
More documentation can be found on Maps documentation site