new cercalia.MapRouting(opt_options)
| Name | Type | Description | ||
|---|---|---|---|---|
options |
Options
|
|||
Fires:
-
change(ol.events.Event) - Generic change event. Triggered when the revision counter is increased. -
propertychange(ol.Object.Event) - Triggered when a property is changed.
Extends
Classes
Methods
-
addMarkerStep(marker, opt_position, opt_draggedPoint)
src/cercalia/maprouting.js, line 585 -
Name Type Description markercercalia.Marker Marker
positionnumber Step position
draggedPointboolean trueif is a dragged point. -
calculateOptimizedRoute()
src/cercalia/maprouting.js, line 912 -
Force to calculate route although origin and destination have not been reported, but one of both.
This method is useful when the 'reorder' option is activated including to 'originisdepot' or 'destinationisdepot' -
calculateReport()
src/cercalia/maprouting.js, line 840 -
Calculate report. Origin and destination must be set previously.
-
Increases the revision counter and dispatches a 'change' event.
-
cleanRoute()
src/cercalia/maprouting.js, line 1387 -
Delete route from map and its markers.
-
disableAutoZoom(autoZoomDisabled)
src/cercalia/maprouting.js, line 1125 -
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. -
disableRightClickMenu()
src/cercalia/maprouting.js, line 469 -
Disable right click context menu. It is enabled by default.
-
Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a
typeproperty.Name Type Description eventObject | ol.events.Event | string Event object.
-
enableRightClickMenu()
src/cercalia/maprouting.js, line 459 -
Enable right click context menu. It is enabled by default.
-
Gets a value.
Name Type Description keystring Key name.
Returns:
Value.
-
getFeatures(){}
src/cercalia/maprouting.js, line 601 -
Returns:
Array feature.
-
Get a list of object property names.
Returns:
List of property names.
-
Get an object of all property names and values.
Returns:
Object.
-
Get the version number for this object. Each time the object is modified, its version number will be incremented.
Returns:
Revision.
-
Returns:
Routing service
-
getWKT(){string|null}
src/cercalia/maprouting.js, line 1443 -
Returns:
WKT.
-
invert()
src/cercalia/maprouting.js, line 1480 -
Invert origin and destination.
-
isActive(){boolean}
src/cercalia/maprouting.js, line 1426 -
Return if MapRouting is active
Returns:
`truè if map routing is actived.
-
isLogistics(){boolean}
src/cercalia/maprouting.js, line 1599 -
Returns:
trueif route is logistics.
-
on(type, listener, opt_this){ol.EventsKey|Array.<ol.EventsKey>} inherited
src/ol/observable.js, line 99 -
Listen for a certain type of event.
Name Type Description typestring | Array.<string> The event type or array of event types.
listenerfunction The listener function.
thisObject The object to use as
thisinlistener.Returns:
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
-
once(type, listener, opt_this){ol.EventsKey|Array.<ol.EventsKey>} inherited
src/ol/observable.js, line 124 -
Listen once for a certain type of event.
Name Type Description typestring | Array.<string> The event type or array of event types.
listenerfunction The listener function.
thisObject The object to use as
thisinlistener.Returns:
Unique key for the listener. If called with an array of event types as the first argument, the return will be an array of keys.
-
removeFeatures()
src/cercalia/maprouting.js, line 734 -
Clear route features from map.
-
removeMarkers()
src/cercalia/maprouting.js, line 689 -
Clear route markers from map.
-
removeStepIndex(index)
src/cercalia/maprouting.js, line 493 -
Name Type Description indexnumber Index.
-
Sets a value.
Name Type Description keystring Key name.
value* Value.
silentboolean Update without triggering an event.
-
setAddedCosts(consumption, gasType, gasPrice)
src/cercalia/maprouting.js, line 1021 -
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. -
setCustomCallbackFunction(func)
src/cercalia/maprouting.js, line 1106 -
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.
-
setCustomReportCallbackFunction(func)
src/cercalia/maprouting.js, line 1116 -
Set custom callback function. This function is called after report calculation Setting null, it disables previous custom function.
Name Type Description funcfunction Custom callback function.
-
setDraggable(draggable)
src/cercalia/maprouting.js, line 298 -
Set route draggable and its steps
Name Type Description draggableboolean Draggable
-
Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties).
Name Type Description valuesValues.
silentboolean Update without triggering an event.
-
setReorder(reorder, opt_originIsDepot, opt_destinationIsDepot){boolean}
src/cercalia/maprouting.js, line 1037 -
Update route parameter option
weight. Use this insteadsetWeightfromcercalia.service.Routing.Name Type Description reorderboolean Reorder
originIsDepotboolean This parameter only works if REORDER parameter is used. Values:
true: 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: 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.Returns:
Returntrueif route options has been modified
-
setRoutingStep(stepType, position, opt_formattedAddress, showLabel)
src/cercalia/maprouting.js, line 781 -
Name Type Description stepTypestring Step type. Values
origin, destination, step.positioncercalia.LonLat Position
formattedAddressstring Formatted address.
showLabelboolean Show label.
-
setVisibleArrows(show)
src/cercalia/maprouting.js, line 749 -
Name Type Description showboolean trueto show arrows. Elsefalse. -
setWeight(weight){boolean}
src/cercalia/maprouting.js, line 1001 -
Update route parameter option
weight. Use this insteadsetWeightfromcercalia.service.Routing.Name Type Description weightstring Weight
Returns:
Returntrueif route options has been modified
-
Unlisten for a certain type of event.
Name Type Description typestring | Array.<string> The event type or array of event types.
listenerfunction The listener function.
thisObject The object which was used as
thisby thelistener. -
Unsets a property.
Name Type Description keystring Key name.
silentboolean Unset without triggering an event.
-
updateOptions(weight, reorder, logisticsEnabled, opt_logisticsParams, opt_departuretime)
src/cercalia/maprouting.js, line 1072 -
Name Type Description weightstring Weight.
reorderboolean Optimized route.
logisticsEnabledboolean Enable or disable logistics params.
logisticsParamsLogistics params.
Name Type Description vaxleweightnumber | undefined Maximum axle weight.
vheightnumber | undefined Maximum height.
vlengthnumber | undefined Maximum length.
vwidthnumber | undefined Maximum width.
vmaxvelnumber | undefined Maximum speed.
rimpboolean | undefined Dangerous goods.
trinfodatestring | undefined YYYYMMDD
trinfodaysnumber | undefined Number days to consecutives to show restrictions.
trstartnumber | undefined Avoid route restrictions. In timestamp format.
departuretimestring Departure time