- CodePrecision
Code precision to use for locations.
- PRECISIONS
All the available precisions.
- 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.
Code precision to use for locations.
All the available precisions.
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 an IOTA Area Code into a location.
Kind: global function
Returns: The location object.
Param | Description |
---|---|
iotaAreaCode | The IOTA Area Code to convert. |
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. |
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. |
Pad a partial IAC to the minimum full.
Kind: global function
Returns: The padded code.
Param | Description |
---|---|
iotaAreaCode | The area code to pad. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |