Addressing @bartvde's review comments
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
*
|
||||
* Queueing avoids unnecessary image requests while changing zoom levels
|
||||
* quickly, and helps improve dragging performance on mobile devices that show
|
||||
* a lag in dragging when loading of new images start. <zoomDelay> and
|
||||
* a lag in dragging when loading of new images starts. <zoomDelay> and
|
||||
* <moveDelay> are the configuration options to control this behavior.
|
||||
*
|
||||
* Caching avoids setting the src on image elements for images that have already
|
||||
@@ -74,8 +74,8 @@ OpenLayers.TileManager = OpenLayers.Class({
|
||||
|
||||
/**
|
||||
* Property: tileCacheIndex
|
||||
* {Array<String>} URLs of cached tiles. First entry in each array is the
|
||||
* least recently used.
|
||||
* {Array(String)} URLs of cached tiles. First entry is the least recently
|
||||
* used.
|
||||
*/
|
||||
tileCacheIndex: null,
|
||||
|
||||
@@ -120,6 +120,13 @@ OpenLayers.TileManager = OpenLayers.Class({
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: removeMap
|
||||
* Unbinds this instance from a map
|
||||
*
|
||||
* Parameters:
|
||||
* map - {<OpenLayers.Map>}
|
||||
*/
|
||||
removeMap: function(map) {
|
||||
if (this._destroyed) {
|
||||
return;
|
||||
@@ -141,6 +148,7 @@ OpenLayers.TileManager = OpenLayers.Class({
|
||||
}
|
||||
delete this.tileQueue[map.id];
|
||||
delete this.tileQueueId[map.id];
|
||||
OpenLayers.Util.removeItem(this.maps, map);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -321,7 +329,7 @@ OpenLayers.TileManager = OpenLayers.Class({
|
||||
* Adds, updates, removes and fetches cache entries.
|
||||
*
|
||||
* Parameters:
|
||||
* evt - {Object} Listener argument of the tile's loadstart event
|
||||
* evt - {Object} Listener argument of the tile's beforeload event
|
||||
*/
|
||||
manageTileCache: function(evt) {
|
||||
var tile = evt.object;
|
||||
@@ -370,12 +378,15 @@ OpenLayers.TileManager = OpenLayers.Class({
|
||||
var layer = evt.object;
|
||||
var tileQueue = this.tileQueue[layer.map.id];
|
||||
for (var i=tileQueue.length-1; i>=0; --i) {
|
||||
if (tileQueue.layer === layer) {
|
||||
if (tileQueue[i].layer === layer) {
|
||||
tileQueue.splice(i, 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
for (var i=this.maps.length-1; i>=0; --i) {
|
||||
this.removeMap(this.maps[i]);
|
||||
|
||||
Reference in New Issue
Block a user