]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Renamed the post_directions_result() function to post_data().
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 19 Feb 2010 14:03:41 +0000 (09:03 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 19 Feb 2010 14:03:41 +0000 (09:03 -0500)
www/maps/maps/controllers/directions.py
www/maps/maps/templates/javascript/routing.mako

index eabdfd49da36c155787b72a96ba986ee19ee7e1a..4c765a3dad217bc4e428eb73122a4a073fe5bae3 100644 (file)
@@ -73,7 +73,7 @@ class DirectionsController(BaseController):
 
     
     def json_to_kml(self):
-        directions_array = json.loads(request.POST['directions_result'])
+        directions_array = json.loads(request.POST['data'])
         placemarks = []
         for result in directions_array:
             placemarks += self.directions_result_to_placemarks(result)
index 20103a5fb24203fc984abba01ae476535664b351..94c280e07b6d1036fbdbed4736af50f5c7cf6551 100644 (file)
@@ -1,4 +1,4 @@
-function post_directions_result(url, directions_result) {
+function post_data(url, data) {
   /* Create a new form, and add it to the DOM. Then, create a hidden
      input control as a child of the form which contains the data that
      we'd like to post. Finally, add the form to the document's body,
@@ -7,10 +7,10 @@ function post_directions_result(url, directions_result) {
   new_form.method = "post";
   new_form.action = url;
   var new_input = document.createElement("input");
-  new_input.setAttribute("id", "directions_result");
-  new_input.setAttribute("name", "directions_result");
+  new_input.setAttribute("id", "data");
+  new_input.setAttribute("name", "data");
   new_input.setAttribute("type", "hidden");
-  new_input.setAttribute("value", directions_result);
+  new_input.setAttribute("value", data);
   new_form.appendChild(new_input);
   document.body.appendChild(new_form);
   new_form.submit();
@@ -68,7 +68,7 @@ function routing_callback(result, status) {
   if (completed_requests == total_requests) {
     // Close the array, and do something with the result.
     json_string += ']';
-    post_directions_result('/directions/json_to_kml', json_string)
+    post_data('/directions/json_to_kml', json_string)
   }
   else {
     // Continue the array.