Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces
2.1.52 (release candidate)
collection
interactivityModel
Interfaces

multiRouter.masstransit.PathModel

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

Extends IEventEmitter.

Data model of a path on a public transport route. A single route can contain several paths, and each path connects two waypoints.

Fields | Events | Methods

Creates a data model for a path on a public transport route.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

propertiesdata.Manager

Multi-stop route's path data. The following fields are available:

  • index: Integer - The sequential number of the path in the multi-stop route's corresponding route.
  • type: String - Route type identifier, which takes the value "masstransit" for public transport 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.

routemultiRouter.masstransit.RouteModel

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

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

Methods

NameReturnsDescription
destroy()

Destroys a model.

getSegments()

(multiRouter.masstransit.TransferSegmentModel| multiRouter.masstransit.TransportSegmentModel| multiRouter.masstransit.WalkSegmentModel)[]

Returns array of path segments.

getType()

String

Returns ID of the route type. For public transport routes, the string "masstransit" is returned.

update(pathJson)

Updates the state of the model.

Fields details

properties

{data.Manager} properties

Multi-stop route's path data. The following fields are available:

  • index: Integer - The sequential number of the path in the multi-stop route's corresponding route.
  • type: String - Route type identifier, which takes the value "masstransit" for public transport 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

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.masstransit.TransferSegmentModel|
multiRouter.masstransit.TransportSegmentModel|
multiRouter.masstransit.WalkSegmentModel)[]} getSegments()

Returns array of path segments.

getType

{String} getType()

Returns ID of the route type. For public transport routes, the string "masstransit" is returned.

update

{} update(pathJson)

Updates the state of the model.

Parameters:

ParameterDefault valueDescription
pathJson*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

JSON data.

* Mandatory parameter/option.