X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=www%2Fmaps%2Fmaps%2Ftemplates%2Fjavascript%2Frouting.mako;h=49e10b74d21274cbd867f153e7560053b0401272;hb=01fd7fbb997f6e7017c92005702f4b80c9dbafb1;hp=20103a5fb24203fc984abba01ae476535664b351;hpb=5485afbd4da2182072ef9756c65137729bf1eee5;p=dead%2Fcensus-tools.git diff --git a/www/maps/maps/templates/javascript/routing.mako b/www/maps/maps/templates/javascript/routing.mako index 20103a5..49e10b7 100644 --- a/www/maps/maps/templates/javascript/routing.mako +++ b/www/maps/maps/templates/javascript/routing.mako @@ -1,22 +1,3 @@ -function post_directions_result(url, directions_result) { - /* 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, - and submit it. */ - var new_form = document.createElement("form"); - 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("type", "hidden"); - new_input.setAttribute("value", directions_result); - new_form.appendChild(new_input); - document.body.appendChild(new_form); - new_form.submit(); -} - - var producers = new Array(); var consumers = new Array(); @@ -68,7 +49,8 @@ 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) + mu = new MapUtils(); + mu.post_data('/directions/json_to_kml', json_string); } else { // Continue the array.