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.
Creates a data model for a path on a public transport route.
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Multiroute's path data. The following fields are available:
|
||
Reference to the parent model of the route. |
Events
Name |
Description |
Updating the model with new data. Instance of the Event class. Names of fields that are available via the Event.get method:
|
Methods
Name |
Returns |
Description |
destroy() |
Destroys a model. |
|
(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. |
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 "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
{multiRouter.masstransit.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.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:
Parameter |
Default value |
Description |
— |
Type: Object JSON data. |
* Mandatory parameter/option.
Mandatory parameter/option.