Customizing query results: Difference between revisions
From Maps for MediaWiki
Jump to:navigation, search
mNo edit summary |
m (Jeroen De Dauw moved page Queries with templates to Customizing query results) |
(No difference)
|
Revision as of 07:32, 15 May 2020
As parts of its integration with Semantic MediaWiki, Maps adds several mapping result formats. These formats all support the template
parameter, which can be used to customize the information shown when clicking a marker or shape.
Default display without template
By default, the information shown
{{#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":[]}
Using a template
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 }}
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":[]}
Maps documentation | ||
---|---|---|
For admins | ||
Leaflet Maps | ||
Google Maps | ||
Structured data | ||
Parser functions | ||
Get your wiki today via ProWiki: Managed MediaWiki hosting by Professional.Wiki, the maintainer of Maps.
|
I created Maps and this documentation in my free time. If you are finding either useful, please consider supporting me.