dblclick and click

35 views
Skip to first unread message

Thomas Lefort

unread,
Mar 8, 2012, 3:22:39 AM3/8/12
to google-map...@googlegroups.com
Is there a clean way to handle the click/dbclick issue in v3?

The "issue" arising when you want to have a different behaviour on both click and dblclick, as click is automatically triggered on a dblclick event.

I have seen some rather unclean workarounds such as timers and else... looking for something more straightforward.

BTW what is the reason for triggering both events?

Pil

unread,
Mar 8, 2012, 3:49:57 AM3/8/12
to Google Maps JavaScript API v3


On Mar 8, 9:22 am, Thomas Lefort <lefortho...@gmail.com> wrote:

> BTW what is the reason for triggering both events?

The reason is a logical one: A double click consists of two clicks -
using the same mouse button.

So if you want to isolate a double click event from a single click
event the first click of the double click event must be canceled by
turning back the clock. Logically and physically impossible.

If a double click event would only be possible when using an extra
button then this would be no problem.

Thomas Lefort

unread,
Mar 8, 2012, 4:09:55 AM3/8/12
to google-map...@googlegroups.com
Yes sorry it was a bit of a stupid question indeed... I am stuck though
as I need to have both events handled by the same element, which OK is
arguably bad practice... I guess I will have to do with the timer solution.
Reply all
Reply to author
Forward
0 new messages