make OverviewMap.destroy more robust, r=fredj (closes #2430)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2010-01-22 07:35:22 +00:00
parent 8cbac47177
commit e562626f87

View File

@@ -143,16 +143,25 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
if (!this.mapDiv) { // we've already been destroyed
return;
}
this.handlers.click.destroy();
this.handlers.drag.destroy();
if (this.handlers.click) {
this.handlers.click.destroy();
}
if (this.handlers.drag) {
this.handlers.drag.destroy();
}
this.mapDiv.removeChild(this.extentRectangle);
this.extentRectangle = null;
this.rectEvents.destroy();
this.rectEvents = null;
this.ovmap.destroy();
this.ovmap = null;
if (this.rectEvents) {
this.rectEvents.destroy();
this.rectEvents = null;
}
if (this.ovmap) {
this.ovmap.destroy();
this.ovmap = null;
}
this.element.removeChild(this.mapDiv);
this.mapDiv = null;
@@ -171,7 +180,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
this.div.removeChild(this.minimizeDiv);
this.minimizeDiv = null;
}
this.map.events.un({
"moveend": this.update,
"changebaselayer": this.baseLayerDraw,