[OpenLayers-Dev] [itr@pointcarbon.com: [OpenLayers-Trac] Error in Marker.js]

XinGang Li slinavlee at gmail.com
Mon Oct 26 23:15:19 EDT 2009


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: slinavlee at gmail.com
Blog:   avlee.cnblogs.com
Site:    www.mapboost.org


On Tue, Oct 27, 2009 at 4:42 AM, Andreas Hocevar <ahocevar at 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 <itr at pointcarbon.com> -----
> >
> > From: Ian Trotter <itr at pointcarbon.com>
> > To: "trac at openlayers.org" <trac at openlayers.org>
> > Date: Mon, 26 Oct 2009 17:31:12 +0100
> > Subject: [OpenLayers-Trac] Error in Marker.js
> > Reply-To: dev at 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
> > Trac at 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 at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20091027/bd77107f/attachment.html


More information about the Dev mailing list