Skip to content

Commit

Permalink
Merge pull request openlayers#839 from ahocevar/tilemanager-changelayer
Browse files Browse the repository at this point in the history
Process queue immediately when params change. r=@bartvde
  • Loading branch information
ahocevar committed Jan 16, 2013
2 parents 2a7547c + e23c18a commit 86c4257
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/OpenLayers/TileManager.js
Expand Up @@ -114,6 +114,7 @@ OpenLayers.TileManager = OpenLayers.Class({
map.events.on({
move: this.move,
zoomend: this.zoomEnd,
changelayer: this.changeLayer,
addlayer: this.addLayer,
preremovelayer: this.removeLayer,
scope: this
Expand Down Expand Up @@ -141,6 +142,7 @@ OpenLayers.TileManager = OpenLayers.Class({
map.events.un({
move: this.move,
zoomend: this.zoomEnd,
changelayer: this.changeLayer,
addlayer: this.addLayer,
preremovelayer: this.removeLayer,
scope: this
Expand Down Expand Up @@ -173,6 +175,19 @@ OpenLayers.TileManager = OpenLayers.Class({
this.updateTimeout(evt.object, this.zoomDelay);
},

/**
* Method: changeLayer
* Handles the map's changeLayer event
*
* Parameters:
* evt - {Object} Listener argument
*/
changeLayer: function(evt) {
if (evt.property === 'params') {
this.updateTimeout(evt.object, 0);
}
},

/**
* Method: addLayer
* Handles the map's addlayer event
Expand Down

0 comments on commit 86c4257

Please sign in to comment.