[OpenLayers-Users] left click handler at OpenLayers.Handler.Drag

Eric Lemoine eric.lemoine at camptocamp.com
Wed Jul 8 15:02:49 EDT 2009


On Wednesday, July 1, 2009, Andre Pereira de Matos
<andre.matos at co.sapo.pt> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Hi List,
>
>
>
> I am developping a site using OpenLayers
> 2.7 (I know, I have to upgrade it to 2.8 :p, but for now I am using 2.7).
>
>
>
> So, in the class OpenLayers.Handler.Drag you
> are using an handler for mousedown events (method: mousedown), and you are
> returning false if it is a left mousedown, is there any reason to do that? I tried
> to return true and the behavior apparenty doesn’t chang, it still works…
>
>
>
>
>
> At some point of my application I would
> like to be notified when a left mousedown occurs, could I return true in that
> method? Is there a patch to fix that?

Hi, and sorry if this answer comes late. Yes, by default the drag
handler's mousedown method returns false. You can change that by
setting stopDown to false in the drag handler instance. If you want to
have that in every drag handler, even those that you don't create
yourself, you can do:

OpenLayers.Handler.Drag.prototype.stopDown = false;

soon enough if you application code.

Cheers,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list