-
Name Type Description optionsOptions
Name Type Description destinationmodule:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Destination coordinates.
edgesboolean Get edges IDs
infoedgesboolean 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.langstring Report language (only if report parameter is
true).mindistnumber Minimum substage distance, in meters. The larger this distance , the smaller the number of substages. Default value
1000.originmodule:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Origin coordinates.
reorderboolean Specify if you want to reorder or not the route stops, to get the faster/shorter route. Maximum 10 stop points.
reportboolean Get the textual route report (if not, gets a faster response). Default
0.stepsArray.<module:cercaliagl/LonLat~LonLat> | Array.<module:cercaliagl/service/Routing~RoutingStep> Array with stop points coordinates.
tolerancenumber Route geometry generalization, in meters (if =0, returns the original geometry). Default value
5(meters).tollboolean Specify if you need to get the toll roads cost for the route. Currently only avaliable for Spain, Portugal and Andorra. Default
false.weightstring Route type:
time(faster),distance(shorter),money(toll free route). Default value:time.vweightnumber Route logistics parameter. Total maximum vehicle weight.
vaxleweightnumber Route logistics parameter. Maximum vehicle axle weight.
vheightnumber Route logistics parameter. Maximum vehicle height.
vlengthnumber Route logistics parameter. Maximum vehicle length.
vwidthnumber Route logistics parameter. Maximum vehicle width.
vmaxvelnumber Route logistics parameter. Maximum vehicle speed.
rimpboolean Route logistics parameter. Dangerous goods
trinfodatestring Route logistics parameter. Number days to consecutives to show restrictions. Info date format
YYYYMMDD.trinfodaysnumber Route logistics parameter. Avoid route restrictions. In timestamp format.
trstartnumber Route logistics parameter. Avoid route restrictions. In timestamp format.
originIsDepotboolean 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.destinationIsDepotboolean 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.concurrencyboolean | undefined Default
true. Multiple requests at same time. Iffalseit cancel previous pending requests.departuretimestring Departure time in format ISO8601.
adrTunnelstring ADR tunnel category.
intoll_xstring Calculating route using roads with tolls
showBreaktimesboolean Show break times.
twoDriversboolean Calculate break times with two drivers.
poicatsArray.<string> Array of POI categories.
alternativesboolean Enable alternatives routing calculation.
isLogisticsboolean Route calculation for logistics.
tollInfoTypemodule:cercaliagl/service/Routing~TollInfoType Format of the toll information shown when calculating a route. Default value
basic.tollCurrencystring Currency of the toll information displayed when calculating a route. Default value
undefined.netstring Custom routing net. Default value
undefined.
Extends
- module:cercaliagl/service/Service~Service
Methods
-
Add step (or waypoint).
Name Type Description stepmodule: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 callbackFnfunction Callback Function after calculate route
callbackErrorFnfunction Callback Error Function after calculate route error.
-
Clear all option values to calculate route.
-
Returns:
Departuretime
-
Get route destination position
Returns:
lonLat Destination
-
Returns:
Getdestinationisdepotparameter value.
-
Returns:
edgestrueorfalseif edges option is enabled.
-
Returns:
edgestrueorfalseif 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:
Getoriginisdepotparameter value.
-
Returns:
poicats Array of POI categories.
-
Get response
Returns:
response
-
Get Route Id (internal id from Cercalia servers)
Name Type Description routeIndexnumber (defaults to 0) Route index alternative.
Returns:
Cercalia route id
-
-
Returns:
Show break times.
-
getStages(routeIndex){Array.<module:cercaliagl/servers~RoutingResultStage>|null}
-
Obtiene
stages.Name Type Description routeIndexnumber (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|distanceReturns:
Route weight
-
Obtiene WKT de la ruta calculada
Name Type Description routeIndexnumber (defaults to 0) Route index alternative.
Returns:
WKT de la ruta calculada. Devuelve null si no se ha calculado ninguna
-
Returns:
Return ifalternativesflag is enabled
-
Returns:
trueif route has logistics parameters.
-
Returns
trueif it is ready to calculate. When options has been set. (minimumoriginanddestination)Returns:
trueif can calculate route.
-
Get if reorder options to calculate route is enabled.
Returns:
Reordertrueorfalse.
-
Returns:
reporttrueif report is enabled. Elsefalse.
-
Get if toll option is enabled.
Returns:
Toll istrueorfalse.
-
Enable alternatives routing calculation
Name Type Description alternativesboolean Enable
alternativesflag -
Name Type Description departuretimestring Departuretime. Example:
2019-08-26T11:49+02:00- -
Set route destination
Name Type Description destinationmodule:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Destination
-
Name Type Description destinationIsDepotboolean Enable
destinationisdepotparameter -
Set to get edges from route calculation.
Name Type Description edgesboolean 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 infoedgesboolean Enable
true. Elsefalse. -
Name Type Description isLogisticsboolean Enable logistic route.
-
Name Type Description logisticsParamsLogistics params.
Name Type Description vweightnumber Vehicle max wegiht
vaxleweightnumber Vehicle max axle weight
vheightnumber Vehicle max height
vlengthnumber Vehicle max length
vwidthnumber Vehicle max width
vmaxvelnumber Vehicle max speed
rimpboolean Dangerous goods
trinfodatestring YYYYMMDD
trinfodaysnumber Number days to consecutives to show restrictions.
trstartnumber Avoid route restrictions. In timestamp format.
adrtunnelstring Set tunnel category
-
Set minimum distance option.
Name Type Description mindistnumber Minimum distance
-
Set route origin
Name Type Description originmodule:cercaliagl/LonLat~LonLat | module:cercaliagl/service/Routing~RoutingStep Origin
-
Name Type Description originIsDepotboolean Enable
originisdepotparameter -
Name Type Description poicatsArray.<string> Array of POI categories.
-
Enable calculation route reorder points in calculation.
Name Type Description reorderboolean trueorfalse. -
Enable route report.
Name Type Description reportingboolean Boolean to enable route report. (First need to calculate route).
-
Name Type Description showBreakTimesboolean Show break times.
-
Set steps passing an array.
Name Type Description stepsArray.<(module:cercaliagl/LonLat~LonLat|module:cercaliagl/service/Routing~RoutingStep)> Steps.
-
Route tolerance
Name Type Description tolerancenumber Tolerance
-
Enable tolls in route calculation.
Name Type Description tollboolean trueorfalse. -
Name Type Description intollXstring Calculating route using roads with tolls.
-
Name Type Description twoDriversboolean Two drivers in the vehicle
-
Set weight to calculate route. Weight values available:
time|realtime|money|distanceName Type Description weightstring Weight.
time|realtime|money|distance