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