ThinkGeo.com    |     Documentation    |     Premium Support

Map_TrackEnded event firing from mouse clicks

Not sure if this is intended, but whenever I click on the map, I see the MapClick function AND the Map_TrackEnded function firing. It feels like the TrackEnded event should not be happening.

Here’s the simple setup:
MyMap.TrackOverlay.TrackEnded += TrackEndedHandler;
MyMap.MapClick += MapClickHandler;

Using v13. Here’s the call stack:

If it is intended, is there a way to prevent this from firing based on what mouse button was pressed? When using the trackoverlay, I use the left mouse button for dragging/selecting groups of features, and the middle button is used for panning. I don’t see any sort of mouse related parameter in the TrackEndedTrackInteractiveOverlayEventArgs though.

Thanks!

Hi @Dan_Weaver,

Thanks for your post and I believe you’re correct that this was an issue in the past and has been fixed recently.

What version are you running on? I just tested with the latest 13.3 release packages and it’s working as expected.

Thanks,
John

Thanks for the reply! I am running version 13.0. I’ll try updating and see if the issue is still there.

Saw the same issue in 13.3 but believe it’s on my end. Am I correct in that, if the trackmode is set to none, the track events will NOT fire? I basically have my own mode where user can click on a feature to select it or drag (via the track layer) to select multiple features. Because the trackmode was set to rectangle, even if the user is just doing a single click it would fire that trackmode after. To get around this I’m just setting the e.Cancel to true inside the trackstarting event.

Hi @Dan_Weaver,

Thank you for the extra details, that makes sense. TrackMode.Rectangle is a little different than Line or Polygon. becaue the Rectangle mode is a ‘drag’ mode instead of a ‘click’ mode like line or polygon, it behaves a little differently. in Rectangle mode, a click is treated as a drag with no size which basically fires the TrackEnded event.

I think your solution using the e.Cancel should be good if it’s working like you need.

Good luck and let us know if you need anything else.

Thanks,
John