-
Name Type Description options
Name Type Description routing3d
boolean Draw 3D polyline for calculated route feature. Default
true
.
Extends
- EventEmitter
Methods
-
Add step/waypoint marker.
Name Type Description marker
module:cercaliagl/Marker~Marker Marker
position
number Step position
draggedPoint
boolean true
if is a dragged point. -
Calculate report and handle report in a callback function.
Name Type Description callbackFn
function Callback function.
-
Delete route from map and its markers.
-
Disable auto zoom (center to features) after draw route feature.
Name Type Description autoZoomDisabled
boolean true
disables center to features after calculated route.false
active restores default behaviour. -
Disable right click context menu. It is enabled by default.
-
Enable right click context menu. It is enabled by default.
-
Get route features.
Returns:
Array feature.
-
Get route alternative features.
Returns:
Array feature.
-
Returns:
Routing options
-
Obtain
routing
service object.Returns:
Routing service
-
Obtain WKT
Returns:
WKT.
-
Invert origin and destination.
-
Return if MapRouting is active
Returns:
`truè if map routing is actived.
-
Obtain if logistics service mode is enabled.
Returns:
true
if route is logistics.
-
Clear route features from map.
-
Clear route markers from map.
-
Name Type Description index
number Index.
-
Select active an alternative route by index.
Name Type Description routeIndex
number Route index
-
EXPERIMENTAL
. Enable or not to draw 3D routes.Name Type Description enable
boolean Enable or disable to draw 3D features
-
Update Routing widget costs.
Name Type Description consumption
number Consumption L/100 km. Example:
8.2
.gasType
string | undefined Gas Type. Available values:
gas95|gas98|diesel|biodiosel
.gasPrice
number | undefined Gasoline price. €/L. Example:
1.51
. -
Set custom callback error function. This function is called after route with errors.
Name Type Description func
function Custom callback function to handle error
-
Set custom callback function. This function is called after route calculation. Setting null, it disables previous custom function.
Name Type Description func
function Custom callback function.
-
Set route draggable and its steps
Name Type Description draggable
boolean Draggable
-
Update route parameter option
weight
. Use this insteadsetWeight
fromcercalia.service.Routing
.Name Type Description reorder
boolean Reorder
Returns:
Returntrue
if route options has been modified
-
Name Type Description options
Routing 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.
-
Set a routing step. It can be origin, destination or a step/waypoint.
Name Type Description stepType
string Step type. Values
origin
|destination
|step
.position
module:cercaliagl/LonLat~LonLat Position
formattedAddress
string (defaults to false) Formatted address.
-
Update route parameter option
weight
. Use this insteadsetWeight
fromcercalia.service.Routing
.Name Type Description weight
string Weight
Returns:
Returntrue
if route options has been modified
-
updateOptions(weight, reorder, logisticsEnabled, logisticsParams, departuretime)
-
Name Type Description weight
string Weight.
reorder
boolean Optimized route.
logisticsEnabled
boolean Enable or disable logistics params.
logisticsParams
module:cercaliagl/MapRouting~LogisticsParams Logistics params.
departuretime
string (defaults to null) Departure time
logisticsParams.vweight
number Vehicle max wegiht
logisticsParams.vaxleweight
number Vehicle max axle weight
logisticsParams.vheight
number Vehicle max height
logisticsParams.vlength
number Vehicle max length
logisticsParams.vwidth
number Vehicle max width
logisticsParams.vmaxvel
number Vehicle max speed
logisticsParams.rimp
boolean Dangerous goods
logisticsParams.trinfodate
string YYYYMMDD
logisticsParams.trinfodays
number Number days to consecutives to show restrictions.
logisticsParams.trstart
number Avoid route restrictions. In timestamp format.