[OpenLayers-Users] Catching click verses double-click

Tim Schaub tschaub at openplans.org
Mon Feb 25 14:09:21 EST 2008


Hey-

David R Robison wrote:
> I am trying to catch a click event to the map. I register to receive a 
> click with the following code:
> 
> this.map.events.register('click', this.map, dojo.lang.hitch(this, 
> this.processMapClick));

You should use the real click handler instead.  Allows capture of single 
and/or double and gives you the option to stop one or both from propagating.

The click handler is not in 2.5.  You can use the trunk or wait for it 
in 2.6.

For an example of its use, see the click handler example:
http://openlayers.org/dev/examples/click-handler.html

Tim

> 
> However, my click handler (processMapClick) is receiving click events 
> for both single and double clicks. Is there some way to prevent this or 
> at least detect which is which? The events look to be the same.
> 
> TNX David Robison
> 




More information about the Users mailing list