ThinkGeo.com    |     Documentation    |     Premium Support

Delay on MapClick event

Theres a delay on the MapClick event - maybe about 200 milliseconds. It is enough to make the map appear unresponsible, like it has some heavy workload when the mouse is clicked. I realize though, that it is simply waiting for a second mouse click to determine if its a single or double click. The user can change the double click speed in Windows, and that could make the delay even longer.

It is an unfortunate design decision that means we decided not to use the event at all, and use the standard MouseLeftButtonUp on the map control instead. But that creates some other challenges, for example we need to figure out if the map has been panned or not. It is hard to find solid solutions to these challenges, and I think something so simple as a mouse click should just work satisfactory without workarounds.

I hope that you will reconsider this design, or make it optional.

Hi Jonas,

Thanks to let us know your scenario and question, yes that’s because we need to adjust whether it’s a double click or click, but we get the value from system, it’s a win32 API GetDoubleClickTime. So that is mainly related with the user’s machine setting about double click speed.

Thanks for your suggestion, I think the logic and API should can get optimization in future, and I will let our development manager know this problem. But because API change is big change for product, so I am not sure when we can have a enhancement about that.

Regards,

Ethan

Heres my suggestion:
Make a MapClickMode enum property and set the default mode to the current mode, we could call it WaitForMapDoubleClickCheck, and then make another one called DoNotWaitForMapDoubleClickCheck or Immediate, where the MapClick will always fire even if it is followed by a MapDoubleClick.

It is not an api change, it is an api addition. It wont brake anything for anyone, and it is simple to implement as far as I can tell.

Hi Jonas,

Thanks for your suggestion, I have let our development team know it.

Our development team need to discuss about this problem, because add API won’t be broken change, but that will break the consistency between all of our products, so they need think about more to see whether we can add it, how to add it and whether need introduce that to all other products.

And our developer found a workaround should be helpful, please try that to see whether it works for you.

You can set this property:
EditInteractiveOverlay.InteractiveClickInterval = 1;

Before the InitializeComponent(); function.

Wish that’s helpful.

Regards,

Ethan

Hi Ethan
Thanks for your response.
I tried the suggested workaround, but unfortunately it made the the MapClick event very unreliable - it would not trigger on every click, but only once in while. Maybe its a bug?

Jonas

Hi Jonas,

Yes I noticed that also, it looks the timer cannot work with too small value, the EditInteractiveOverlay.InteractiveClickInterval = 80 should make the map click value works.

Do you think the 80ms is acceptable in your scenario?

Regards,

Ethan

It does seem like its possible to get a faster click response this way, but it has unwanted effects.
The double click becomes unreliable. It also appears that the interval affects if something is considered a click: if the value is 80, and you release the mouse after 100 ms, its not a click - and that is quite unusual.

I have tested a range of values, and it does not seem like a good solution.

best regards
Jonas

Hi Jonas,

Thanks for your update to let us know this way is blocked.

I think our developer can take some time to look into it, to see whether we can find any logic problem in the process of InteractiveClickInterval works. Any update about that I will let you know.

Regards,

Ethan