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