decode-google-map-polyline

A library to decode google map polyline using google official library.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
decode-google-map-polyline
1.0.16 years ago6 years agoMinified + gzip package size for decode-google-map-polyline in KB

Readme

decode-google-map-polyline
A tool for decoding google map compressed polyline using official map utility. See more: https://developers.google.com/maps/documentation/utilities/polylinealgorithm

Install

npm install --save decode-google-map-polyline

Example

const decodePolyline = require('decode-google-map-polyline');
var polyline = 'neuaEejkbUEGc@j@PXl@p@P\\a@f@GHyDtEgC`DoCfDzHbQp@rAbH`JdBtBrCjDn@p@dDbDfIvHfD~CrK~Jo@z@uCrDmJnL}^ld@mVjZmQrTgArAFJ';
console.log(decodePolyline(polyline));
Bash output:
[ { lat: -31.89864, lng: 115.89811 },
  { lat: -31.89861, lng: 115.89815 },
  { lat: -31.89843, lng: 115.89793 },
  { lat: -31.89852, lng: 115.8978 }, 
  ... more items ]