Clear queue in more appropriate places.
This commit is contained in:
@@ -228,6 +228,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
removeMap: function(map) {
|
removeMap: function(map) {
|
||||||
if (this.moveTimerId !== null) {
|
if (this.moveTimerId !== null) {
|
||||||
window.clearTimeout(this.moveTimerId);
|
window.clearTimeout(this.moveTimerId);
|
||||||
|
this.moveTimerId = null;
|
||||||
}
|
}
|
||||||
this.clearTileQueue();
|
this.clearTileQueue();
|
||||||
if(this.backBufferTimerId !== null) {
|
if(this.backBufferTimerId !== null) {
|
||||||
@@ -325,10 +326,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
// if grid is empty or zoom has changed, we *must* re-tile
|
// if grid is empty or zoom has changed, we *must* re-tile
|
||||||
var forceReTile = !this.grid.length || zoomChanged;
|
var forceReTile = !this.grid.length || zoomChanged;
|
||||||
|
|
||||||
if (forceReTile) {
|
|
||||||
this.clearTileQueue();
|
|
||||||
}
|
|
||||||
|
|
||||||
// total bounds of the tiles
|
// total bounds of the tiles
|
||||||
var tilesBounds = this.getTilesBounds();
|
var tilesBounds = this.getTilesBounds();
|
||||||
|
|
||||||
@@ -436,8 +433,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
if (this.tileQueue.length === 0) {
|
if (this.tileQueue.length === 0) {
|
||||||
this.clearTileQueue();
|
this.clearTileQueue();
|
||||||
} else {
|
} else {
|
||||||
var tile = this.tileQueue.shift();
|
this.tileQueue.shift().draw(true);
|
||||||
tile.draw(true);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -704,6 +700,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
* bounds - {<OpenLayers.Bounds>}
|
* bounds - {<OpenLayers.Bounds>}
|
||||||
*/
|
*/
|
||||||
initSingleTile: function(bounds) {
|
initSingleTile: function(bounds) {
|
||||||
|
this.clearTileQueue();
|
||||||
|
|
||||||
//determine new tile bounds
|
//determine new tile bounds
|
||||||
var center = bounds.getCenterLonLat();
|
var center = bounds.getCenterLonLat();
|
||||||
@@ -815,6 +812,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
|||||||
* bounds - {<OpenLayers.Bounds>}
|
* bounds - {<OpenLayers.Bounds>}
|
||||||
*/
|
*/
|
||||||
initGriddedTiles:function(bounds) {
|
initGriddedTiles:function(bounds) {
|
||||||
|
this.clearTileQueue();
|
||||||
|
|
||||||
// work out mininum number of rows and columns; this is the number of
|
// work out mininum number of rows and columns; this is the number of
|
||||||
// tiles required to cover the viewport plus at least one for panning
|
// tiles required to cover the viewport plus at least one for panning
|
||||||
|
|||||||
Reference in New Issue
Block a user