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

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


Sorry for not being more specific. Here is the demo:
http://waage.sr.unh.edu/goo/landcover_ol.html? 
lat=44.12109&lon=-95.97656&zoom=3&layers=B00TT

I'm using Firefox and Safari, and get the same behavior in both  
browsers. I haven't tried IE yet.

If you drag the map, you will see feature info text appear in the div  
on the lower right, which is only triggered by the "click" event, or  
so I thought it should be.

Thanks,
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