Disable onClick Event when Panning the map

783
1
04-08-2013 02:34 PM
BrianBeck
New Contributor III
I have a custom onClick event handler for my map.  I'm finding that the handler is called when I click on the map to pan.  Is there a way to disable the onClick event if the map is panning?
0 Kudos
1 Reply
SteveCole
Frequent Contributor
A little hard to respond without knowing more about what you're doing with your OnClick event so I'll blindly offer a couple (untested) suggestions:


  • Would it be too awkard to switch your onClick code over to a onDblClick event? That way you avoid the conflicting situation entirely.

  • Perhaps you could add a conditional statement within your onClick event handler and check if map.OnPan has values. If it does, the map is panning so you know that  you shouldn't perform your onClick code.


Good luck!
Steve
0 Kudos