Added some small documentation

This commit is contained in:
Pascal Neis
2011-06-30 11:37:31 +00:00
parent e7a4070339
commit eca141eebc
+6
View File
@@ -288,6 +288,9 @@ function decodeRouteGeometry(encoded, precision) {
do {
b = encoded.charCodeAt(index++) - 63;
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
var dlat = ((result & 1) ? ~(result >> 1) : (result >> 1));
lat += dlat;
shift = 0;
result = 0;
@@ -296,6 +299,9 @@ function createShortLink(str){
result |= (b & 0x1f) << shift;
shift += 5;
} while (b >= 0x20);
var dlng = ((result & 1) ? ~(result >> 1) : (result >> 1));
lng += dlng;
array.push([lat * precision, lng * precision]);
}
return array;
}