JSPM

decode-google-map-polyline

1.0.1
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1121
    • Score
      100M100P100Q168885F
    • License ISC

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

    Package Exports

    • decode-google-map-polyline

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (decode-google-map-polyline) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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 ]