Coordinates
From Mapping on MediaWiki
You can use the #coordinates parser function to format coordinates, from and to any of the supported formats. This function is part of the Maps extension, so you should have Maps installed in order to use it.
Contents |
[edit] Usage
[edit] Syntax
{{#coordinates:{your coordinates}|format={your format}|directional={yes/no}}}
[edit] Parameters
This parser function supports use of so called 'default parameters'. This allows you to simply pass along values, without writing the parameter name= part. You can mix this notation together with using named parameters, but must at all times keep the default ones in the correct order. This order is location, format and directional.
| Parameter | Aliases | Default | Usage |
|---|---|---|---|
| location | - | required | The coordinates you want to format. |
| format | notation | configurable | The target format for the coordinates. |
| directional | - | configurable | Indicates if the coordinates should be outputted directional or not. Must be either yes or no. |
[edit] Examples
Coordinates in directional decimal degrees to the default target format.
{{#coordinates:55.7557860° N, 37.6176330° W}}
{{#coordinates:location=55.7557860° N, 37.6176330° W}}
All result into: 55° 45' 21" N, 37° 37' 3" W
Coordinates in non-directional floats to directional DMS.
{{#coordinates:55.7557860, -37.6176330|format=dms|directional=yes}}
{{#coordinates:55.7557860, -37.6176330|dms|yes}}
{{#coordinates:55.7557860, -37.6176330|directional=yes|dms}}
All result into: 55° 45' 21" N, 37° 37' 3" W

