|
bnygren40
|
|
When doing a GetDirections,OnDirectionsLoaded
Whe I look at the Map1 collection of layers and shapes, I don't see the Polyline shape. I see the Shapes for the steps and RouteLegs etc. However a polyline is generated. How do I get access to the Polyline ?
The polyline is complex since it hugs the road between Itinerarypoints (lat/long)?
Why do I want the Polyline? I could generate a polyline from the Itinerary. but it will cut the line directly from step to step not curve with the road. The purpose is to define a GeoFence around the polyline to ensure the driver, when reporting back GPS coordinates, doesn't deviate from the Route.
RouteItinerary ri = rl.Itinerary; foreach (RouteItineraryItem riItem in ri.Items) { LatLong ll = riItem.LatLong; // create shape - poline }
Thanx
|
|
|
|
Chris Pietschmann
|
|
The underlying Bing Maps JavaScript Map control does not allow you to access the Polyline that is drawn on the Map for the generated route. It only allows access to the individual itinerary points plotted. Since this is something that is internal to the Bing Maps JavaScript Map control that is used internally in Web.Maps.VE this is consequentially something that can not be done.
However, you can use the Bing Maps Web Services to generate the Route and that service will give you the entire, full details of the Router to do with as you need. Using the Web Service, you will need to render the route on the map manually, instead of automatically using the Directions functionality of Web.Maps.VE.
|
|
|