Skip to content

Instantly share code, notes, and snippets.

@dgngulcan
dgngulcan / polyline-decode.js
Last active June 27, 2018 17:41
Function to decode an encoded polyline for JavaScript
function decodePolyline(encoded) {
var points = []
var index = 0,
len = encoded.length;
var lat = 0,
lng = 0;
while (index < len) {
var b, shift = 0,
result = 0;