[Commits] r1912 - in sandbox/cmoullet/ux/RoutingPanel: examples tests/ux/widgets ux/widgets

commits at geoext.org commits at geoext.org
Tue Feb 23 12:38:56 CET 2010


Author: cmoullet
Date: 2010-02-23 12:38:56 +0100 (Tue, 23 Feb 2010)
New Revision: 1912

Modified:
   sandbox/cmoullet/ux/RoutingPanel/examples/RoutingPanelExample.html
   sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html
   sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
Log:
Fix Ext 3.0 problem with ScriptTagProxy

Modified: sandbox/cmoullet/ux/RoutingPanel/examples/RoutingPanelExample.html
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/examples/RoutingPanelExample.html	2010-02-23 08:29:15 UTC (rev 1911)
+++ sandbox/cmoullet/ux/RoutingPanel/examples/RoutingPanelExample.html	2010-02-23 11:38:56 UTC (rev 1912)
@@ -1,9 +1,10 @@
 <html>
 <head>
     <title>Routing Panel Example</title>
-    <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
-    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"/>
-    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css"/>
+    <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/adapter/ext/ext-base.js"></script>
+    <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/ext-all.js"></script>
+    <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/resources/css/ext-all.css" />
+    <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/examples/shared/examples.css" />    
     <script type="text/javascript" src="../../../trunk/openlayers/lib/OpenLayers.js"></script>
     <script type="text/javascript" src="../../../trunk/geoext/lib/GeoExt.js"></script>
     <script type="text/javascript"

Modified: sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html	2010-02-23 08:29:15 UTC (rev 1911)
+++ sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html	2010-02-23 11:38:56 UTC (rev 1912)
@@ -1,9 +1,10 @@
 <html>
 <head>
     <title>Routing Panel Test</title>
-    <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
-    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"/>
-    <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css"/>
+    <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/adapter/ext/ext-base.js"></script>
+    <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/ext-all.js"></script>
+    <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/resources/css/ext-all.css" />
+    <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/examples/shared/examples.css" /> 
     <script type="text/javascript" src="http://openlayers.org/api/2.8/OpenLayers.js"></script>
     <script type="text/javascript" src="../../../../../trunk/geoext/lib/GeoExt.js"></script>
     <script type="text/javascript"

Modified: sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js	2010-02-23 08:29:15 UTC (rev 1911)
+++ sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js	2010-02-23 11:38:56 UTC (rev 1912)
@@ -527,24 +527,6 @@
     afterRender: function() {
         GeoExt.ux.RoutingPanel.superclass.afterRender.call(this);
 
-        // Create empty proxy
-        this.proxy = new Ext.data.ScriptTagProxy({
-            url: 'to_be_replaced',
-            nocache: false
-        });
-        //http://routes.cloudmade.com/BC9A493B41014CAABB98F0471D759707/api/0.3/47.25976,9.58423,47.26117,9.59882/car/shortest.js
-        this.proxy.on(
-                'beforeload', function() {
-            this.fireEvent('beforeroutingcomputed', this);
-            this.routingResultPanel.html = OpenLayers.i18n('Computation ongoing....');
-            if (this.routingResultPanel.body) {
-                this.routingResultPanel.body.update(this.routingResultPanel.html);
-            }
-            var newUrl = this.startLocationCombo.locationString + ',' + this.endLocationCombo.locationString;
-            newUrl = newUrl + "/" + this.route_typeCloudmade + ".js?lang=" + this.lang;
-            this.proxy.url = "http://routes.cloudmade.com/" + this.cloudmadeKey + "/api/0.3/" + newUrl;
-        }, this);
-
         // Create routing layer
         if (!this.routingLayer) {
             this.routingLayer = new OpenLayers.Layer.Vector("Routing", {styleMap: this.vectorStyle});
@@ -704,6 +686,19 @@
      */
     getItinerary: function() {
         if (this.routingServiceType == 'cloudmade') {
+            
+            this.fireEvent('beforeroutingcomputed', this);
+            this.routingResultPanel.html = OpenLayers.i18n('Computation ongoing....');
+            if (this.routingResultPanel.body) {
+                this.routingResultPanel.body.update(this.routingResultPanel.html);
+            }
+            //http://routes.cloudmade.com/BC9A493B41014CAABB98F0471D759707/api/0.3/47.25976,9.58423,47.26117,9.59882/car/shortest.js
+            var newUrl = this.startLocationCombo.locationString + ',' + this.endLocationCombo.locationString;
+            newUrl = newUrl + "/" + this.route_typeCloudmade + ".js?lang=" + this.lang;
+            this.proxy = new Ext.data.ScriptTagProxy({
+                url: "http://routes.cloudmade.com/" + this.cloudmadeKey + "/api/0.3/" + newUrl,
+                nocache: false
+            });
             this.routingStore = new Ext.data.Store({
                 proxy: this.proxy,
                 reader: new Ext.data.JsonReader({
@@ -737,7 +732,7 @@
                     this.drawRoute();
                     var googleLinks = ''
                     if (this.showGoogleItinerary) {
-                        var googleLinks = '<a href="http://maps.google.com/maps?source=s_d&saddr='+this.startLocationCombo.locationString+'&daddr='+this.endLocationCombo.locationString+'&dirflg=a" target="new">'+OpenLayers.i18n('Google Itinerary by car')+'</a><br><a href="http://maps.google.com/maps?source=s_d&saddr='+this.startLocationCombo.locationString+'&daddr='+this.endLocationCombo.locationString+'&dirflg=r" target="new">'+OpenLayers.i18n('Google Itinerary by public transport')+'</a><br><a href="http://maps.google.com/maps?source=s_d&saddr='+this.startLocationCombo.locationString+'&daddr='+this.endLocationCombo.locationString+'&dirflg=w" target="new">'+OpenLayers.i18n('Google Itinerary on foot')+'</a>';
+                        var googleLinks = '<a href="http://maps.google.com/maps?source=s_d&saddr=' + this.startLocationCombo.locationString + '&daddr=' + this.endLocationCombo.locationString + '&dirflg=a" target="new">' + OpenLayers.i18n('Google Itinerary by car') + '</a><br><a href="http://maps.google.com/maps?source=s_d&saddr=' + this.startLocationCombo.locationString + '&daddr=' + this.endLocationCombo.locationString + '&dirflg=r" target="new">' + OpenLayers.i18n('Google Itinerary by public transport') + '</a><br><a href="http://maps.google.com/maps?source=s_d&saddr=' + this.startLocationCombo.locationString + '&daddr=' + this.endLocationCombo.locationString + '&dirflg=w" target="new">' + OpenLayers.i18n('Google Itinerary on foot') + '</a>';
                     }
                     this.routingResultPanel.html = OpenLayers.i18n('Total length: ') + Math.round(this.routingRouteSummaryCloudmade.total_distance / 1000) + ' [km]<br>' + googleLinks;
                     this.routingResultPanel.body.update(this.routingResultPanel.html);



More information about the Commits mailing list