Distance

From Mapping on MediaWiki
Jump to: navigation, search
Distance
What:
Distance conversion
Min version:
0.6.2
Max version:
still supported
Function implementation:
Yes
Tag implementation:
Yes


You can use the #distance parser function to convert a distance using a certain supported unit to it's equivalent using another unit.

Compatibility

This function is part of the Maps extension, so you should have Maps installed in order to use it. This parser function was added in Maps 0.6.2.

Usage

Syntax

{{#coordinates:{your distance}|{target unit}}}

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. The order is location, location, unit.

Parameter Aliases Default Usage
distance - required The distance to convert to it's equivalent with a specified unit.
unit - configurable The unit the output the distance in.
decimals - configurable The maximum amount of fractional digits to use in the resulting value.

Examples

Miles to kilometres

{{#distance:42 miles|km}}

Results into: 67.59 km

{{#distance:distance=42 miles|km|decimals=3}}

Results into: 67.592 km

See also

This documentation page applies to all (Semantic) Maps versions from 0.7 to the most current version.
Other versions: 0.6.2 – 0.6.6      

Distance en 0.7