Semantic Maps examples/Using templates (queries)

From semantic-mediawiki.org
< Category:Semantic Maps examples
Semantic Maps examplesSemantic Maps examples/Using templates (queries)

Using templates with the Maps extension works a bit different compared to "usual" SemanticMediaWiki templates. In usual templates the parameter {{{1}}} usually represents the page title. In templates used with Maps {{{1}}} represents the property that comes after the ?Has coordinates property. See the second example for an example.

If one wants to printout the page title within the template one can use {{{title}}}. To print out the coordinates one can use {{{latitude}}} and {{{longitude}}}.

First example[edit]

Adding a link to maps.google.com by using a template. See template "Google Maps Link".

Using the template parameter might be broken in some versions of the Extension "Maps" extension.1
{{#ask:
 [[Category:Locations]]
 |?Has coordinates
 |format=leaflet
 |template=Google Maps Link
}}
Loading map...

Second example[edit]

Custom formatting of the queried properties using the template and showtitle parameters. See used template "Location Popup".

{{#ask:
 [[Category:Locations]]
 |?Has coordinates
 |?Has location type 
 |?Located in
 |format=leaflet
 |template=Location Popup
 |showtitle=off
 |icon=Blue_marker.png
}}

In this example the property Has location type can be printed out in the template with {{{1}}}. The property Located in can be printed out in the template with {{{2}}}.

Loading map...

References

  1. ^  Maps: GitHub issue gh:m:248