Simplify moveGriddedTiles code.
Saves 3 unnecessary instances creation and 6 parseFloat calls.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user