[OpenLayers-Commits] r12293 - sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Aug 31 04:44:34 EDT 2011


Author: erilem
Date: 2011-08-31 01:44:33 -0700 (Wed, 31 Aug 2011)
New Revision: 12293

Modified:
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
Log:
resposition the layer div after initGriddedTiles, this needs to be better understood

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js	2011-08-31 08:23:35 UTC (rev 12292)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js	2011-08-31 08:44:33 UTC (rev 12293)
@@ -264,6 +264,13 @@
                 //
                 if (forceReTile || !tilesBounds.containsBounds(bounds, true)) {
                     this.initGriddedTiles(bounds);
+                    // FIXME we need to reposition the layer div, for some
+                    // reason
+                    var size = this.map.getSize();
+                    var origin = this.map.getLayerPxFromViewPortPx(
+                        new OpenLayers.Pixel(size.w / 2, size.h / 2));
+                    this.div.style.left = -origin.x + '%';
+                    this.div.style.top = -origin.y + '%';
                 } else {
                     this.scheduleMoveGriddedTiles();
                 }
@@ -565,7 +572,7 @@
      * bounds - {<OpenLayers.Bounds>}
      */
     initGriddedTiles:function(bounds) {
-        
+
         // work out mininum number of rows and columns; this is the number of
         // tiles required to cover the viewport plus at least one for panning
 



More information about the Commits mailing list