]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - www/maps/maps/templates/javascript/routing.mako
Updated the provideTripAlternatives parameter to the newer provideRouteAlternatives.
[dead/census-tools.git] / www / maps / maps / templates / javascript / routing.mako
index 1c72efdbb9aa223defe075d646107dd9f9fd93a0..b3b1c919258830d7005268e231090175f121f3cd 100644 (file)
@@ -33,12 +33,12 @@ function routing_callback(result, status) {
   if (status == google.maps.DirectionsStatus.OK) {
     json_string += JSON.stringify(result);
 
-    for (var trip_idx = 0; trip_idx < result.trips.length; trip_idx++) {
-      num_routes = result.trips[trip_idx].routes.length;
-      if (num_routes > 1) {
-         alert("Unexpected number of routes (" +
-             result.trips.routes.length.toString() +
-             ") on trip number " + trip_idx.toString() + '.');
+    for (var route_idx = 0; route_idx < result.routes.length; route_idx++) {
+      var num_legs = result.routes[route_idx].legs.length;
+      if (num_legs > 1) {
+         alert("Unexpected number of legs (" +
+             result.routes.legs.length.toString() +
+             ") on route number " + route_idx.toString() + '.');
       }
     }
   }
@@ -108,7 +108,7 @@ function get_directions(pairs_to_skip) {
       var directions_request = {
        origin: producer_latlng,
        destination: consumer_latlng,
-       provideTripAlternatives: true,    
+       provideRouteAlternatives: true,   
        travelMode: google.maps.DirectionsTravelMode.DRIVING
       }