Namespace: flexiblePolyline

H.util.flexiblePolyline

This namespace contains methods for encoding and decoding the Flexible Polyline.

Methods

H.util.flexiblePolyline.decode (encodedPolyline)H.util.flexiblePolyline.Data static

Decodes the specified encoded Flexible Polyline string.

Name Type Description
encodedPolyline string

The encoded string.

Throws:

If the specified data has an invalid encoding.

Type
Error
Returns:
Type Description
H.util.flexiblePolyline.Data

H.util.flexiblePolyline.encode (data)string static

Encodes the specified number sequence as a Flexible Polyline.

Name Type Description
data H.util.flexiblePolyline.Data
Returns:
Type Description
string The encoded polyline

Type Definitions

H.util.flexiblePolyline.Data Object

This object describes a structure of the object accepted by the "encode" and return by the "decode" methods.

Properties:
Name Type Argument Description
polyline Array.<Array.<number>>

The sequence of [lat, lng] or [lat, lng, {third_dim}].

precision number <optional>

How many decimal digits of precision to store the latitude and longitude, default is 5.

thirdDim number <optional>

Type of the third dimension if present in the input.

thirdDimPrecision number <optional>

How many decimal digits of precision to store the third dimension.