reverted change from r9754 because it breaks applications that register an event before the marker is drawn (see #2258)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9764 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-10-26 20:41:56 +00:00
parent dbcab22339
commit 4e6c3b1f3e

View File

@@ -78,6 +78,7 @@ OpenLayers.Marker = OpenLayers.Class({
this.icon.offset = newIcon.offset; this.icon.offset = newIcon.offset;
this.icon.calculateOffset = newIcon.calculateOffset; this.icon.calculateOffset = newIcon.calculateOffset;
} }
this.events = new OpenLayers.Events(this, this.icon.imageDiv, null);
}, },
/** /**
@@ -93,6 +94,9 @@ OpenLayers.Marker = OpenLayers.Class({
this.map = null; this.map = null;
this.events.destroy();
this.events = null;
if (this.icon != null) { if (this.icon != null) {
this.icon.destroy(); this.icon.destroy();
this.icon = null; this.icon = null;
@@ -111,9 +115,6 @@ OpenLayers.Marker = OpenLayers.Class({
* location passed-in * location passed-in
*/ */
draw: function(px) { draw: function(px) {
if (!this.events) {
this.events = new OpenLayers.Events(this, this.icon.imageDiv, null);
}
return this.icon.draw(px); return this.icon.draw(px);
}, },
@@ -125,10 +126,6 @@ OpenLayers.Marker = OpenLayers.Class({
if (this.icon != null) { if (this.icon != null) {
this.icon.erase(); this.icon.erase();
} }
if (this.events) {
this.events.destroy();
this.events = null;
}
}, },
/** /**