Web Maps Lite: differentiating double click and single click events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Web Maps Lite: differentiating double click and single click events

Jordan Anderson
Hi all,

In OpenLayers, it is possible to listen for either a double click or
single click event, treating them differently. As far as I can tell,
the Web Maps Lite 'click' event is triggered for *both* double clicks
and single clicks. I'd like to keep the default double click behavior
-- zoom in -- without invoking the single click behavior. (In my case,
a single click places a marker on the map, or moves an existing marker
to the point that was clicked.)

Please let me know if I'm missing something. Otherwise, I'll request
this as a feature in the Issue Tracker.

Here is a small demo:
http://ridethecity.com/_wml_/

Thanks,
Jordan
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Web Maps Lite: differentiating double click and single click events

Vladimir Agafonkin
Hi Jordan,

We didn't implement this yet because keeping track of double clicks on click would introduce a small delay when executing all click handlers, but I'll take a look at OpenLayers implementation to see if there's a clever solution for this.

On Tue, Mar 3, 2009 at 9:08 PM, Jordan Anderson <[hidden email]> wrote:
Hi all,

In OpenLayers, it is possible to listen for either a double click or
single click event, treating them differently. As far as I can tell,
the Web Maps Lite 'click' event is triggered for *both* double clicks
and single clicks. I'd like to keep the default double click behavior
-- zoom in -- without invoking the single click behavior. (In my case,
a single click places a marker on the map, or moves an existing marker
to the point that was clicked.)

Please let me know if I'm missing something. Otherwise, I'll request
this as a feature in the Issue Tracker.

Here is a small demo:
http://ridethecity.com/_wml_/

Thanks,
Jordan
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev



--
Vladimir Agafonkin
Front-End Architect, CloudMade
+380 93 745 44 61

_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Web Maps Lite: differentiating double click and single click events

Jordan Anderson
Here's a workaround that does introduce a small delay before clicking
and could probably be implemented more elegantly:
http://ridethecity.com/_wml_/

The javascript is here: http://ridethecity.com/_wml_/rtc-wml.js

This also addresses another problem - the 'mouseup' event at the end
of dragging the map triggers a 'click', which I wanted to ignore.

One thing I haven't been able to address is that when I click the
little 'x' to close a CM.InfoWindow, this also triggers a click event
on the map. Is there a way to isolate those clicks?

Thanks,
Jordan

On Tue, Mar 3, 2009 at 2:29 PM, Vladimir Agafonkin
<[hidden email]> wrote:

> Hi Jordan,
>
> We didn't implement this yet because keeping track of double clicks on click
> would introduce a small delay when executing all click handlers, but I'll
> take a look at OpenLayers implementation to see if there's a clever solution
> for this.
>
> On Tue, Mar 3, 2009 at 9:08 PM, Jordan Anderson <[hidden email]>
> wrote:
>>
>> Hi all,
>>
>> In OpenLayers, it is possible to listen for either a double click or
>> single click event, treating them differently. As far as I can tell,
>> the Web Maps Lite 'click' event is triggered for *both* double clicks
>> and single clicks. I'd like to keep the default double click behavior
>> -- zoom in -- without invoking the single click behavior. (In my case,
>> a single click places a marker on the map, or moves an existing marker
>> to the point that was clicked.)
>>
>> Please let me know if I'm missing something. Otherwise, I'll request
>> this as a feature in the Issue Tracker.
>>
>> Here is a small demo:
>> http://ridethecity.com/_wml_/
>>
>> Thanks,
>> Jordan
>> _______________________________________________
>> Dev site list
>> [hidden email]
>> http://lists.cloudmade.com/listinfo/dev
>
>
>
> --
> Vladimir Agafonkin
> Front-End Architect, CloudMade
> +380 93 745 44 61
>
_______________________________________________
Dev site list
[hidden email]
http://lists.cloudmade.com/listinfo/dev