Select to view content in your preferred language

Directions Component Stops Provider

2775
21
Jump to solution
01-14-2014 01:38 AM
raffia
by
Deactivated User
Hello;

I am trying to provide a "Directions from here" and ..to here functionality, so I want to use the stopProvider property in the Directions Component. I tried passing an XY from the map point, but to no success. Any sample one line of code showing how to pass the stopProver please?

Raffi
Tags (2)
0 Kudos
21 Replies
TomSellsted
MVP Alum
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();     
0 Kudos
raffia
by
Deactivated User
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();                    


This is great, thanks Tom
0 Kudos