~ retrieve data from the server instead of the test file
authortgambet
Thu, 25 Aug 2011 16:30:01 -0400
changeset 97 40a45ab37edb
parent 96 31af8abd0fc7
child 98 862a94cf3a21
~ retrieve data from the server instead of the test file
src/main/resources/scripts/map.js
--- a/src/main/resources/scripts/map.js	Thu Aug 25 16:28:08 2011 -0400
+++ b/src/main/resources/scripts/map.js	Thu Aug 25 16:30:01 2011 -0400
@@ -69,11 +69,12 @@
 }
 
 function getWorkouts() {
-	return [{"activity": "http://dbpedia.org/resource/Running", "time": 123456789, "duration": 3600000, "distance": 12.000000, "json": "http://localhost:2719/user/jdoe/workout/4e5551a8b7607d33c418ce32.json", "gpx": "http://localhost:2719/user/jdoe/workout/4e5551a8b7607d33c418ce32.gpx" }, { "activity": "http://dbpedia.org/resource/Running", "time": 123456789, "duration": 3600000, "distance": 12.000000, "json": "http:localhost:2719/user/jdoe/workout/4e556fd5b7604c3c65eaed29.json", "gpx": "http://localhost:2719/user/jdoe/workout/4e556fd5b7604c3c65eaed29.gpx" }];
+	//return Util.requestJSON('http://localhost:2719/user/dummy@example.com/workouts');
+	return [ { "activity": "http://dbpedia.org/resource/Running", "date": 1312971214000, "duration": 6652, "distance": 12.000000, "json": "http://localhost:2719/user/dummy@example.com/workout/4e56a110ccf2406c3515bccb.json", "gpx": "http://localhost:2719/user/dummy@example.com/workout/4e56a110ccf2406c3515bccb.gpx" }, { "activity": "http://dbpedia.org/resource/Running", "date": 1309083594000, "duration": 14703, "distance": 12.000000, "json": "http://localhost:2719/user/dummy@example.com/workout/4e56a250ccf23d3128a27d0f.json", "gpx": "http://localhost:2719/user/dummy@example.com/workout/4e56a250ccf23d3128a27d0f.gpx" } ];
 }
 
 function getWorkout(uri) {
-	return Util.requestJSON('Jun-26-11.json');
+	return Util.requestJSON(uri);
 	//return Util.requestJSON(uri);
 }
 
@@ -107,8 +108,8 @@
 function showResult(workout) {
 	// update the map
 	OLMap.clearMap();
-	//OLMap.addTrail(workout.gpx, "red");
-	OLMap.addTrail("Jun-26-11.gpx", "red");
+	OLMap.addTrail(workout.gpx, "red");
+	//OLMap.addTrail("Jun-26-11.gpx", "red");
 	// fetch the json data containing the events
 	workout = getWorkout(workout.json);
 	// center the map on the events