Added some small documentation
This commit is contained in:
@@ -288,6 +288,9 @@ function decodeRouteGeometry(encoded, precision) {
|
|||||||
do {
|
do {
|
||||||
b = encoded.charCodeAt(index++) - 63;
|
b = encoded.charCodeAt(index++) - 63;
|
||||||
result |= (b & 0x1f) << shift;
|
result |= (b & 0x1f) << shift;
|
||||||
|
shift += 5;
|
||||||
|
} while (b >= 0x20);
|
||||||
|
var dlat = ((result & 1) ? ~(result >> 1) : (result >> 1));
|
||||||
lat += dlat;
|
lat += dlat;
|
||||||
shift = 0;
|
shift = 0;
|
||||||
result = 0;
|
result = 0;
|
||||||
@@ -296,6 +299,9 @@ function createShortLink(str){
|
|||||||
result |= (b & 0x1f) << shift;
|
result |= (b & 0x1f) << shift;
|
||||||
shift += 5;
|
shift += 5;
|
||||||
} while (b >= 0x20);
|
} while (b >= 0x20);
|
||||||
|
var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
|
||||||
|
lng += dlng;
|
||||||
|
array.push([lat * precision, lng * precision]);
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user