Class: WaypointsSequenceService

H.service.WaypointsSequenceService

new H.service.WaypointsSequenceService (options)

This class encapsulates the HERE Waypoints Sequence API v8 as a service stub.

It's not allowed to call the constructor directly (an IllegalOperationError is thrown). Instead an instance of this Service can be retrieved by calling the factory method H.service.Platform#getWaypointsSequenceService on a platform instance.

Name Type Description
options H.service.Options optional

Configuration options for the service

Throws:
Example
// Assumption: the platform is instantiated
const waypointsSequenceService = platform.getWaypointsSequenceService();
waypointsSequenceService.findSequence({
  start : 'WiesbadenCentralStation;50.0715,8.2434',
  destination1 : 'FranfurtCentralStation;50.1073,8.6647',
  destination2 : 'DarmstadtCentralStation;49.8728,8.6326',
  destination3 : 'FrankfurtAirport;50.0505,8.5698',
  destination4 : 'HanauCentralStation;50.1218,8.9298',
  end : 'MainzCentralStation;50.0021,8.259',
  departure: "2024-11-23T17:00:00+02:00",
  mode : 'fastest;car;traffic:enabled'
}, console.log, console.error);

Extends

Members

H.service.WaypointsSequenceService.CONFIG_KEY string staticconstant

The property name to use when specifying options for this service within the H.service.Platform.Options#servicesConfig.

Methods

addEventListener (type, handler, opt_capture, opt_scope) inherited

This method adds a listener for a specific event.

Note that to prevent potential memory leaks, you must either call removeEventListener or dispose on the given object when you no longer need it.

Name Type Description
type string

The name of the event

handler function

An event handler function

opt_capture boolean optional

true indicates that the method should listen in the capture phase (bubble otherwise)

opt_scope Object optional

An object defining the scope for the handler function

addOnDisposeCallback (callback, opt_scope) inherited

This method adds a callback which is triggered when the EventTarget object is being disposed.

Name Type Description
callback function

The callback function.

opt_scope Object optional

An optional scope for the callback function

dispatchEvent (evt) inherited

This method dispatches an event on the EventTarget object.

Name Type Description
evt H.util.Event | string

An object representing the event or a string with the event name

dispose () inherited

This method removes listeners from the given object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners.

findSequence (params, onResult, onError)H.util.ICancelable

This method sends a 'find sequence reqeuest' to the HERE Waypoints Sequence API v8 and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error or input format error occurs.

Please refer to the HERE Waypoints Sequence API v8 documentation for information on available parameters and the response object structure.

Name Type Description
params H.service.ServiceParameters

Contains service parameters to be sent with the request.

onResult function(H.service.ServiceResult)

A callback function to be called once the API provides a response to the request.

onError function(Error)

A callback function to be called if a communication error occurs during the request.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const waypointsSequenceService = platform.getWaypointsSequenceService();
waypointsSequenceService.findSequence({
  start : 'WiesbadenCentralStation;50.0715,8.2434',
  destination1 : 'FranfurtCentralStation;50.1073,8.6647',
  destination2 : 'DarmstadtCentralStation;49.8728,8.6326',
  destination3 : 'FrankfurtAirport;50.0505,8.5698',
  destination4 : 'HanauCentralStation;50.1218,8.9298',
  end : 'MainzCentralStation;50.0021,8.259',
  departure : '2014-12-09T09:30:00+01:00',
  mode : 'fastest;car;traffic:enabled'
}, console.log, console.error);

This method returns the configured service URL.

Returns:
Type Description
H.service.Url

removeEventListener (type, handler, opt_capture, opt_scope) inherited

This method removes a previously added listener from the EventTarget instance.

Name Type Description
type string

The name of the event

handler function

A previously added event handler

opt_capture boolean optional

true indicates that the method should listen in the capture phase (bubble otherwise)

opt_scope Object optional

An object defining the scope for the handler function