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 marker
cercalia.Marker Marker
position
number Step position
draggedPoint
boolean true
if 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 autoZoomDisabled
boolean true
disables center to features after calculated route.false
active 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
type
property.Name Type Description event
Object | 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 key
string 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:
true
if 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 type
string | Array.<string> The event type or array of event types.
listener
function The listener function.
this
Object The object to use as
this
inlistener
.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 type
string | Array.<string> The event type or array of event types.
listener
function The listener function.
this
Object The object to use as
this
inlistener
.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 index
number Index.
-
Sets a value.
Name Type Description key
string Key name.
value
* Value.
silent
boolean Update without triggering an event.
-
setAddedCosts(consumption, gasType, gasPrice)
src/cercalia/maprouting.js, line 1021 -
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
. -
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 func
function 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 func
function Custom callback function.
-
setDraggable(draggable)
src/cercalia/maprouting.js, line 298 -
Set route draggable and its steps
Name Type Description draggable
boolean 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 values
Values.
silent
boolean 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 insteadsetWeight
fromcercalia.service.Routing
.Name Type Description reorder
boolean Reorder
originIsDepot
boolean 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.destinationIsDepot
boolean 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:
Returntrue
if route options has been modified
-
setRoutingStep(stepType, position, opt_formattedAddress, showLabel)
src/cercalia/maprouting.js, line 781 -
Name Type Description stepType
string Step type. Values
origin, destination, step
.position
cercalia.LonLat Position
formattedAddress
string Formatted address.
showLabel
boolean Show label.
-
setVisibleArrows(show)
src/cercalia/maprouting.js, line 749 -
Name Type Description show
boolean true
to show arrows. Elsefalse
. -
setWeight(weight){boolean}
src/cercalia/maprouting.js, line 1001 -
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
-
Unlisten for a certain type of event.
Name Type Description type
string | Array.<string> The event type or array of event types.
listener
function The listener function.
this
Object The object which was used as
this
by thelistener
. -
Unsets a property.
Name Type Description key
string Key name.
silent
boolean Unset without triggering an event.
-
updateOptions(weight, reorder, logisticsEnabled, opt_logisticsParams, opt_departuretime)
src/cercalia/maprouting.js, line 1072 -
Name Type Description weight
string Weight.
reorder
boolean Optimized route.
logisticsEnabled
boolean Enable or disable logistics params.
logisticsParams
Logistics params.
Name Type Description vaxleweight
number | undefined Maximum axle weight.
vheight
number | undefined Maximum height.
vlength
number | undefined Maximum length.
vwidth
number | undefined Maximum width.
vmaxvel
number | undefined Maximum speed.
rimp
boolean | undefined Dangerous goods.
trinfodate
string | undefined YYYYMMDD
trinfodays
number | undefined Number days to consecutives to show restrictions.
trstart
number | undefined Avoid route restrictions. In timestamp format.
departuretime
string Departure time