Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces

multiRouter.pedestrian.RouteModel

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

Extends IEventEmitter.

A data model of a single pedestrian route. A multi-stop route can consist of several individual routes.

Fields | Events | Methods

Creates a data model of a single pedestrian route.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

multiRoutemultiRouter.MultiRouteModel

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

propertiesdata.Manager

The route data. The following fields are available:

  • index: Integer - The ordinal number of the route in a multi-stop 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 specifies the length of the route in meters.
  • duration: Object - An object with the "text" and "value" fields that describes the travel time of the route in seconds.
  • boundedBy: Number[][] - Coordinates of the upper and lower corners of the rectangle that bounds the route.

Events

NameDescription
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

NameReturnsDescription
destroy()

Destroys a model.

getPaths()

multiRouter.pedestrian.PathModel[]

Returns array of route paths.

getType()

String

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

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 - The route type identifier; takes the value "pedestrian" for pedestrian routes.
  • 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 describes the travel time of the route in seconds.
  • 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

{multiRouter.pedestrian.PathModel[]} getPaths()

Returns array of route paths.

getType

{String} getType()

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

update

{} update(routeJson)

Updates the state of the model.

Parameters:

ParameterDefault valueDescription
routeJson*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

JSON data.

* Mandatory parameter/option.