Maps/Distance

From semantic-mediawiki.org
Extension "Maps"Maps/Distance
Maps extension
Overview
Installation and Configuration
Usage
Displaying maps
Customizing maps
Geocoding
Converting coordinates
SMW integration
Storing coordinates
Aggregating onto a map
On this page

Just like maps can parse and display coordinates in multiple formats, it can parse and display distances. You can convert between different distance formats using the #distance parser function.

Syntax

{{#distance:distance|unit=<optional unit>|decimals=<optional number>}}

Parameters

Parameter Default Usage
distance required The distance to convert
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

Examples

Basic syntax

{{#distance:42km}}

Result: 42,000 m

Specifying the unit and decimals

{{#distance:42km|unit=miles|decimals=1}}

Result: 26.1 miles