google-polyline
Encodes and decodes Google's polyline format It's a forked version of google-polyline module with minor performance improvements and reversed order of coordinates: longitude, latitude (think x, y or easting, northing), which corresponds to position definition in GeoJSON spec.
npm
Install via$ npm install --save google-polyline
Usage
var polyline =
polyline > '_p~iF~ps|U_ulLnnqC_mqNvxq`@'
polyline > -1202 385 -12095 407 -126453 43252
API
polyline.encode(points)
returns string representing encoded polyline
points
is an array of points, each point is a 2 element array [longitude, latitude]
polyline.decode(string, factor)
returns array of point representing decoded polyline