Ticket #1106: patch.diff
| File patch.diff, 2.2 kB (added by pspencer, 1 year ago) |
|---|
-
OpenLayers/Layer/Grid.js
old new 340 340 var startLon = tileoffsetlon; 341 341 342 342 var rowidx = 0; 343 344 var layerContainerDivLeft = parseInt(this.map.layerContainerDiv.style.left); 345 var layerContainerDivTop = parseInt(this.map.layerContainerDiv.style.top); 346 343 347 344 348 do { 345 349 var row = this.grid[rowidx++]; … … 360 364 tileoffsetlat + tilelat); 361 365 362 366 var x = tileoffsetx; 363 x -= parseInt(this.map.layerContainerDiv.style.left);367 x -= layerContainerDivLeft; 364 368 365 369 var y = tileoffsety; 366 y -= parseInt(this.map.layerContainerDiv.style.top);370 y -= layerContainerDivTop; 367 371 368 372 var px = new OpenLayers.Pixel(x, y); 369 373 var tile = row[colidx++]; … … 560 564 */ 561 565 shiftRow:function(prepend) { 562 566 var modelRowIndex = (prepend) ? 0 : (this.grid.length - 1); 563 var modelRow = this.grid[modelRowIndex]; 567 var grid = this.grid; 568 var modelRow = grid[modelRowIndex]; 564 569 565 570 var resolution = this.map.getResolution(); 566 571 var deltaY = (prepend) ? -this.tileSize.h : this.tileSize.h; 567 572 var deltaLat = resolution * -deltaY; 568 573 569 var row = (prepend) ? this.grid.pop() : this.grid.shift();574 var row = (prepend) ? grid.pop() : grid.shift(); 570 575 571 576 for (var i=0; i < modelRow.length; i++) { 572 577 var modelTile = modelRow[i]; … … 579 584 } 580 585 581 586 if (prepend) { 582 this.grid.unshift(row);587 grid.unshift(row); 583 588 } else { 584 this.grid.push(row);589 grid.push(row); 585 590 } 586 591 }, 587 592 … … 612 617 var tile = prepend ? this.grid[i].pop() : this.grid[i].shift(); 613 618 tile.moveTo(bounds, position); 614 619 if (prepend) { 615 this.grid[i].unshift(tile);620 row.unshift(tile); 616 621 } else { 617 this.grid[i].push(tile);622 row.push(tile); 618 623 } 619 624 } 620 625 },
