ThinkGeo.com    |     Documentation    |     Premium Support

Map click event firing after a pan?

Hi everyone, hope this is a nice easy one…
We’re using the MapClick event to get the clicked location and perform some database searches on the area and present results in a popup on-screen.
The problem is we’re getting a MapClick event even after releasing the mouse from a click-and-drag-to-pan so every time we drag the map, the system is reacting as if we clicked the point that the mouse ends up at.
Are we missing something? Thanks.

Hi Jason,

MapClick is delayed until the OS’s double-click timeout elapses (to make sure it’s not part of a DoubleClick event), resulting in a pause before it fires. You can just use other events MouseDown/MouseUp instead.

By the way, here is how you can get that timeout in your code:

[DllImport(“user32.dll”, CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern int GetDoubleClickTime();

Thanks,
Ben