[Commits] r1636 - sandbox/cmoullet/ux/RoutingPanel/ux/widgets

commits at geoext.org commits at geoext.org
Wed Dec 30 07:54:55 CET 2009


Author: cmoullet
Date: 2009-12-30 07:54:55 +0100 (Wed, 30 Dec 2009)
New Revision: 1636

Modified:
   sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
Log:
Add route_type support (car, bicycle)

Modified: sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js	2009-12-30 06:45:48 UTC (rev 1635)
+++ sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js	2009-12-30 06:54:55 UTC (rev 1636)
@@ -33,6 +33,8 @@
     routingEndFeature: null,
     routingPointDrawControl: null,
     routingResultPanel: null,
+    // Car, foot, bicycle
+    route_type: 'car',
     cloudmadeKey: null,
 
     statusLabel: null,
@@ -321,7 +323,7 @@
             this.routingResultPanel.html = OpenLayers.i18n('Computation ongoing....');
             this.routingResultPanel.body.update(this.routingResultPanel.html);
             var newUrl = this.startLocationCombo.locationString + ',' + this.endLocationCombo.locationString;
-            newUrl = newUrl + "/car/shortest.js?lang=" + this.lang;
+            newUrl = newUrl + "/"+this.route_type+".js?lang=" + this.lang;
             this.proxy.url = "http://routes.cloudmade.com/" + this.cloudmadeKey + "/api/0.3/" + newUrl;
         }, this);
         this.routingLayer = new OpenLayers.Layer.Vector("Routing", {styleMap: this.vectorStyle});
@@ -392,7 +394,7 @@
             }
             if (this.routingStatus == '0') {
                 this.drawRoute();
-                this.routingResultPanel.html = OpenLayers.i18n('Total length: ') + Math.round(this.routingRouteSummary.total_distance/1000) + ' [km]';
+                this.routingResultPanel.html = OpenLayers.i18n('Total length: ') + Math.round(this.routingRouteSummary.total_distance / 1000) + ' [km]';
                 this.routingResultPanel.body.update(this.routingResultPanel.html);
             } else {
                 this.routingResultPanel.html = this.routingStatusMessage;



More information about the Commits mailing list