diff --git a/lib/OpenLayers/Map.js b/lib/OpenLayers/Map.js index faf21fb6ca..8a76fb028b 100644 --- a/lib/OpenLayers/Map.js +++ b/lib/OpenLayers/Map.js @@ -10,7 +10,6 @@ * @requires OpenLayers/Events.js * @requires OpenLayers/Tween.js * @requires OpenLayers/Projection.js - * @requires OpenLayers/TileManager.js */ /** @@ -376,11 +375,12 @@ OpenLayers.Map = OpenLayers.Class({ /** * APIProperty: tileManager - * {|Object} By default the map will use the TileManager - * to queue image requests and to cache tile image elements. To create a - * map without a TileManager configure the map with tileManager: null. - * To create a TileManager with non-default options, supply the options - * instead or alternatively supply an instance of {}. + * {|Object} By default, and if the build contains + * TileManager.js, the map will use the TileManager to queue image requests + * and to cache tile image elements. To create a map without a TileManager + * configure the map with tileManager: null. To create a TileManager with + * non-default options, supply the options instead or alternatively supply + * an instance of {}. */ /** @@ -615,7 +615,8 @@ OpenLayers.Map = OpenLayers.Class({ ); if (this.tileManager !== null) { - if (!(this.tileManager instanceof OpenLayers.TileManager)) { + if (OpenLayers.TileManager && + !(this.tileManager instanceof OpenLayers.TileManager)) { this.tileManager = new OpenLayers.TileManager(this.tileManager); } this.tileManager.addMap(this); diff --git a/lib/OpenLayers/TileManager.js b/lib/OpenLayers/TileManager.js index a492b718f3..6904b15624 100644 --- a/lib/OpenLayers/TileManager.js +++ b/lib/OpenLayers/TileManager.js @@ -5,7 +5,6 @@ /** - * @requires OpenLayers/Layer/Grid.js * @requires OpenLayers/Util.js * @requires OpenLayers/BaseTypes.js * @requires OpenLayers/BaseTypes/Element.js @@ -117,7 +116,7 @@ OpenLayers.TileManager = OpenLayers.Class({ * map - {} */ addMap: function(map) { - if (this._destroyed) { + if (this._destroyed || !OpenLayers.Layer.Grid) { return; } this.maps.push(map); @@ -143,7 +142,7 @@ OpenLayers.TileManager = OpenLayers.Class({ * map - {} */ removeMap: function(map) { - if (this._destroyed) { + if (this._destroyed || !OpenLayers.Layer.Grid) { return; } window.clearTimeout(this.tileQueueId[map.id]);