Powered by Zoomin Software. For more details please contactZoomin

HERE Maps API for JavaScript - API Reference

Product category
Technology
Doc type
Version
Product lifecycle
This publication

HERE Maps API for JavaScript - API Reference: Class: RoutingService

Table of Contents

Class: RoutingService

H.service.RoutingService

new H.service.RoutingService (opt_options) Deprecated : since 3.1.14.0

This service is no longer being actively developed. The H.service.RoutingService8 could be used instead.

This class encapsulates the Routing API v7 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#getRoutingService on a platform instance.

Name Type Description
opt_options H.service.Options optional

Configuration options for routing service

Throws:
Example
// Assumption: the platform is instantiated
const router = platform.getRoutingService();
router.calculateRoute({
  'waypoint0': 'geo!52.5,13.4',
  'waypoint1': 'geo!52.5,13.45',
  'mode': 'fastest;car;traffic:disabled'
}, (result) => console.log(result.response.route[0]), console.error);

Extends

Members

H.service.RoutingService.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.

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

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

This method sends a "calculateisoline" request to the Routing REST API 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 occurred.

Please refer to the Routing API v7 documentation for information on available parameters and the response object structure.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.

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

This method sends a "calculateroute" request to the Routing REST API 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 occurred.

Please refer to the Routing API v7 documentation for information on available parameters and the response object structure.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.

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.

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.

Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert