Class PublicTransportRouteProvider extends BaseRouteProvider

This class implements the BaseRouteProvider for PublicTransport. It's not possible to instanciate this class because the class is not exported from the module. Only one instance is created and added to the list of Providers of TravelNotes

Source : file routeProviders/PublicTransportRouteProvider.js at line 38

Constructor

new PublicTransportRouteProvider ( )

The constructor

Source : file routeProviders/PublicTransportRouteProvider.js at line 167

Public getters and setters

readonly get icon : String

The icon used in the ProviderToolbarUI. Overload of the base class icon property

Source : file routeProviders/PublicTransportRouteProvider.js at line 189

readonly get name : String

The provider name. Overload of the base class name property

Source : file routeProviders/PublicTransportRouteProvider.js at line 203

readonly get providerKeyNeeded : Boolean

A boolean indicating when a provider key is needed for the provider. Overload of the base class providerKeyNeeded property

Source : file routeProviders/PublicTransportRouteProvider.js at line 228

readonly get title : String

The title to display in the ProviderToolbarUI button. Overload of the base class title property

Source : file routeProviders/PublicTransportRouteProvider.js at line 211

readonly get transitModes : Array of String

The possible transit modes for the provider. Overload of the base class transitModes property Must be a subarray of [ 'bike', 'pedestrian', 'car', 'train', 'line', 'circle' ]

Source : file routeProviders/PublicTransportRouteProvider.js at line 220

Public methods

getPromiseRoute ( route )

Call the provider, using the waypoints defined in the route and, on success, complete the route with the data from the provider

Source : file routeProviders/PublicTransportRouteProvider.js at line 178

Parameters

Name Type Description
route Route

The route to witch the data will be added

Returns

A Promise. On success, the Route is completed with the data given by the provider.
Type : Promise

Private properties

#route : Route

A reference to the edited route

Source : file routeProviders/PublicTransportRouteProvider.js at line 45

Private getters and setters

readonly get #relationsUrl : String

The url to use to have the relations between the start point and end point

Source : file routeProviders/PublicTransportRouteProvider.js at line 109

Private methods

#getDialogPromise ( relations )

Show a SelectDialog with all the train relations between the start point and end point

Source : file routeProviders/PublicTransportRouteProvider.js at line 78

Parameters

Name Type Description
relations Array of Object

The relations received from OSM

Returns

The Promise created by the selectDialog.show ( )
Type : Promise

#getRoute ( onOk, onError )

Call the provider, wait for the response and then parse the provider response. Notice that we have two calls to the Provider: one for the relation list and one for the ways and nodes. Notice also the dialog box between the 2 calls.

Source : file routeProviders/PublicTransportRouteProvider.js at line 129

Parameters

Name Type Description
onOk Function

A function to pass to the ourParseResponse

onError Function

A function to pass to ourParseResponse or to call when an error occurs

#getWaysNodesUrl ( relationId )

Get the url to obtains the ways and node Osm elements for the relation

Source : file routeProviders/PublicTransportRouteProvider.js at line 64

Parameters

Name Type Description
relationId Number

The osm relation id

Returns

The complete url
Type : String

#parseResponse ( waysNodes, onOk, onError )

Parse the response from the provider and add the received itinerary to the route itinerary

Source : file routeProviders/PublicTransportRouteProvider.js at line 54

Parameters

Name Type Description
waysNodes Object

The ways and nodes received from OSM

onOk Function

A function to call when the response is parsed correctly

onError Function

A function to call when an error occurs