ThinkGeo.com    |     Documentation    |     Premium Support

End tracking manually

Hey,

I have customized MapView.TrackOverlay (TrackInteractiveOverlay) a little for our needs.
It’s been quite easy but there’s one issue that I’m still struggling with.

When user double clicks left mouse button overlay fires TrackEnded event to indicate drawing is done.
However, when using touch screen it becomes impossible to double tap the exact same location and track is never ended.

We use TrackOverlay for measuring distances/areas and I have worked around this issue by showing measuring results after each VertexAdded event. Still, how I could trigger the TrackEnded on touch screens or manually end the tracking?

Hey @Mikko_Viitala,

For touch controls, it’s best to have a button that ends the TrackMode manually by doing something like the following:

private void EndTrackOverlay_Clicked()
{
    var trackOverlay = mapView.Overlays["TrackOverlay"] as TrackInteractiveOverlay;
    trackOverlay.TrackMode = TrackMode.None;
}

Thanks,
Kyle

1 Like

We are seeing similar things and wondered if you have a guide for working with touchscreens?
Jonathan Rowland

Hey @Jonathan3,

We don’t have an exact guide to working with touchscreens, but more general advice: if there is anything requiring precision drawing (like in applications such as yours), it’s best that users use a stylus because even lifting up your finger will sometimes cause drag events to happen.

Additionally, using dedicated buttons and/or keyboard shortcuts for specific actions (such as committing a shape in Mikko’s case) is recommended because normal map control functions (swipe pan, pinch zoom, tap select) can interfere/be interfered with more custom actions.

Thanks,
Kyle

Hi Kyle,
Thanks, good advice.
Jonathan

Hey @Jonathan3,

You’re welcome. Closing.

Thanks,
Kyle