If attach events to the marker element really can cause performance problems, we can create the events object in the marker's constructor without attach the events to the DOM element, and than attach the events to the DOM element in the draw method.
initialize: function(lonlat, icon) { .... this.events = new OpenLayers.Events(this, null, null); }, draw: function(px) { var div = this.icon.draw(px); this.events.attachToElement(div); return div; }, BTW: May be need allow events to fall through, otherwise, the map element can not capture the mouseup event when using the box handler and release mouse on the marker element. Li XinGang EMail: slinav...@gmail.com Blog: avlee.cnblogs.com Site: www.mapboost.org On Tue, Oct 27, 2009 at 4:42 AM, Andreas Hocevar <ahoce...@opengeo.org>wrote: > Hi, > > reverted that change due to lack of a better solution. > > Regards, > Andreas. > > Christopher Schmidt wrote: > > Sent to the wrong list. > > > > ----- Forwarded message from Ian Trotter <i...@pointcarbon.com> ----- > > > > From: Ian Trotter <i...@pointcarbon.com> > > To: "t...@openlayers.org" <t...@openlayers.org> > > Date: Mon, 26 Oct 2009 17:31:12 +0100 > > Subject: [OpenLayers-Trac] Error in Marker.js > > Reply-To: dev@openlayers.org > > > > Hi, > > > > The resolution of http://trac.openlayers.org/ticket/2258 seems to have > introduced a bug with the event-handling for markers. It seems that the > Marker.events property is no longer being set when a marker is initialised. > > > > As an example, you can see that > http://openlayers.org/dev/examples/georss-markers.html no longer shows the > markers, with an error message that marker.events is null. > > > > - Ian > > > > > > _______________________________________________ > > Trac mailing list > > t...@openlayers.org > > http://openlayers.org/mailman/listinfo/trac > > > > > > ----- End forwarded message ----- > > > > > > > -- > Andreas Hocevar > OpenGeo - http://opengeo.org/ > Expert service straight from the developers. > > _______________________________________________ > Dev mailing list > Dev@openlayers.org > http://openlayers.org/mailman/listinfo/dev >
_______________________________________________ Dev mailing list Dev@openlayers.org http://openlayers.org/mailman/listinfo/dev