-
Name Type Description options
Options
Name Type Description destination
module:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Destination coordinates.
edges
boolean Get edges IDs
infoedges
boolean Adds specific information for each section to the route report.
An infoedges tag is added to each substage with specific information of each section.
The following attributes are reported for each section:
height: height from sea level in meters.
gradient: slope of the section
geometry: Stretch geometry
meters: Length of the section
maxkph: Legal maximum speed.lang
string Report language (only if report parameter is
true
).mindist
boolean Minimum substage distance, in meters. The larger this distance , the smaller the number of substages. Default value
1000
.origin
module:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Origin coordinates.
reorder
boolean Specify if you want to reorder or not the route stops, to get the faster/shorter route. Maximum 10 stop points.
report
boolean Get the textual route report (if not, gets a faster response). Default
0
.steps
Array.<module:cercaliagl/LonLat~LonLat> | Array.<module:cercaliagl/service/Routing~RoutingStep> Array with stop points coordinates.
tolerance
number Route geometry generalization, in meters (if =0, returns the original geometry). Default value
5
(meters).toll
boolean Specify if you need to get the toll roads cost for the route. Currently only avaliable for Spain, Portugal and Andorra. Default
false
.weight
string Route type:
time
(faster),distance
(shorter),money
(toll free route). Default value:time
.vweight
number Route logistics parameter. Total maximum vehicle weight.
vaxleweight
number Route logistics parameter. Maximum vehicle axle weight.
vheight
number Route logistics parameter. Maximum vehicle height.
vlength
number Route logistics parameter. Maximum vehicle length.
vwidth
number Route logistics parameter. Maximum vehicle width.
vmaxvel
number Route logistics parameter. Maximum vehicle speed.
rimp
boolean Route logistics parameter. Dangerous goods
trinfodate
string Route logistics parameter. Number days to consecutives to show restrictions. Info date format
YYYYMMDD
.trinfodays
number Route logistics parameter. Avoid route restrictions. In timestamp format.
trstart
number Route logistics parameter. Avoid route restrictions. In timestamp format.
originIsDepot
boolean This parameter only works if REORDER parameter is used. Values:
true
(default): origin cannot be reordered (default).
false
: origin is one more stop and can be reordered. Useful when you cannot choose the starting point of the vehicle.destinationIsDepot
boolean This parameter only works if REORDER parameter is used. Values:
true
(default): Destination cannot be reordered (default).
false
: Destination is one more stop and can be reordered. Useful when after attending some services you don’t have to return to a base.concurrency
boolean | undefined Default
true
. Multiple requests at same time. Iffalse
it cancel previous pending requests.departuretime
string Departure time in format ISO8601.
Extends
- module:cercaliagl/service/Service~Service
Methods
-
Add step (or waypoint).
Name Type Description step
module:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Step.
-
Calcula la ruta especificando una funcion de callback que se ejecuta al volver el resultado
Name Type Description callbackFn
function Callback Function after calculate route
callbackErrorFn
function Callback Error Function after calculate route error.
-
Clear all option values to calculate route.
-
Returns:
Departuretime
-
Get route destination position
Returns:
lonLat Destination
-
Returns:
Getdestinationisdepot
parameter value.
-
Returns:
edgestrue
orfalse
if edges option is enabled.
-
Returns:
edgestrue
orfalse
if edges option is enabled.
-
Returns:
Get minimum distance option.
-
Return number of way points.
Returns:
Number of way points.
-
Get route origin position
Returns:
lonLat Origin
-
Returns:
Getoriginisdepot
parameter value.
-
Returns:
poicats Array of POI categories.
-
Get response
Returns:
response
-
Get Route Id (internal id from Cercalia servers)
Name Type Description routeIndex
number (defaults to 0) Route index alternative.
Returns:
Cercalia route id
-
-
Returns:
Show break times.
-
getStages(routeIndex){Array.<module:cercaliagl/servers~RoutingResultStages>|null}
-
Obtiene
stages
.Name Type Description routeIndex
number (defaults to 0) Route index alternative.
Returns:
WKT de la ruta calculada. Devuelve null si no se ha calculado ninguna
-
getSteps(){Array.<(LonLat|RoutingStep)>|Array.<module:cercaliagl/LonLat~LonLat>|Array.<module:cercaliagl/service/Routing~RoutingStep>}
-
Get all steps
Returns:
Steps
-
Returns:
tolerance
-
Returns:
intoll_x Get ifalculating route using roads with tolls is enabled.
-
Get route weight
time|realtime|money|distance
Returns:
Route weight
-
Obtiene WKT de la ruta calculada
Name Type Description routeIndex
number (defaults to 0) Route index alternative.
Returns:
WKT de la ruta calculada. Devuelve null si no se ha calculado ninguna
-
Returns:
Return ifalternatives
flag is enabled
-
Returns:
true
if route has logistics parameters.
-
Returns
true
if it is ready to calculate. When options has been set. (minimumorigin
anddestination
)Returns:
true
if can calculate route.
-
Get if reorder options to calculate route is enabled.
Returns:
Reordertrue
orfalse
.
-
Returns:
reporttrue
if report is enabled. Elsefalse
.
-
Get if toll option is enabled.
Returns:
Toll istrue
orfalse
.
-
Enable alternatives routing calculation
Name Type Description destinationIsDepot
boolean Enable
alternatives
flag -
Name Type Description departuretime
string Departuretime. Example:
2019-08-26T11:49+02:00
- -
Set route destination
Name Type Description destination
module:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Destination
-
Name Type Description destinationIsDepot
boolean Enable
destinationisdepot
parameter -
Set to get edges from route calculation.
Name Type Description edges
number Edges options enabled
true
. Elsefalse
. -
Adds specific information for each section to the route report.
An infoedges tag is added to each substage with specific information of each section.
The following attributes are reported for each section:
height
: height from sea level in meters.
gradient
: slope of the section
geometry
: Stretch geometry
meters
: Length of the section
maxkph
: Legal maximum speedName Type Description infoedges
boolean Enable
true
. Elsefalse
. -
Name Type Description isLogistics
boolean Enable logistic route.
-
Name Type Description logisticsParams
Logistics params.
Name Type Description vweight
number Vehicle max wegiht
vaxleweight
number Vehicle max axle weight
vheight
number Vehicle max height
vlength
number Vehicle max length
vwidth
number Vehicle max width
vmaxvel
number Vehicle max speed
rimp
boolean Dangerous goods
trinfodate
string YYYYMMDD
trinfodays
number Number days to consecutives to show restrictions.
trstart
number Avoid route restrictions. In timestamp format.
-
Set minimum distance option.
Name Type Description mindist
number Minimum distance
-
Set route origin
Name Type Description origin
module:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Origin
-
Name Type Description originIsDepot
boolean Enable
originisdepot
parameter -
Name Type Description poicats
Array.<string> Array of POI categories.
-
Enable calculation route reorder points in calculation.
Name Type Description reorder
boolean true
orfalse
. -
Enable route report.
Name Type Description reporting
boolean Boolean to enable route report. (First need to calculate route).
-
Name Type Description showBreakTimes
boolean Show break times.
-
Set steps passing an array.
Name Type Description steps
Array.<(module:cercaliagl/LonLat~LonLat|module:cercaliagl/service/Routing~RoutingStep)> Steps.
-
Route tolerance
Name Type Description tolerance
number Tolerance
-
Enable tolls in route calculation.
Name Type Description toll
boolean true
orfalse
. -
Name Type Description intoll_x
string Calculating route using roads with tolls.
-
Name Type Description twoDrivers
boolean Two drivers in the vehicle
-
Set weight to calculate route. Weight values available:
time|realtime|money|distance
Name Type Description weight
string Weight.
time|realtime|money|distance