multiRouter.masstransit.RouteModel
Note
The constructor of the multiRouter.masstransit.RouteModel class is hidden, as this class is not intended for autonomous initialization.
Extends IEventEmitter.
Data model of an individual route of public transport. A multiroute can consist of several individual routes.
Creates the data model for an individual route of public transport.
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Reference to the parent model of a multiroute. |
||
The route data. The following fields are available:
|
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. |
|
getPaths() |
Returns array of route paths. |
|
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
multiRoute
{multiRouter.MultiRouteModel} multiRoute
Reference to the parent model of a multiroute.
properties
{data.Manager} properties
The route data. The following fields are available:
- index: Integer - The ordinal number of the route in a multiroute.
- 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 specifies the length of the route in meters.
- duration: Object - An object with the "text" and "value" fields that specifies 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.masstransit.PathModel[]} getPaths()
Returns array of route paths.
getType
{String} getType()
Returns ID of the route type. For public transport routes, the string "masstransit" is returned.
update
{} update(routeJson)
Updates the state of the model.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object JSON data. |
* Mandatory parameter/option.
Mandatory parameter/option.