[OpenLayers-Commits] r12273 - in
sandbox/camptocamp/clientzoom/lib/OpenLayers: . Tile
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Wed Aug 24 10:35:36 EDT 2011
Author: erilem
Date: 2011-08-24 07:35:35 -0700 (Wed, 24 Aug 2011)
New Revision: 12273
Modified:
sandbox/camptocamp/clientzoom/lib/OpenLayers/Map.js
sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js
sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js
Log:
%age-based tile positioning
Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Map.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Map.js 2011-08-24 14:23:59 UTC (rev 12272)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Map.js 2011-08-24 14:35:35 UTC (rev 12273)
@@ -545,6 +545,8 @@
// the layerContainerDiv is the one that holds all the layers
id = this.id + "_OpenLayers_Container";
this.layerContainerDiv = OpenLayers.Util.createDiv(id);
+ this.layerContainerDiv.style.width = '100px';
+ this.layerContainerDiv.style.height = '100px';
this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;
this.eventsDiv.appendChild(this.layerContainerDiv);
Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js 2011-08-24 14:23:59 UTC (rev 12272)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js 2011-08-24 14:35:35 UTC (rev 12273)
@@ -155,10 +155,10 @@
leftOffset = parseInt(containerStyle.left, 10),
topOffset = parseInt(containerStyle.top, 10),
style = backBuffer.style;
- style.left = (position.x - leftOffset) + "px";
- style.top = (position.y - topOffset) + "px";
- style.width = (this.size.w * ratio) + "px";
- style.height = (this.size.h * ratio) + "px";
+ style.left = (position.x - leftOffset) + "%";
+ style.top = (position.y - topOffset) + "%";
+ style.width = (this.size.w * ratio) + "%";
+ style.height = (this.size.h * ratio) + "%";
return backBuffer;
},
@@ -198,4 +198,4 @@
OpenLayers.Tile.prototype.destroy.apply(this, arguments);
}
-});
\ No newline at end of file
+});
Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js 2011-08-24 14:23:59 UTC (rev 12272)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js 2011-08-24 14:35:35 UTC (rev 12273)
@@ -187,10 +187,10 @@
*/
positionTile: function() {
var style = this.frame.style;
- style.left = this.position.x + "px";
- style.top = this.position.y + "px";
- style.width = this.size.w + "px";
- style.height = this.size.h + "px";
+ style.left = this.position.x + "%";
+ style.top = this.position.y + "%";
+ style.width = this.size.w + "%";
+ style.height = this.size.h + "%";
},
/**
More information about the Commits
mailing list