Maps API for JavaScript Developer's Guide

H.service.extension.customRoute.Service

Class Summary

This class encapsulates the Custom Route Extension API in a service stub, providing methods to access its resources. Refer to the REST service documentation for the description of service parameters and response objects.

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

static CONFIG_KEY : {string}

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

Method Summary

Table 2. Methods
Methods

calculateRoute (params, onResult, onError)

This method sends a route calculation request to the Custom Route Extension 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.

Class Description

This class encapsulates the Custom Route Extension API in a service stub, providing methods to access its resources. Refer to the REST service documentation for the description of service parameters and response objects.

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#getCustomRoutingService on a platform instance.

Example

// Assumption: the platform is instantiated
customRoutingService = platform.getCustomRoutingService();

Constructor Details

H.service.extension.customRoute.Service(opt_options)

Parameters:
 
opt_options:
{H.service.extension.customRoute.Service.Options=} [optional]
 
Configuration options for custom route service

Property Details

static CONFIG_KEY: {string}

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

Method Details

calculateRoute (params, onResult, onError)

This method sends a route calculation request to the Custom Route Extension 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 API Documentation for information on available parameters and the response object structure.

Parameters:
 
params:
{H.service.ServiceParameters}
 
Contains the service parameters to be sent with the routing request.
onResult:
{function(H.service.ServiceResult)}
 
The callback which is called when result is returned
onError:
{function(Error)}
 
The callback which is called when error occurred (i.e request timeout, or server error)
Throws:
 
{H.lang.InvalidArgumentError}
 
If passed arguments are invalid