Documentation
Reference
2.1.56 (current version)
collection
interactivityModel
Interfaces

multiRouter.masstransit.TransportSegmentModel

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

Extends IEventEmitter.

Data model for a transportation 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.

Fields | Events | Methods

Creates a data model for a transportation segment of a path on a public transport route.

Fields

NameTypeDescription
eventsIEventManager

Event manager.

Inherited from IEventEmitter.

geometrygeometry.base.LineString

Geometry of a segment.

pathmultiRouter.masstransit.PathModel

Reference to the parent model of the path.

propertiesdata.Manager

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.
  • String - Segment type identifier, which takes the value "transport" for transport segments.
  • text: String - Text description of the segment.
  • transports: ITransportProperties[] - An array describing the specific forms of transport available for traveling on this segment.
  • stops: Object - Description of stops in the format GeoJson:FeatureCollection.
  • 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

NameDescription
update

Updating the model with new data. Instance of the Event class.

Methods

NameReturnsDescription
destroy()

Destroys a model.

getStops()

multiRouter.masstransit.StopModel[]

Returns array of stops on a transport route.

getType()

String

Returns ID of the segment type. For transport segments on public transport routes, it returns the string "transport".

update(segmentJson)

Updates the state of the model.

Fields details

geometry

Geometry of a segment.

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.
  • String - Segment type identifier, which takes the value "transport" for transport segments.
  • text: String - Text description of the segment.
  • transports: ITransportProperties[] - An array describing the specific forms of transport available for traveling on this segment.
  • stops: Object - Description of stops in the format GeoJson:FeatureCollection.
  • 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()

Destroys a model.

getStops

Returns array of stops on a transport route.

getType

{String} getType()

Returns ID of the segment type. For transport segments on public transport routes, it returns the string "transport".

update

{} update(segmentJson)

Updates the state of the model.

Parameters:

ParameterDefault valueDescription
segmentJson*
[no-highlight[

* Mandatory parameter/option.

]no-highlight]

Type: Object

JSON data.

* Mandatory parameter/option.