Solved! Go to Solution.
// create directions from the mobile vehicles current location to the selected call. var fromVehicle:DirectionsStop = drivingDirections.stopProvider[0]; fromVehicle.editable = false; var vehPT:MapPoint = vehGraphic.geometry as MapPoint; fromVehicle.location = vehPT; fromVehicle.searchTerm = "My Current Vehicle Location..."; // now get the call point var call:Call = ItemRenderer(event.target).data as Call; var toLocation:DirectionsStop = drivingDirections.stopProvider[1]; toLocation.editable = false; toLocation.searchTerm = call.address; toLocation.location = call.geometry; drivingDirections.getDirections();
Greetings!
To add to this thread, I am using a direct feed from a vehicle modem and just needed to use the coordinates or a MapPoint to create driving directions. Instead of using the searchTerm of the stopProvider for the coordinates, I set the location property of the stopProvider and use the searchTerm as a descriptor. This works very well.// create directions from the mobile vehicles current location to the selected call. var fromVehicle:DirectionsStop = drivingDirections.stopProvider[0]; fromVehicle.editable = false; var vehPT:MapPoint = vehGraphic.geometry as MapPoint; fromVehicle.location = vehPT; fromVehicle.searchTerm = "My Current Vehicle Location..."; // now get the call point var call:Call = ItemRenderer(event.target).data as Call; var toLocation:DirectionsStop = drivingDirections.stopProvider[1]; toLocation.editable = false; toLocation.searchTerm = call.address; toLocation.location = call.geometry; drivingDirections.getDirections();