Class deCarta.Mobile.Routing
The Routing class is a static object which provides a single #execute method for calculating a route using the deCarta DDS Web Services.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Static class with #execute method for calculating a route.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
deCarta.Mobile.Routing.execute(criteria, callback)
Executes the routing query.
|
Method Detail
<static>
deCarta.Mobile.Routing.execute(criteria, callback)
Executes the routing query.
- Parameters:
- {deCarta.Mobile.RouteCriteria} criteria
- the route criteria to be used.
This can be either an instance of a deCarta.Mobile.RouteCriteria
object, or it can be an inline object with the same structure, as follows:
object: { distanceUnit: string, //Unit for route distance measurement. //Valid values are: 'KM' (Kilometers), 'M' (Meters), 'MI' (Miles), 'FT' (Feet). instructionProvidePoint: bool, //[[Not yet defined] instructionRules: string, //[Not yet defined] provideRouteHandle: bool, //Provide a route Id for further operations on route returnIdOnly: //true will cause route query to return a server route ID routePreference: string, //"AvoidFreeways", "Easy", "Fastest", "MoreFreeways", "NoFreeways", "Pedestrian", "Shortest" routeQueryType: string, //Type of DDS Query, 'RMAN' or 'RTXT' [Need to define valid values and what they indicate.] waypoints: //Must include at least start and end points 0: {deCarta.Mobile.Position} ... N: {deCarta.Mobile.Position} - {function} callback
- A user defined function that will receive
the respose to the query from the DDS Web Service.
Function signature:
function routeResponseCallback(RouteReturnObject)
The callback function is passed a single object with the following structure:RouteReturnObject = { RouteGeometry:{ //Contains the route geometry LineString: { //Contains an array of positions pos:[] //Array of positions represented as space separated lat lon pairs (ex: "lat lon") } }, RouteInstructionsList:{ //Instruction list for the route RouteInstruction:[ //Array of instruction objects { distance:{ //Distance along the route value: 0 //Value of the distance object }, duration: '', //Duration of the manouver description: '', //Description of the maneuver Instruction: '', //A human readable description of this route maneuver. tour: 0, //Which waypoint this maneuver is associated with in an optimized route. Point: '' //A lat long pair (space separated) }, ], lang: '' //Language for this route }, RouteSummary:{ //Summary of the route BoundingBox:{ //Contains positions describing a bounding box for the route pos: [{ //Array of two positions, top left amd bottom right content: '' //Content of each position, as a space separated lat long pair }] }, TotalDistance:{ //Object representing the total distance covered by the route uom: '', //Unit of measure value: 0 //Value of the distance }, TotalTime: '' //Total time required }, RouteHandle:{ //Handle to the route (can be used for later queries) serviceID: '', //ServiceID routeID: '' //RouteID } }