This page is about customization of the information that is shown when clicking a marker or shape on a map showing the result of a Semantic MediaWiki query.
Default behavior
By default the name of the page is shown. If addition properties are queried, they are shown in a list below the title.
{{#ask:[[Category:Cities]]
| format=map
| ?Coordinates
| ?Located in
| ?Population
| ?Surface area
}}
Loading map...
{"format":"leaflet","minzoom":false,"maxzoom":false,"limit":50,"offset":0,"link":"all","sort":[""],"order":[],"headers":"show","mainlabel":"","intro":"","outro":"","searchlabel":"... further results","default":"","import-annotation":false,"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":false,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","showtitle":true,"hidenamespace":true,"template":"","userparam":"","activeicon":"","pagelabel":false,"ajaxcoordproperty":"","ajaxquery":"","locations":[{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Amsterdam\" title=\"Example data:Amsterdam\"\u003EAmsterdam\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=Netherlands\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Netherlands (page does not exist)\"\u003ENetherlands\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 872,680\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 219.32","title":"Amsterdam","link":"","lat":52.372761111111,"lon":4.8936027777778,"icon":""},{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Berlin\" title=\"Example data:Berlin\"\u003EBerlin\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=Germany\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Germany (page does not exist)\"\u003EGermany\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 3,769,495\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 891.1","title":"Berlin","link":"","lat":52.517036111111,"lon":13.388861111111,"icon":""},{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Brussels\" title=\"Example data:Brussels\"\u003EBrussels\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=Belgium\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Belgium (page does not exist)\"\u003EBelgium\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 1,208,542\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 162.4","title":"Brussels","link":"","lat":50.846558333333,"lon":4.3516972222222,"icon":""},{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Ghent\" title=\"Example data:Ghent\"\u003EGhent\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=Belgium\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Belgium (page does not exist)\"\u003EBelgium\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 260,341\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 156.18","title":"Ghent","link":"","lat":51.053827777778,"lon":3.7250111111111,"icon":""},{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Hamburg\" title=\"Example data:Hamburg\"\u003EHamburg\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=Germany\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Germany (page does not exist)\"\u003EGermany\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 1,822,445\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 755.22","title":"Hamburg","link":"","lat":53.543763888889,"lon":10.009913888889,"icon":""},{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Hannover\" title=\"Example data:Hannover\"\u003EHannover\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=Germany\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Germany (page does not exist)\"\u003EGermany\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 538,068\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 204.01","title":"Hannover","link":"","lat":52.374477777778,"lon":9.7385527777778,"icon":""},{"text":"\u003Cb\u003E\u003Ca href=\"/wiki/Example_data:London\" title=\"Example data:London\"\u003ELondon\u003C/a\u003E\u003C/b\u003E\u003Chr /\u003E\u003Ca href=\"/wiki/Property:Located_in\" title=\"Property:Located in\"\u003ELocated in\u003C/a\u003E: \u003Ca href=\"/w/index.php?title=United_Kingdom\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"United Kingdom (page does not exist)\"\u003EUnited Kingdom\u003C/a\u003E\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Population\" title=\"Property:Population\"\u003EPopulation\u003C/a\u003E: 9,787,426\u003Cbr /\u003E\u003Ca href=\"/wiki/Property:Surface_area\" title=\"Property:Surface area\"\u003ESurface area\u003C/a\u003E: 607","title":"London","link":"","lat":51.507322222222,"lon":-0.12764722222222,"icon":""}],"imageLayers":[]}
Parameters
Parameters relevant for customization:
template
showtitle
hidenamespace
userparam
For a full list of parameters you can use in the map formats, see Leaflet SMW queries and Google Maps SMW queries.
Templates
Templates allow you to fully customize what gets shown in the popups.
Templates are specified with the template
parameter, which takes the name of a template on your wiki. The showtitle
parameter is often useful here, as setting it to no
allows you to have full control over the popup content.
This example shows usage of multiple queried values via the "City Popup" template.
{{#ask:[[Category:Cities]]
| format=map
| ?Coordinates
| ?Located in
| ?Population
| ?Surface area
| template=City Popup
| showtitle=off
| hidenamespace=on
}}
The city '''[[{{{title}}}]]''' is located in [[{{{Located in}}}]].
It has a population of {{{Population}}} and surface area of {{{Surface area}}} km²
Loading map...
{"format":"leaflet","minzoom":false,"maxzoom":false,"limit":50,"offset":0,"link":"all","sort":[""],"order":[],"headers":"show","mainlabel":"","intro":"","outro":"","searchlabel":"... further results","default":"","import-annotation":false,"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":false,"cluster":false,"clustermaxzoom":20,"clusterzoomonclick":true,"clustermaxradius":80,"clusterspiderfy":true,"geojson":"","clicktarget":"","showtitle":false,"hidenamespace":true,"template":"City Popup","userparam":"","activeicon":"","pagelabel":false,"ajaxcoordproperty":"","ajaxquery":"","locations":[{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Amsterdam\" title=\"Example data:Amsterdam\"\u003EAmsterdam\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=Netherlands\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Netherlands (page does not exist)\"\u003ENetherlands\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 872,680 and surface area of 219.32 km\u00b2\n\u003C/p\u003E","title":"Amsterdam","link":"","lat":52.372761111111,"lon":4.8936027777778,"icon":""},{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Berlin\" title=\"Example data:Berlin\"\u003EBerlin\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=Germany\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Germany (page does not exist)\"\u003EGermany\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 3,769,495 and surface area of 891.1 km\u00b2\n\u003C/p\u003E","title":"Berlin","link":"","lat":52.517036111111,"lon":13.388861111111,"icon":""},{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Brussels\" title=\"Example data:Brussels\"\u003EBrussels\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=Belgium\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Belgium (page does not exist)\"\u003EBelgium\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 1,208,542 and surface area of 162.4 km\u00b2\n\u003C/p\u003E","title":"Brussels","link":"","lat":50.846558333333,"lon":4.3516972222222,"icon":""},{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Ghent\" title=\"Example data:Ghent\"\u003EGhent\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=Belgium\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Belgium (page does not exist)\"\u003EBelgium\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 260,341 and surface area of 156.18 km\u00b2\n\u003C/p\u003E","title":"Ghent","link":"","lat":51.053827777778,"lon":3.7250111111111,"icon":""},{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Hamburg\" title=\"Example data:Hamburg\"\u003EHamburg\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=Germany\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Germany (page does not exist)\"\u003EGermany\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 1,822,445 and surface area of 755.22 km\u00b2\n\u003C/p\u003E","title":"Hamburg","link":"","lat":53.543763888889,"lon":10.009913888889,"icon":""},{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Hannover\" title=\"Example data:Hannover\"\u003EHannover\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=Germany\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"Germany (page does not exist)\"\u003EGermany\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 538,068 and surface area of 204.01 km\u00b2\n\u003C/p\u003E","title":"Hannover","link":"","lat":52.374477777778,"lon":9.7385527777778,"icon":""},{"text":"\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:London\" title=\"Example data:London\"\u003ELondon\u003C/a\u003E\u003C/b\u003E is located in \u003Ca href=\"/w/index.php?title=United_Kingdom\u0026amp;action=edit\u0026amp;redlink=1\" class=\"new\" title=\"United Kingdom (page does not exist)\"\u003EUnited Kingdom\u003C/a\u003E.\n\u003C/p\u003E\u003Cp\u003EIt has a population of 9,787,426 and surface area of 607 km\u00b2\n\u003C/p\u003E","title":"London","link":"","lat":51.507322222222,"lon":-0.12764722222222,"icon":""}],"imageLayers":[]}
Template parameters
These parameters are available inside of templates:
title
- the title of the page or subject. Includes namespace unless hidenamespace=on
fulltitle
- the title of the page or subject, including namespace. Available since Maps 7.20
latitude
- latitude of the location as number (float)
longitude
- longitude of the location as number (float)
userparam
- the value of the userparam
parameter in the ask query
If additional properties are queried, they are also available as shown in the above example. Named parameters for additional properties are only available since Maps 7.19. Positional numeric parameters can be used instead, as shown below:
The city '''[[{{{title}}}]]''' is located in [[{{{1}}}]].
It has a population of {{{2}}} and surface area of {{{3}}} km²
Example: template with image
{{#ask:[[Category:Cities]] [[City image::+]]
| format=googlemaps
| ?Coordinates
| ?City image
| template=City Image Popup
| showtitle=off
| hidenamespace=on
}}
[[{{{City image}}}|200px]]
The city '''[[{{{fulltitle}}}|{{{title}}}]]'''
Loading map...
{"format":"googlemaps3","type":"ROADMAP","minzoom":false,"maxzoom":false,"types":["ROADMAP","SATELLITE","HYBRID","TERRAIN"],"limit":50,"offset":0,"link":"all","sort":[""],"order":[],"headers":"show","mainlabel":"","intro":"","outro":"","searchlabel":"... further results","default":"","import-annotation":false,"width":"auto","height":"350px","centre":false,"title":"","label":"","icon":"","lines":[],"polygons":[],"circles":[],"rectangles":[],"copycoords":false,"static":false,"visitedicon":"","wmsoverlay":false,"zoom":false,"layers":[],"controls":["pan","zoom","type","scale","streetview","rotate"],"zoomstyle":"DEFAULT","typestyle":"DEFAULT","autoinfowindows":false,"resizable":false,"kmlrezoom":false,"poi":true,"cluster":false,"clustergridsize":60,"clustermaxzoom":20,"clusterzoomonclick":true,"clusteraveragecenter":true,"clusterminsize":2,"imageoverlays":[],"kml":[],"gkml":[],"searchmarkers":"","fullscreen":false,"scrollwheelzoom":false,"showtitle":false,"hidenamespace":true,"template":"City Image Popup","userparam":"","activeicon":"","pagelabel":false,"ajaxcoordproperty":"","ajaxquery":"","locations":[{"text":"\u003Cp\u003E\u003Ca href=\"/wiki/File:Berlin.jpg\" class=\"image\"\u003E\u003Cimg alt=\"Berlin.jpg\" src=\"https://pro-wiki.s3.amazonaws.com/1644153356/thumb/f/f9/Berlin.jpg/200px-Berlin.jpg\" decoding=\"async\" width=\"200\" height=\"113\" srcset=\"https://pro-wiki.s3.amazonaws.com/1644153356/thumb/f/f9/Berlin.jpg/300px-Berlin.jpg 1.5x, https://pro-wiki.s3.amazonaws.com/1644153356/thumb/f/f9/Berlin.jpg/400px-Berlin.jpg 2x\" data-file-width=\"1280\" data-file-height=\"720\" /\u003E\u003C/a\u003E\u003C!--MW-PAGEIMAGES-CANDIDATE-0--\u003E\n\u003C/p\u003E\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Berlin\" title=\"Example data:Berlin\"\u003EBerlin\u003C/a\u003E\u003C/b\u003E\n\u003C/p\u003E","title":"Berlin","link":"","lat":52.517036111111,"lon":13.388861111111,"icon":""},{"text":"\u003Cp\u003E\u003Ca href=\"/wiki/File:Brussels.jpg\" class=\"image\"\u003E\u003Cimg alt=\"Brussels.jpg\" src=\"https://pro-wiki.s3.amazonaws.com/1644153356/thumb/7/7d/Brussels.jpg/200px-Brussels.jpg\" decoding=\"async\" width=\"200\" height=\"133\" srcset=\"https://pro-wiki.s3.amazonaws.com/1644153356/thumb/7/7d/Brussels.jpg/300px-Brussels.jpg 1.5x, https://pro-wiki.s3.amazonaws.com/1644153356/thumb/7/7d/Brussels.jpg/400px-Brussels.jpg 2x\" data-file-width=\"1920\" data-file-height=\"1280\" /\u003E\u003C/a\u003E\u003C!--MW-PAGEIMAGES-CANDIDATE-1--\u003E\n\u003C/p\u003E\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Brussels\" title=\"Example data:Brussels\"\u003EBrussels\u003C/a\u003E\u003C/b\u003E\n\u003C/p\u003E","title":"Brussels","link":"","lat":50.846558333333,"lon":4.3516972222222,"icon":""},{"text":"\u003Cp\u003E\u003Ca href=\"/wiki/File:Hamburg.jpg\" class=\"image\"\u003E\u003Cimg alt=\"Hamburg.jpg\" src=\"https://pro-wiki.s3.amazonaws.com/1644153356/thumb/5/5a/Hamburg.jpg/200px-Hamburg.jpg\" decoding=\"async\" width=\"200\" height=\"133\" srcset=\"https://pro-wiki.s3.amazonaws.com/1644153356/thumb/5/5a/Hamburg.jpg/300px-Hamburg.jpg 1.5x, https://pro-wiki.s3.amazonaws.com/1644153356/thumb/5/5a/Hamburg.jpg/400px-Hamburg.jpg 2x\" data-file-width=\"500\" data-file-height=\"333\" /\u003E\u003C/a\u003E\u003C!--MW-PAGEIMAGES-CANDIDATE-2--\u003E\n\u003C/p\u003E\u003Cp\u003EThe city \u003Cb\u003E\u003Ca href=\"/wiki/Example_data:Hamburg\" title=\"Example data:Hamburg\"\u003EHamburg\u003C/a\u003E\u003C/b\u003E\n\u003C/p\u003E","title":"Hamburg","link":"","lat":53.543763888889,"lon":10.009913888889,"icon":""}]}