Creating a map centered on the coordinate for your page, with nearby 'pages' shown

From Semantic MediaWiki Community Wiki
Jump to: navigation, search

Extension: Semantic Maps Description:

[edit] Problem

Draw a map centred on the coordinate for the current page, with nearby 'pages' also show.

[edit] Solution

For convenience we use the excellent Variables extension, and of course, the the Semantic Maps extension.

This code is suitable for putting in a template. It assumes the template is passed some 'geocode-able' fields, address, city, and country. I've used some default values for those fields below, so it will work without being invoked via a template call.

{{#vardefine:coord
  |{{#geocode:{{{address|Largo Gerolamo Gaslini, 5}}},{{{City|Genova}}},{{{country|Italy}}}|google}}
}}

{{#set: Has coordinate = {{#var:coord}} }}

<div style="float: right; width:45%">
{{#ask:
  [[Category: Laboratory]]
  |?Has coordinate 
  | format = map
  | center = {{#var:coord}}
  | zoom = 13
}}
</div>



Loading map...

[edit] TODO

  • Make the central point a different colour
Personal tools
Namespaces
Variants
Actions
Navigation
Add data
Help
Data export
Toolbox