-
Name Type Description optionsName Type Description routing3dboolean Draw 3D polyline for calculated route feature. Default
true.tollInfoTypemodule:cercaliagl/service/Routing~TollInfoType Format of the toll information shown when calculating a route. Default value
basic.netstring Routing net. Default value
undefined.tollCurrencystring Currency of the toll information displayed when calculating a route. Default value
undefined.routeStylemodule:cercaliagl/MapRouting~RouteStyleOptions Route styles.
Members
-
routeStyle_{module:cercaliagl/MapRouting~RouteStyle}
-
Formatted address.
Methods
-
Add step/waypoint marker.
Name Type Description markermodule:cercaliagl/Marker~Marker Marker
positionnumber Step position
draggedPointboolean trueif is a dragged point. -
Calculate report and handle report in a callback function.
Name Type Description callbackFnfunction Callback function.
-
Delete route from map and its markers.
-
Disable auto zoom (center to features) after draw route feature.
Name Type Description autoZoomDisabledboolean truedisables center to features after calculated route.falseactive 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.
-
Get current route styles.
-
Get the current routing options
Returns:
The current routing options configuration
-
Obtain
routingservice 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:
trueif route is logistics.
-
Clear route features from map.
-
Clear route markers from map.
-
Name Type Description indexnumber Index.
-
Select active an alternative route by index.
Name Type Description routeIndexnumber Route index
-
EXPERIMENTAL. Enable or not to draw 3D routes.Name Type Description enableboolean Enable or disable to draw 3D features
-
Update Routing widget costs.
Name Type Description consumptionnumber Consumption L/100 km. Example:
8.2.gasTypestring | undefined Gas Type. Available values:
gas95|gas98|diesel|biodiosel.gasPricenumber | undefined Gasoline price. €/L. Example:
1.51. -
Set custom callback error function. This function is called after route with errors.
Name Type Description funcfunction 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 funcfunction Custom callback function.
-
Set route draggable and its steps
Name Type Description draggableboolean Draggable
-
Update route parameter option
weight. Use this insteadsetWeightfromcercalia.service.Routing.Name Type Description reorderboolean Reorder
Returns:
Returntrueif route options has been modified
-
Set custom route styles.
Name Type Description routeStyleCustom route styles
Name Type Description strokeColorstring Route stroke colour.
outlineColorstring Route outline colour.
logisticsStrokeColorstring Logistic route stroke colour.
logisticsOutlineColorstring Logistic route outline colour.
alternativeStrokeColorstring Alternative route stroke colour.
alternativeOutlineColorstring Alternative route outline colour.
-
Name Type Description optionsRouting options
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. -
Set a routing step. It can be origin, destination or a step/waypoint.
Name Type Description stepTypemodule:cercaliagl/MapRouting~RouteMarkerType Step type. One of ORIGIN, DESTINATION, or STEP
positionmodule:cercaliagl/LonLat~LonLat Geographic position coordinate
formattedAddressstring Human-readable formatted address for the position
keepDirectionboolean (defaults to false) When true, maintains the vehicle's direction on exit. Only applicable for steps
-
Update route parameter option
weight. Use this insteadsetWeightfromcercalia.service.Routing.Name Type Description weightstring Weight
Returns:
Returntrueif route options has been modified
-
updateOptions(weight, reorder, logisticsEnabled, logisticsParams, departuretime)
-
Name Type Description weightstring Weight.
reorderboolean Optimized route.
logisticsEnabledboolean Enable or disable logistics params.
logisticsParamsmodule:cercaliagl/MapRouting~LogisticsParams Logistics params.
departuretimestring (defaults to null) Departure time
logisticsParams.vweightnumber Vehicle max wegiht
logisticsParams.vaxleweightnumber Vehicle max axle weight
logisticsParams.vheightnumber Vehicle max height
logisticsParams.vlengthnumber Vehicle max length
logisticsParams.vwidthnumber Vehicle max width
logisticsParams.vmaxvelnumber Vehicle max speed
logisticsParams.rimpboolean Dangerous goods
logisticsParams.trinfodatestring YYYYMMDD
logisticsParams.trinfodaysnumber Number days to consecutives to show restrictions.
logisticsParams.trstartnumber Avoid route restrictions. In timestamp format.
logisticsParams.adrtunnelstring Set tunnel category