multiRouter.driving.PathModel

Note

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

Extends IEventEmitter.

Data model for the path of a driving route. A single route can contain several paths, and each path connects two waypoints.

Fields | Events | Methods

Creates the data model of a driving route path.

Fields

Name

Type

Description

events

IEventManager

Event manager.

Inherited from IEventEmitter.

properties

data.Manager

Multiroute's path data. The following fields are available:

  • index: Integer - The sequential number of the path in the multiroute's corresponding route.
  • type: String - Route type identifier, which takes the value "driving" for automobile routes.
  • distance: Object - An object with the "text" and "value" fields that describes the length of the path in meters.
  • duration: Object - An object with the "text" and "value" fields that describes the travel time of the path in seconds.
  • durationInTraffic: Object - An object with the "text" and "value" fields that specifies the travel time of the path (in seconds) considering traffic.
  • coordinates: Number[][] - Coordinates of all points on the path.
  • encodedCoordinates: String - A string of base64-encoded coordinates for all points on the path.

route

multiRouter.driving.RouteModel

Reference to the parent model of 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:

  • segmentsChange: Boolean - Flag for whether the set of segments is changed

Methods

Name

Returns

Description

destroy()

Destroys a model.

getSegments()

multiRouter.driving.SegmentModel[]

Returns array of path segments.

getType()

String

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

update(pathJson)

Updates the state of the model.

Fields details

properties

{data.Manager} properties

Multiroute's path data. The following fields are available:

  • index: Integer - The sequential number of the path in the multiroute's corresponding route.
  • type: String - Route type identifier, which takes the value "driving" for automobile routes.
  • distance: Object - An object with the "text" and "value" fields that describes the length of the path in meters.
  • duration: Object - An object with the "text" and "value" fields that describes the travel time of the path in seconds.
  • durationInTraffic: Object - An object with the "text" and "value" fields that specifies the travel time of the path (in seconds) considering traffic.
  • coordinates: Number[][] - Coordinates of all points on the path.
  • encodedCoordinates: String - A string of base64-encoded coordinates for all points on the path.

route

{multiRouter.driving.RouteModel} route

Reference to the parent model of 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:

  • segmentsChange: Boolean - Flag for whether the set of segments is changed

Methods details

destroy

{} destroy()

Destroys a model.

getSegments

{multiRouter.driving.SegmentModel[]} getSegments()

Returns array of path segments.

getType

{String} getType()

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

update

{} update(pathJson)

Updates the state of the model.

Parameters:

Parameter

Default value

Description

pathJson*

—

Type: Object

JSON data.

* Mandatory parameter/option.