google-maps-polyutil
v1.0.3
Published
Polyline simplification utitily ported from Google Android Map utils
Downloads
166
Maintainers
Readme
google-maps-polyutil
Google Maps PolyUtil utils, and its tests, ported from Java.
Installation
npm install --save google-maps-polyutil
Usage
var polyutil = require('google-maps-polyutil')
var locations = [{latitude: 51, longitude: 0}, {latitude: 51, longitude: 0}, {latitude: 52, longitude: 0}, {latitude: 52, longitude: 0}]
// Simplification
var simplifiedLocations = polyutil.simplify(locations)
// Encode to string
var polyline = polyline.encode(simplifiedLocations)
// Decode from string
var decodedLocations = polyutil.decode(polyline)