[fusion-commits] r1999 - trunk/lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Dec 1 01:01:10 EST 2009


Author: liuar
Date: 2009-12-01 01:01:10 -0500 (Tue, 01 Dec 2009)
New Revision: 1999

Modified:
   trunk/lib/Map.js
Log:
Fixed ticket http://trac.osgeo.org/fusion/ticket/342
Refresh caused one error on the map with consumer layers
The error is an exception thrown at this.aMaps[i].oLayerOL.params in map.js, and it's because commercial layers don't have params. So before setting values to params we need to check if the layer support params or not. 

Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js	2009-11-30 22:28:16 UTC (rev 1998)
+++ trunk/lib/Map.js	2009-12-01 06:01:10 UTC (rev 1999)
@@ -616,9 +616,11 @@
 
     redraw: function() {
       for (var i=0; i<this.aMaps.length; i++ ) {
-        this.aMaps[i].oLayerOL.params.ts = (new Date()).getTime();
-        //mergeNewParams calls redraw on the layer, which will get called below anyway
-        //this.aMaps[i].oLayerOL.mergeNewParams({ts : (new Date()).getTime()});
+	    if(this.aMaps[i].oLayerOL.params){
+            this.aMaps[i].oLayerOL.params.ts = (new Date()).getTime();
+            //mergeNewParams calls redraw on the layer, which will get called below anyway
+            //this.aMaps[i].oLayerOL.mergeNewParams({ts : (new Date()).getTime()});
+		}
       }
       this.oMapOL.setCenter(this.oMapOL.getCenter(), this.oMapOL.getZoom(), false, true);
     },



More information about the fusion-commits mailing list