Geodistance function

From Maps for MediaWiki

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,652.98 m

Specifying the unit and decimals


Result: 650 km

Using coordinates

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

Result: 6,385 km