Maps/Distance

From semantic-mediawiki.org
Maps extension
Overview
Installation and Configuration
Usage
Displaying maps
Customizing maps
    ↪  Leaflet  •  Google Maps
Displaying GeoJSON
Geocoding
Converting coordinates
SMW integration
Storing coordinates
Aggregating onto a map
    ↪  Leaflet  •  Google Maps
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[edit]

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

Parameters[edit]

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[edit]

Basic syntax[edit]

{{#distance:42km}}

Result: 42,000 m

Specifying the unit and decimals[edit]

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

Result: 26.1 miles