[OpenLayers-Commits] r12307 -
sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Aug 31 14:56:35 EDT 2011
Author: erilem
Date: 2011-08-31 11:56:34 -0700 (Wed, 31 Aug 2011)
New Revision: 12307
Modified:
sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
Log:
deal with cases where transformDiv is called while the layer container div is moved from its original position (0,0)
Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js 2011-08-31 18:42:27 UTC (rev 12306)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js 2011-08-31 18:56:34 UTC (rev 12307)
@@ -350,9 +350,11 @@
var size = this.map.getSize();
var x = (size.w / 2) * (scale - 1);
var y = (size.h / 2) * (scale - 1);
+ var px = this.map.getLayerPxFromViewPortPx(
+ new OpenLayers.Pixel(x, y));
- this.div.style.left = -x + '%';
- this.div.style.top = -y + '%';
+ this.div.style.left = -px.x + '%';
+ this.div.style.top = -px.y + '%';
},
More information about the Commits
mailing list