Simplify moveGriddedTiles code.

Saves 3 unnecessary instances creation and 6 parseFloat calls.
This commit is contained in:
fredj
2012-01-26 09:09:05 +01:00
committed by ahocevar
parent ef85f43d21
commit 0e435b5483

View File

@@ -983,14 +983,14 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
var buffer = this.buffer || 1;
var scale = this.getResolutionScale();
while(true) {
var tlLayer = this.grid[0][0].position.clone();
tlLayer.x *= scale;
tlLayer.y *= scale;
tlLayer = tlLayer.add(parseInt(this.div.style.left, 10),
parseInt(this.div.style.top, 10));
var offsetX = parseInt(this.map.layerContainerDiv.style.left);
var offsetY = parseInt(this.map.layerContainerDiv.style.top);
var tlViewPort = tlLayer.add(offsetX, offsetY);
var tlViewPort = {
x: (this.grid[0][0].position.x * scale) +
parseInt(this.div.style.left, 10) +
parseInt(this.map.layerContainerDiv.style.left),
y: (this.grid[0][0].position.y * scale) +
parseInt(this.div.style.top, 10) +
parseInt(this.map.layerContainerDiv.style.top)
};
var tileSize = {
w: this.tileSize.w * scale,
h: this.tileSize.h * scale