Class for reading and writing encoded polylines. Create a new instance with the OpenLayers.Format.EncodedPolyline constructor.
| OpenLayers. | Class for reading and writing encoded polylines. |
| Properties | |
| geometryType | {String} Geometry type to output. |
| Constructor | |
| OpenLayers. | Create a new parser for encoded polylines |
| Functions | |
| read | Deserialize an encoded polyline string and return a vector feature. |
| decode | Deserialize an encoded string and return an array of n-dimensional points. |
| write | Serialize a feature or array of features into a WKT string. |
| encode | Serialize an array of n-dimensional points and return an encoded string |
| encodeDeltas | Encode a list of n-dimensional points and return an encoded string |
| decodeDeltas | Decode a list of n-dimensional points from an encoded string |
| encodeFloats | Encode a list of floating point numbers and return an encoded string |
| decodeFloats | Decode a list of floating point numbers from an encoded string |
| encodeSignedIntegers | Encode a list of signed integers and return an encoded string |
| decodeSignedIntegers | Decode a list of signed integers from an encoded string |
| encodeUnsignedIntegers | Encode a list of unsigned integers and return an encoded string |
| decodeUnsignedIntegers | Decode a list of unsigned integers from an encoded string |
Create a new parser for encoded polylines
| options | {Object} An optional object whose properties will be set on this instance |
{OpenLayers.Format.EncodedPolyline} A new encoded polylines parser.
read: function( encoded )
Deserialize an encoded polyline string and return a vector feature.
| encoded | {String} An encoded polyline string |
{OpenLayers.Feature.Vector} A vector feature with a linestring.
decode: function( encoded, dims, opt_factor )
Deserialize an encoded string and return an array of n-dimensional points.
| encoded | {String} An encoded string |
| dims | {int} The dimension of the points that are returned |
{Array(Array(int))} An array containing n-dimensional arrays of coordinates.
encodeDeltas: function( numbers, dimension, opt_factor )
Encode a list of n-dimensional points and return an encoded string
Attention: This function will modify the passed array!
| numbers | {Array.<number>} A list of n-dimensional points. |
| dimension | {number} The dimension of the points in the list. |
| opt_factor | {number=} The factor by which the numbers will be multiplied. The remaining decimal places will get rounded away. |
{string} The encoded string.
decodeDeltas: function( encoded, dimension, opt_factor )
Decode a list of n-dimensional points from an encoded string
| encoded | {string} An encoded string. |
| dimension | {number} The dimension of the points in the encoded string. |
| opt_factor | {number=} The factor by which the resulting numbers will be divided. |
{Array.<number>} A list of n-dimensional points.
encodeFloats: function( numbers, opt_factor )
Encode a list of floating point numbers and return an encoded string
Attention: This function will modify the passed array!
| numbers | {Array.<number>} A list of floating point numbers. |
| opt_factor | {number=} The factor by which the numbers will be multiplied. The remaining decimal places will get rounded away. |
{string} The encoded string.
Deserialize an encoded polyline string and return a vector feature.
read: function( encoded )
Deserialize an encoded string and return an array of n-dimensional points.
decode: function( encoded, dims, opt_factor )
Serialize a feature or array of features into a WKT string.
write: function( features )
Serialize an array of n-dimensional points and return an encoded string
encode: function ( points, dims, opt_factor )
Encode a list of n-dimensional points and return an encoded string
encodeDeltas: function( numbers, dimension, opt_factor )
Decode a list of n-dimensional points from an encoded string
decodeDeltas: function( encoded, dimension, opt_factor )
Encode a list of floating point numbers and return an encoded string
encodeFloats: function( numbers, opt_factor )
Decode a list of floating point numbers from an encoded string
decodeFloats: function( encoded, opt_factor )
Encode a list of signed integers and return an encoded string
encodeSignedIntegers: function( numbers )
Decode a list of signed integers from an encoded string
decodeSignedIntegers: function( encoded )
Encode a list of unsigned integers and return an encoded string
encodeUnsignedIntegers: function( numbers )
Decode a list of unsigned integers from an encoded string
decodeUnsignedIntegers: function( encoded )