I've come upon some strange
behaviour, possibly a bug.
I have a feature (multipolygon or
multilinestring) 'feat' in my map's TrackOverlay TrackShapeLayer. feat.Tag has
been assigned a string that's useful to me.
I want the user to be able to edit
this feature, so after the user presses a 'edit feature' button I do the
following:
map.TrackOverlay.TrackShapeLayer.InternalFeatures.Remove(feat);
map.EditOverlay.EditShapesLayer.InternalFeatures.Add(feat);
At this point, feat still has its
Tag.
The user can now move the feature
around, rotate, resize, etc. Then when pressing the 'edit feature' button again,
the feature is put back into the TrackShapeLayer.
Feature feat = map.EditOverlay.EditShapesLayer.InternalFeatures[0];
map.TrackOverlay.TrackShapeLayer.InternalFeatures.Add(feat);
map.EditOverlay.EditShapesLayer.InternalFeatures.Clear();
In most cases, feat still has its Tag when I
add it to the TrackShapeLayer. However, if the user has at some point while editing
added a vertex by clicking on the line between two existing vertices, feat.Tag
is set to null.
Why is this, and how can I stop my Tag
from getting lost?