[OpenLayers-Dev] event propagation

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


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 <bartvde at osgis.nl>
Naar: dev at openlayers.org <dev at openlayers.org>
Onderwerp: event propagation
Datum: 23/01/07 09:14

> 
> Hi list,
> 
> I am having the following problem: altough the event is stopped in
> PanZoom.js in buttonDown, it still arrives in my custom MouseToolbar
causing
> the map to zoom out twice if the zoom out tool is active on my toolbar.
> 
> If I put an alert in after the OpenLayers.Event.stop(evt) call, all is
fine,
> and the map only zooms out once like expected.
> 
> So I am expecting this to be a timing problem of some sort, i.e. that the
> event stopping is not fast enough somehow.
> 
> Is there a solution? Is it a known issue? I am using 2.3RC2.
> 
> Best regards,
> Bart
> 
> --
> Bart van den Eijnden
> OSGIS, Open Source GIS
> http://www.osgis.nl
> 
> 
> 
> 






More information about the Dev mailing list