Distance

From Mapping on MediaWiki

Jump to: navigation, search

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

Contents

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

[edit] Usage

[edit] Syntax

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

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

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

Personal tools
Namespaces
Variants
Actions
Navigation
manuals
services
extensions
data
Toolbox