Race conditions with creation and destruction of OverviewMap. r=tschaub (closes #1320)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6010 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -199,8 +199,6 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
|
|
||||||
this.div.appendChild(this.element);
|
this.div.appendChild(this.element);
|
||||||
|
|
||||||
this.map.events.register('moveend', this, this.update);
|
|
||||||
|
|
||||||
// Optionally add min/max buttons if the control will go in the
|
// Optionally add min/max buttons if the control will go in the
|
||||||
// map viewport.
|
// map viewport.
|
||||||
if(!this.outsideViewport) {
|
if(!this.outsideViewport) {
|
||||||
@@ -259,6 +257,9 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
if(this.map.getExtent()) {
|
if(this.map.getExtent()) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.map.events.register('moveend', this, this.update);
|
||||||
|
|
||||||
return this.div;
|
return this.div;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -435,6 +436,11 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
var options = OpenLayers.Util.extend(
|
var options = OpenLayers.Util.extend(
|
||||||
{controls: [], maxResolution: 'auto'}, this.mapOptions);
|
{controls: [], maxResolution: 'auto'}, this.mapOptions);
|
||||||
this.ovmap = new OpenLayers.Map(this.mapDiv, options);
|
this.ovmap = new OpenLayers.Map(this.mapDiv, options);
|
||||||
|
|
||||||
|
// prevent ovmap from being destroyed when the page unloads, because
|
||||||
|
// the OverviewMap control has to do this (and does it).
|
||||||
|
OpenLayers.Event.stopObserving(window, 'unload', this.ovmap.unloadDestroy);
|
||||||
|
|
||||||
this.ovmap.addLayers(this.layers);
|
this.ovmap.addLayers(this.layers);
|
||||||
this.ovmap.zoomToMaxExtent();
|
this.ovmap.zoomToMaxExtent();
|
||||||
// check extent rectangle border width
|
// check extent rectangle border width
|
||||||
@@ -469,11 +475,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
null, true);
|
null, true);
|
||||||
this.rectEvents.register("mouseover", this, function(e) {
|
this.rectEvents.register("mouseover", this, function(e) {
|
||||||
if(!this.dragHandler.active && !this.map.dragging) {
|
if(!this.dragHandler.active && !this.map.dragging) {
|
||||||
// this click handler de/activation can be removed when
|
|
||||||
// ticket #1247 is addressed
|
|
||||||
this.clickHandler.deactivate();
|
|
||||||
this.dragHandler.activate();
|
this.dragHandler.activate();
|
||||||
this.clickHandler.activate();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.rectEvents.register("mouseout", this, function(e) {
|
this.rectEvents.register("mouseout", this, function(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user