Configure maps with TileManger instances (and not the other way around)
This resolves issues with destroying caches on window unload, and makes cache sharing among maps less confusing to configure.
This commit is contained in:
@@ -579,6 +579,10 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
this, this.viewPortDiv, null, this.fallThrough,
|
||||
{includeXY: true}
|
||||
);
|
||||
|
||||
if (this.tileManager) {
|
||||
this.tileManager.addMap(this);
|
||||
}
|
||||
|
||||
// the layerContainerDiv is the one that holds all the layers
|
||||
id = this.id + "_OpenLayers_Container";
|
||||
@@ -778,6 +782,11 @@ OpenLayers.Map = OpenLayers.Class({
|
||||
this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);
|
||||
}
|
||||
this.viewPortDiv = null;
|
||||
|
||||
if (this.tileManager) {
|
||||
this.tileManager.removeMap(this);
|
||||
this.tileManager = null;
|
||||
}
|
||||
|
||||
if(this.eventListeners) {
|
||||
this.events.un(this.eventListeners);
|
||||
|
||||
Reference in New Issue
Block a user