Help:Maps

From UBC Wiki

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

{{#display_map:Vancouver,BC}}
Loading map...

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...

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...

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...

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...


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...

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...

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...

Parameters

Maps an be customized using the below various parameters.

Customization syntax

{{#display_map: height=200px | Vancouver | centre=UBC | scrollzoom=off }}
Loading map...
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