special precautions must be taken in updateBackBufferData
This commit is contained in:
@@ -490,10 +490,14 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
updateBackBufferData: function() {
|
updateBackBufferData: function() {
|
||||||
// updateBackBufferData is called asynchronously when tiles are
|
// updateBackBufferData is called asynchronously when tiles are
|
||||||
// received, so we need to check that the map is still there
|
// received, so we need to check that the map is still there
|
||||||
if (this.map) {
|
if(this.map) {
|
||||||
var resolution = this.map.getResolution();
|
var resolution = this.map.getResolution();
|
||||||
this.backBufferData.resolution = this.getServerResolution(resolution);
|
this.backBufferData.resolution = this.getServerResolution(resolution);
|
||||||
var topLeftTile = this.grid[0][0];
|
}
|
||||||
|
// the top left tile might have been destroyed, so its bounds
|
||||||
|
// property may be null
|
||||||
|
var topLeftTile = this.grid[0][0];
|
||||||
|
if(topLeftTile.bounds) {
|
||||||
this.backBufferData.lonlat = {lon: topLeftTile.bounds.left,
|
this.backBufferData.lonlat = {lon: topLeftTile.bounds.left,
|
||||||
lat: topLeftTile.bounds.top};
|
lat: topLeftTile.bounds.top};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user