[OpenLayers-Dev] event propagation

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Mon Jan 29 03:35:19 EST 2007


The actual difference is the mouseup line instead of the onclick line to
stop the event, sorry for the confusion.

btn.onmouseup = this.doubleClick.bindAsEventListener(btn);

I have opened up a ticket and will add a patch:

http://trac.openlayers.org/ticket/484

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Bart van den Eijnden OSGIS <bartvde at osgis.nl>
Naar: dev at openlayers.org <dev at openlayers.org>
Onderwerp: Re: [OpenLayers-Dev] event propagation
Datum: 29/01/07 06:25

> Okay, after some more work on this problem I found out this is caused by a
> conflict between _addButton of PanZoom.js and _addButton of
MouseToolbar.js.
> They use different events tied to the buttons.
> 
> I could fix my problem by changing _addButton in PanZoom.js to mimick the
> behaviour of _addButton in MouseToolbar.js:
> 
> btn.onmousedown = this.buttonDown.bindAsEventListener(btn);
> btn.onmouseup = this.doubleClick.bindAsEventListener(btn);
> btn.ondblclick  = this.doubleClick.bindAsEventListener(btn);
> //btn.onclick  = this.doubleClick.bindAsEventListener(btn);
> 
> So instead of onclick, use onmousedown!
> 
> Should I open up a bug report for this?
> 
> Best regards,
> Bart
> 
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
> 
> 
> --------- Oorspronkelijk bericht --------
> Van: Bart van den Eijnden OSGIS &lt;bartvde at osgis.nl&gt;
> Naar: dev at openlayers.org &lt;dev at openlayers.org&gt;
> Onderwerp: event propagation
> Datum: 23/01/07 09:14
> 
> &gt; 
> &gt; Hi list,
> &gt; 
> &gt; I am having the following problem: altough the event is stopped in
> &gt; PanZoom.js in buttonDown, it still arrives in my custom MouseToolbar
> causing
> &gt; the map to zoom out twice if the zoom out tool is active on my
toolbar.
> &gt; 
> &gt; If I put an alert in after the OpenLayers.Event.stop(evt) call, all
is
> fine,
> &gt; and the map only zooms out once like expected.
> &gt; 
> &gt; So I am expecting this to be a timing problem of some sort, i.e. that
the
> &gt; event stopping is not fast enough somehow.
> &gt; 
> &gt; Is there a solution? Is it a known issue? I am using 2.3RC2.
> &gt; 
> &gt; Best regards,
> &gt; Bart
> &gt; 
> &gt; --
> &gt; Bart van den Eijnden
> &gt; OSGIS, Open Source GIS
> &gt; http://www.osgis.nl
> &gt; 
> &gt; 
> &gt; 
> &gt; 
> 
> 
> 
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> 
> 






More information about the Dev mailing list