--- a/src/main/resources/scripts/tracker.js Mon Aug 22 15:49:08 2011 -0400
+++ b/src/main/resources/scripts/tracker.js Mon Aug 22 15:50:09 2011 -0400
@@ -112,8 +112,8 @@
function pushCoordinates(position) {
coordinates[coordinates.length] =
- [ position.timestamp, position.coords.longitude, position.coords.latitude, position.coords.altitude, position.coords.speed ];
-// [ position.timestamp, position.coords.longitude, position.coords.latitude, position.coords.altitude ];
+// [ position.timestamp, position.coords.longitude, position.coords.latitude, position.coords.altitude, position.coords.speed ];
+ [ position.timestamp, position.coords.longitude, position.coords.latitude, position.coords.altitude ];
}
function pause() {
@@ -126,17 +126,18 @@
function getCoordinates() {
if (coordinates.length > 0 && !running) {
- var result = "";
+ var result = "[";
var i = 0;
while (i < coordinates.length) {
var position = coordinates[i];
var j = 1;
- result += position[0];
+ result += "[" + position[0];
while (j < position.length) result += "," + position[j++];
- result += " ";
+ result += "]";
i++;
+ if (i < coordinates.length) result += ",";
}
- return result;
+ return result + "]";
}
return null;
}