[OpenLayers-Commits] r1785 - in branches/openlayers/2.2/lib/OpenLayers: . Layer/WMS

commits at openlayers.org commits at openlayers.org
Wed Nov 8 14:07:33 EST 2006


Author: euzuro
Date: 2006-11-08 14:07:32 -0500 (Wed, 08 Nov 2006)
New Revision: 1785

Modified:
   branches/openlayers/2.2/lib/OpenLayers/Layer/WMS/Untiled.js
   branches/openlayers/2.2/lib/OpenLayers/Map.js
Log:
pulling up fixes for #366 #387 #392 from trunk so that we can release RC3

Modified: branches/openlayers/2.2/lib/OpenLayers/Layer/WMS/Untiled.js
===================================================================
--- branches/openlayers/2.2/lib/OpenLayers/Layer/WMS/Untiled.js	2006-11-08 19:03:30 UTC (rev 1784)
+++ branches/openlayers/2.2/lib/OpenLayers/Layer/WMS/Untiled.js	2006-11-08 19:07:32 UTC (rev 1785)
@@ -125,7 +125,7 @@
 
             //clear out the old tile 
             if (this.tile) {
-                OpenLayers.Util.clearArray(this.tile);
+                this.tile.clear();
             }
 
             //determine new tile bounds
@@ -150,6 +150,11 @@
             var ul = new OpenLayers.LonLat(tileBounds.left, tileBounds.top);
             var pos = this.map.getLayerPxFromLonLat(ul);
 
+            if ( this.tile && !this.tile.size.equals(tileSize)) {
+                this.tile.destroy();
+                this.tile = null;
+            }
+
             if (!this.tile) {
                 this.tile = new OpenLayers.Tile.Image(this, pos, tileBounds, 
                                                      url, tileSize);

Modified: branches/openlayers/2.2/lib/OpenLayers/Map.js
===================================================================
--- branches/openlayers/2.2/lib/OpenLayers/Map.js	2006-11-08 19:03:30 UTC (rev 1784)
+++ branches/openlayers/2.2/lib/OpenLayers/Map.js	2006-11-08 19:07:32 UTC (rev 1785)
@@ -786,8 +786,10 @@
         var originPx = this.getViewPortPxFromLonLat(this.layerContainerOrigin);
         var newPx = this.getViewPortPxFromLonLat(lonlat);
 
-        this.layerContainerDiv.style.left = (originPx.x - newPx.x) + "px";
-        this.layerContainerDiv.style.top  = (originPx.y - newPx.y) + "px";
+        if ((originPx != null) && (newPx != null)) {
+            this.layerContainerDiv.style.left = (originPx.x - newPx.x) + "px";
+            this.layerContainerDiv.style.top  = (originPx.y - newPx.y) + "px";
+        }
     },
 
     /**



More information about the Commits mailing list