I am not able to remove waypoints from bing map in c# (WPF), i had used waypoint remove, clear, removeat but still not removed.....
- How to remove waypoints from bing map in c#
- also provide code to delete the path between waypoints
Source and destination are Location(latitude,longitude)
startWaypoint = new Bing.Maps.Directions.Waypoint(Source);
endWaypoint = new Bing.Maps.Directions.Waypoint(Destination);
waypoints = new Bing.Maps.Directions.WaypointCollection();
waypoints.Add(startWaypoint);
waypoints.Add(endWaypoint);
//Start = waypoints.IndexOf(startWaypoint);
//End = waypoints.IndexOf(endWaypoint);
directionsManager = GuideMap.DirectionsManager;
directionsManager.Waypoints = waypoints;
// Calculate route directions
Bing.Maps.Directions.RouteResponse response = await directionsManager.CalculateDirectionsAsync();
route = response.Routes[0];
// Display the route on the map
directionsManager.ShowRoutePath(response.Routes[0]);