Trying to draw a line produces the following error
System.ArgumentException: 'Polyline must have a 2 positions to be added to a map'
Even though when you see my screencast below I do indeed have 2 points. Or do you mean it must have a start and an end position.
https://www.screencast.com/t/NlddvDqgIvIj
private void Current_PositionChanged(object sender, PositionEventArgs e)
{
MyPostion pos = new MyPostion();
pos.Lat = e.Position.Latitude;
pos.Lng = e.Position.Longitude;
listPostions.ItemsSource = null;
postionsList.Add(pos);
listPostions.ItemsSource = postionsList;
Position pos2 = new Position(pos.Lat, pos.Lng);
if ((postionsList.FirstOrDefault().Lat != 0.00))
posList.Add(pos2);
if (posList.Count >2)
polyLine.Positions.Add(pos2);
map.Polylines.Add(polyLine);
double zoom = map.CameraPosition.Zoom;
map.AnimateCamera(CameraUpdateFactory.NewPositionZoom(new Position(e.Position.Latitude, e.Position.Longitude),zoom),null);
}
Trying to draw a line produces the following error System.ArgumentException: 'Polyline must have a 2 positions to be added to a map'
Even though when you see my screencast below I do indeed have 2 points. Or do you mean it must have a start and an end position. https://www.screencast.com/t/NlddvDqgIvIj private void Current_PositionChanged(object sender, PositionEventArgs e) {