Class GraphHopperRouteProvider extends BaseRouteProvider

This class implements the BaseRouteProvider interface for Graphhopper.

Source : file routeProviders/GraphHopperRouteProvider.js at line 38

Constructor

new GraphHopperRouteProvider ( )

The constructor

Source : file routeProviders/GraphHopperRouteProvider.js at line 224

Public getters and setters

readonly get icon : String

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

Source : file routeProviders/GraphHopperRouteProvider.js at line 247

readonly get name : String

The provider name. Overload of the base class name property

Source : file routeProviders/GraphHopperRouteProvider.js at line 274

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/GraphHopperRouteProvider.js at line 299

set providerKey

The provider key. Overload of the base class providerKey property

Source : file routeProviders/GraphHopperRouteProvider.js at line 306

readonly get title : String

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

Source : file routeProviders/GraphHopperRouteProvider.js at line 282

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/GraphHopperRouteProvider.js at line 291

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/GraphHopperRouteProvider.js at line 236

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

#providerKey : String

The provider key. Will be set by TravelNotes

Source : file routeProviders/GraphHopperRouteProvider.js at line 45

#route : Route

A reference to the edited route

Source : file routeProviders/GraphHopperRouteProvider.js at line 52

Private getters and setters

readonly static get #ICON_LIST : Array of String

Enum for icons

Source : file routeProviders/GraphHopperRouteProvider.js at line 66

readonly static get #ROUND_VALUE : Number

The round value used by PolylineEncoder

Source : file routeProviders/GraphHopperRouteProvider.js at line 59

Private methods

#getRoute ( onOk, onError )

Overload of the base class #getRoute ( ) method

Source : file routeProviders/GraphHopperRouteProvider.js at line 200

Parameters

Name Type Description
onOk Function

The Promise Success handler

onError Function

The Promise Error handler

#getUrl ( )

Gives the url to call

Source : file routeProviders/GraphHopperRouteProvider.js at line 162

Returns

A string with the url, wayPoints, transitMode, user language and Api key
Type : String

#parseResponse ( response, onOk, onError )

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

Source : file routeProviders/GraphHopperRouteProvider.js at line 89

Parameters

Name Type Description
response JsonObject

The itinerary received from the provider

onOk Function

A function to call when the response is parsed correctly

onError Function

A function to call when an error occurs