I am having an issue with the TrackMode and switching away from line to none and back to line. I see this issue as well in the How Do I samples (Track and edit shapes). If you click on the TrackLine button, draw some lines but don't doubleclick or commit the line, then switch to either TrackMode.None or TrackMode.Polygon the original lines you drew do not go away.
Sample Scenario:
1. Click on Line button
2. Single click on map to start line
3. Single click on map to draw 1 line segment
4. Click on Track Mode none button. Your line should remain on the map, with 1 more segment drawn.
5. Click on Line Button
6. You should gain control of the last line segment.
I have tried to clear the trackoverlay with:
wpfMap.TrackOverlay.Lock.EnterWriteLock(); try { wpfMap.TrackOverlay.TrackShapeLayer.InternalFeatures.Clear(); wpfMap.TrackOverlay.TrackShapeLayer.BuildIndex(); } finally { wpfMap.TrackOverlay.Lock.ExitWriteLock(); wpfMap.TrackOverlay.TrackMode = TrackMode.None; wpfMap.Refresh(); }
This doesn't seem to help. Is there a way to clear/cancel the current track line when I switch to trackmode none?