multiRouter.driving.RouteModel

Note. The constructor of the multiRouter.driving.RouteModel class is hidden, as this class is not intended for autonomous initialization.

Extends IEventEmitter.

Data model for an individual driving route. A multi-stop route can consist of several individual routes.

Fields | Events | Methods

Creates the data model of an individual driving route.

Fields

Name Type Description
events IEventManager

Event manager.

Inherited from IEventEmitter.

multiRoute multiRouter.MultiRouteModel

Reference to the parent model of a multi-stop route.

properties data.Manager
The route data. The following fields are available:
  • index: Integer - The ordinal number of the route in a multi-stop route.
  • type: String - Route type identifier, which takes the value "driving" for automobile routes.
  • blocked: Boolean - Indicates that the route contains blocked sections.
  • distance: Object - An object with the "text" and "value" fields that specifies the length of the route in meters.
  • duration: Object - An object with the "text" and "value" fields that specifies the travel time of the route in seconds.
  • durationInTraffic: Object - An object with the "text" and "value" fields that specifies the travel time of the route (in seconds) considering traffic.
  • boundedBy: Number[][] - Coordinates of the upper and lower corners of the rectangle that bounds the route.

Events

Name Description
update
Updating the model with new data. Instance of the Event class. Names of fields that are available via the Event.get method:
  • pathsChange: Boolean - Flag for whether the set of paths is changed.

Methods

Name Returns Description
destroy()

Destroys a model.

getPaths()

multiRouter.driving.PathModel[]

Returns array of route paths.

getType()

String

Returns ID of the route type. For automobile routes, it returns the string "driving".

update(routeJson)

Updates the state of the model.

Fields details

multiRoute

Reference to the parent model of a multi-stop route.

properties

{data.Manager} properties
The route data. The following fields are available:
  • index: Integer - The ordinal number of the route in a multi-stop route.
  • type: String - Route type identifier, which takes the value "driving" for automobile routes.
  • blocked: Boolean - Indicates that the route contains blocked sections.
  • distance: Object - An object with the "text" and "value" fields that specifies the length of the route in meters.
  • duration: Object - An object with the "text" and "value" fields that specifies the travel time of the route in seconds.
  • durationInTraffic: Object - An object with the "text" and "value" fields that specifies the travel time of the route (in seconds) considering traffic.
  • boundedBy: Number[][] - Coordinates of the upper and lower corners of the rectangle that bounds the route.

Events details

update

Updating the model with new data. Instance of the Event class. Names of fields that are available via the Event.get method:
  • pathsChange: Boolean - Flag for whether the set of paths is changed.

Methods details

destroy

{} destroy()

Destroys a model.

getPaths

Returns array of route paths.

getType

{String} getType()

Returns ID of the route type. For automobile routes, it returns the string "driving".

update

{} update(routeJson)

Updates the state of the model.

Parameters:

Parameter Default value Description
routeJson *

Type: Object

JSON data.

* Mandatory parameter/option.