[OpenLayers-Users] distinguish "click" from "drag"

Bobby Braswell rob.braswell at unh.edu
Tue Apr 17 15:41:17 EDT 2007


I was trying out Tim Schaub's version
<script src="http://dev.openlayers.org/sandbox/tschaub/feature/lib/ 
OpenLayers.js" type="text/javascript"></script>

In order to get the WMS "gutter" feature.

When I use regular OpenLayers API the drag does not cause a click.

That sort of narrows down the problem. I'm very sorry for the  
unnecessary confusion.

Rob


On Apr 17, 2007, at 3:23 PM, Christopher Schmidt wrote:

> On Tue, Apr 17, 2007 at 03:19:02PM -0400, Bobby Braswell wrote:
>>
>> Hi-
>>
>> I'd like to trigger certain events (e.g., display feature info) when
>> the map is clicked, but not dragged. I'd like to do other things (or
>> perhaps nothing special) when then map is dragged. Currently I am
>> using map.events.register('click', map, function (e) {..}); and that
>> works fine except for the undesirable behavior of showing feature
>> info when the user simply wants to move the map around.
>>
>> Is there a way to register an event for click but somehow cancel it
>> if there is a subsequent drag before the mouseup?
>
> I'm assuming you're using IE. If so, it's possible that the patch to
> http://trac.openlayers.org/ticket/656 , applied to trunk about 15
> minutes ago, will solve your problem.
>
> If you're not using IE, please explain -- preferably with a demo --  
> how
> you are causing a click event to fire when dragging.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta




More information about the Users mailing list