multiRouter.pedestrian.PathModel

Note

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

Extends IEventEmitter.

A data model of the pedestrian route. A single route can contain several paths, and each path connects two waypoints.

Fields | Events | Methods

Creates a data model of the pedestrian route.

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 - The route type identifier; takes the value "pedestrian" for pedestrian 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.
  • 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.pedestrian.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.pedestrian.SegmentModel[]

Returns array of path segments.

getType()

String

Returns ID of the route type. For pedestrian routes, returns the string "pedestrian".

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 - The route type identifier; takes the value "pedestrian" for pedestrian 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.
  • 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.pedestrian.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.pedestrian.SegmentModel[]} getSegments()

Returns array of path segments.

getType

{String} getType()

Returns ID of the route type. For pedestrian routes, returns the string "pedestrian".

update

{} update(pathJson)

Updates the state of the model.

Parameters:

Parameter

Default value

Description

pathJson*

—

Type: Object

JSON data.

* Mandatory parameter/option.