Skip to content

Commit

Permalink
Merge pull request #1018 from ahocevar/tilemanager-image-only
Browse files Browse the repository at this point in the history
UTFGrid examples broken because of TileManager. r=@bartvde
  • Loading branch information
ahocevar authored and Bart van den Eijnden committed Jul 9, 2013
1 parent c8d4105 commit d020e8f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lib/OpenLayers/TileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @requires OpenLayers/Util.js
* @requires OpenLayers/BaseTypes.js
* @requires OpenLayers/BaseTypes/Element.js
* @requires OpenLayers/Layer/Grid.js
* @requires OpenLayers/Tile/Image.js
*/

/**
Expand Down Expand Up @@ -300,13 +302,18 @@ OpenLayers.TileManager = OpenLayers.Class({
* evt - {Object} The listener argument
*/
addTile: function(evt) {
evt.tile.events.on({
beforedraw: this.queueTileDraw,
beforeload: this.manageTileCache,
loadend: this.addToCache,
unload: this.unloadTile,
scope: this
});
if (evt.tile instanceof OpenLayers.Tile.Image) {
evt.tile.events.on({
beforedraw: this.queueTileDraw,
beforeload: this.manageTileCache,
loadend: this.addToCache,
unload: this.unloadTile,
scope: this
});
} else {
// Layer has the wrong tile type, so don't handle it any longer
this.removeLayer({layer: evt.tile.layer});
}
},

/**
Expand Down

0 comments on commit d020e8f

Please sign in to comment.