Geodistance function

From Maps for MediaWiki
Revision as of 22:09, 7 May 2020 by Jeroen De Dauw (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Maps can calculate the distance between two locations. This is done via the #geodistance parser function, which has a similar format to, and should not be confused with, the #distance parser function


 <first location>
 |<second location>
 |unit=<optional unit>
 |decimals=<optional number>


Parameter Default Description
location1 required Address or coordinates of the first location
location2 required Address or coordinates of the second location
unit m (changeable in wiki config with egMapsDistanceUnit) The unit to display the distance in. Supported units can be found and changed in the wiki config with egMapsDistanceUnits
decimals 2 (changeable in wiki config with egMapsDistanceDecimals) The amount of decimals to show the distance in. Must be a positive integer


Basic syntax


Result: 649,361.22 m

Specifying the unit and decimals


Result: 649 km

Using coordinates

{{#geodistance:52.5200° N, 13.4050° E|40.7128° N, 74.0060° W|unit=km}}

Result: 6,385 km