Hi,
I’m currently testing your sample “draweditfeatures” with MS 9.0.201.0.
Clearing the trackoverly is not working properly.
here are steps to reproduce:
1. Start drawing a polygon => a polygon is drawn => OK
2. click on the delete tool => the polygon is deleted => OK
3. Start drawing a new polygon => the first polygon is displayed again and new vertices are added to it => KO
I think that androidMap.TrackOverlay.TrackShapeLayer.Clear() does not clear everything.
Can you check and provide a fixed code to really clean the trackOverlay ?
Thank you
Patrick.
Issue with Trackoverly.Clear()
Hi Patrick,
Thanks for your information. I think it’s should be an operational problem of our sample, and it will be fixed in the next version.
The reason is that the track is not ended when draws a new polygon 2nd. You can long press the map to fire the track end action. Or you can call the LongPress(args) method explicitly as the following code:
OnCreate(Bundle bundle) method:
androidMap.TrackOverlay.VertexAdded += (sender, e) => { endVertex = e.AddedVertex; };
private void TrackButtonClick(object sender, EventArgs e)
{
ImageButton button = (ImageButton)sender;
foreach (ImageButton tempButton in GetButtons())
{
tempButton.SetBackgroundResource(Resource.Drawable.buttonbackground);
}
WorldX = endVertex.X, WorldY = endVertex.Y});
androidMap.TrackOverlay.LongPress(new InteractionArguments(){
button.SetBackgroundResource(Resource.Drawable.buttonselectedbackground);
switch (button.Id)
{
case Resource.Drawable.Cursor:
…
androidMap.TrackOverlay.TrackMode = TrackMode.None; …
break;
…
}
}
Regards,
Peter