Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Latest commit

 

History

History
211 lines (155 loc) · 5.66 KB

api.md

File metadata and controls

211 lines (155 loc) · 5.66 KB

Members

CodePrecision

Code precision to use for locations.

PRECISIONS

All the available precisions.

Functions

encode(latitude, longitude, precision)

Encode a location into an IOTA Area Code.

decode(iotaAreaCode)

Decode an IOTA Area Code into a location.

fromOpenLocationCode(openLocationCode)

Convert the Open Location Code to IOTA Area Code.

toOpenLocationCode(iotaAreaCode)

Convert the IOTA Area Code to Open Location Code.

padPartial(iotaAreaCode)

Pad a partial IAC to the minimum full.

extract(trytes)

Extract an IOTA Area Code from trytes.

decreasePrecision(iotaAreaCode)

Decrease the precision of an area code.

increasePrecision(iotaAreaCode)

Increase the precision of an area code.

setPrecision(iotaAreaCode, codePrecision)

Set the precision of an area code.

getPrecisionDimensions(codePrecision)

Get the display dimensions for a area code precision.

isValid(iotaAreaCode)

Is the IOTA Area Code valid.

isValidPartial(iotaAreaCode)

Is the IOTA Area Code a valid partial code.

CodePrecision

Code precision to use for locations.

Kind: global variable

PRECISIONS

All the available precisions.

Kind: global variable

encode(latitude, longitude, precision) ⇒

Encode a location into an IOTA Area Code.

Kind: global function
Returns: The IOTA Area Code for the location.

Param Description
latitude The latitude in signed decimal degrees. Values less than -90 will be clipped to -90, values over 90 will be clipped to 90.
longitude The longitude in signed decimal degrees. This will be normalised to the range -180 to 180.
precision The desired code length. If omitted, CodePrecision.NORMAL will be used. For precision CodePrecision.EXTRA is recommended.

decode(iotaAreaCode) ⇒

Decode an IOTA Area Code into a location.

Kind: global function
Returns: The location object.

Param Description
iotaAreaCode The IOTA Area Code to convert.

fromOpenLocationCode(openLocationCode) ⇒

Convert the Open Location Code to IOTA Area Code.

Kind: global function
Returns: The IOTA Area Code.

Param Description
openLocationCode The Open Location Code to convert.

toOpenLocationCode(iotaAreaCode) ⇒

Convert the IOTA Area Code to Open Location Code.

Kind: global function
Returns: The Open Location Code.

Param Description
iotaAreaCode The IOTA Area Code to convert.

padPartial(iotaAreaCode) ⇒

Pad a partial IAC to the minimum full.

Kind: global function
Returns: The padded code.

Param Description
iotaAreaCode The area code to pad.

extract(trytes) ⇒

Extract an IOTA Area Code from trytes.

Kind: global function
Returns: The IOTA Area Code if one could be extracted, or undefined.

Param Description
trytes The trytes from which to try and extract the IOTA Area Code.

decreasePrecision(iotaAreaCode) ⇒

Decrease the precision of an area code.

Kind: global function
Returns: The decreased precision area code.

Param Description
iotaAreaCode The IOTA Area Code to decrease the precision.

increasePrecision(iotaAreaCode) ⇒

Increase the precision of an area code.

Kind: global function
Returns: The increased precision area code.

Param Description
iotaAreaCode The IOTA Area Code to increase the precision.

setPrecision(iotaAreaCode, codePrecision) ⇒

Set the precision of an area code.

Kind: global function
Returns: The updated precision area code.

Param Description
iotaAreaCode The IOTA Area Code to set the precision.
codePrecision The new precision to set.

getPrecisionDimensions(codePrecision) ⇒

Get the display dimensions for a area code precision.

Kind: global function
Returns: The display dimensions for the code precision.

Param Description
codePrecision The precision of an area code.

isValid(iotaAreaCode) ⇒

Is the IOTA Area Code valid.

Kind: global function
Returns: True if the code is valid.

Param Description
iotaAreaCode The IOTA Area Code to validate.

isValidPartial(iotaAreaCode) ⇒

Is the IOTA Area Code a valid partial code.

Kind: global function
Returns: True if the code is a partial.

Param Description
iotaAreaCode The IOTA Area Code to validate.