multiRouter.masstransit.TransferSegmentModel
Note
The constructor of the multiRouter.masstransit.TransferSegmentModel class is hidden, as this class is not intended for autonomous initialization.
Extends IEventEmitter.
Data model for a transfer segment of a path on a public transport route. A segment of a path on a public transport route is part of a path from one stop to another.
Creates the data model for a transfer segment of a path on a public transport route.
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
||
Geometry of a segment. |
||
Reference to the parent model of the path. |
||
Segment data. The following fields are available:
|
Events
Name |
Description |
Updating the model with new data. Instance of the Event class. |
Methods
Name |
Returns |
Description |
Updates the state of the model. |
||
getType() |
String |
Returns ID of the segment type. For transfer segments on public transport routes, it returns the string "transfer". |
Fields details
geometry
{geometry.base.LineString} geometry
Geometry of a segment.
path
{multiRouter.masstransit.PathModel} path
Reference to the parent model of the path.
properties
{data.Manager} properties
Segment data. The following fields are available:
- index: Integer - The ordinal number of the segment in the array of segments of the corresponding route path.
- type: String - Segment type identifier, which takes the value "transfer" for transfer segments.
- text: String - Text description of the segment.
- distance: Object - An object with the "text" and "value" fields that specifies the length of the segment in meters.
- duration: Object - An object with the "text" and "value" fields that specifies the travel time of the segment in seconds.
- lodIndex: Integer - The ordinal number of the first throughpoint of the segment in the full set of coordinates of the corresponding route path.
Events details
update
Updating the model with new data. Instance of the Event class.
Methods details
destroy
{} destroy(segmentJson)
Updates the state of the model.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Object JSON data. |
* Mandatory parameter/option.
getType
{String} getType()
Returns ID of the segment type. For transfer segments on public transport routes, it returns the string "transfer".
Mandatory parameter/option.