Class: Service

Class: Service

Class: Service

new H.service.mapAttributes.Service (regionCode, opt_options)

This class encapsulates the HERE Map Attributes API v8 in a service stub, providing methods to access HERE map data and customers' private map data.

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

Name Type Description
regionCode string

The region code to use for the Service's default configuration.

opt_options H.service.Options

Configuration options for the service.

Throws:

If instantiated directly.

Type
H.lang.IllegalOperationError
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();

Extends

Members

H.service.mapAttributes.Service.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.

getAllAttributes (onResult, onError, opt_params)H.util.ICancelable

This method sends a GET request to "List the layer attributes across all layers" endpoint.

It 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 HERE Map Attributes API v8 documentation for information on available parameters and the response object structure.

Name Type Description
onResult function(H.service.ServiceResult)

A callback function to be called with the response schema list.

onError function(Error)

A callback function to be called in case of a failed request.

opt_params H.service.ServiceParameters optional

Contains service parameters to be sent with the request as query parameters.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAllAttributes(
 console.log, console.error
);

getAllLayers (onResult, onError, opt_params)H.util.ICancelable

This method sends a GET request to "List available map layers" endpoint.

It 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 HERE Map Attributes API v8 documentation for information on available parameters and the response object structure.

Name Type Description
onResult function(H.service.ServiceResult)

A callback function to be called with the response schema list.

onError function(Error)

A callback function to be called in case of a failed request.

opt_params H.service.ServiceParameters optional

Contains service parameters to be sent with the request as query parameters.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAllLayers(
 console.log, console.error
);

getAllMaps (onResult, onError, opt_params)H.util.ICancelable

This method sends a GET request to "List available maps" endpoint.

It 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 HERE Map Attributes API v8 documentation for information on available parameters and the response object structure.

Name Type Description
onResult function(H.service.ServiceResult)

A callback function to be called with the response schema list.

onError function(Error)

A callback function to be called in case of a failed request.

opt_params H.service.ServiceParameters optional

Contains service parameters to be sent with the request as query parameters.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAllMaps(
 console.log, console.error
);

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

This method sends a GET request to "Simple and fast search" endpoint.

It 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 HERE Map Attributes 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 as query parameters.

onResult function(H.service.ServiceResult)

A callback function to be called with the response.

onError function(Error)

A callback function to be called in case of failed request.

Throws:

If passed arguments are invalid.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAttributes({
   layers: 'ADAS_ATTRIB_FC4',
   in: 'proximity:41.9,12.5;r=150'
 },
 console.log, console.error
);

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

This method sends a GET request to "Map Attributes along a route path" endpoint.

It 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 HERE Map Attributes 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 as query parameters.

onResult function(H.service.ServiceResult)

A callback function to be called with the response.

onError function(Error)

A callback function to be called in case of failed request.

Throws:

If passed arguments are invalid or mixed.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAttributesAlongPath({
   segmentRefs: '$1:87628529#0..725739',
   attributes: 'ROAD_GEOM_FCn(*),ROAD_NAME_FCn(NAMES)'
 },
 console.log, console.error
);

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

This method sends a GET request to "Retrieve the POIs reachable within a certain time or distance from the main route" endpoint.

It 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 HERE Map Attributes 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 as query parameters.

onResult function(H.service.ServiceResult)

A callback function to be called with the response.

onError function(Error)

A callback function to be called in case of failed request.

Throws:

If passed arguments are invalid or mixed.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAttributesForRoute({
   waypoint0: '50.11208,8.68341',
   waypoint1: '49.87264,8.65013',
   layer_ids: 'LINK_FCN',
   max_detour_time: 60
 },
 console.log, console.error
);

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

This method sends a GET request to "Map Attributes for individual segments" endpoint.

It 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 HERE Map Attributes 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 as query parameters.

onResult function(H.service.ServiceResult)

A callback function to be called with the response.

onError function(Error)

A callback function to be called in case of failed request.

Throws:

If passed arguments are invalid.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getAttributesForSegments({
   segmentRefs: 'here:cm:segment:87628529#0..725739;here:cm:segment:851632317#-0..1',
   attributes: 'SPEED_LIMITS_FCn(*),ROAD_GEOM_FCn(TUNNEL)'
 },
 console.log, console.error
);

getLayerIndexes (onResult, onError, opt_params)H.util.ICancelable

This method sends a GET request to "List available layer indexes" endpoint.

It 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 HERE Map Attributes API v8 documentation for information on available parameters and the response object structure.

Name Type Description
onResult function(H.service.ServiceResult)

A callback function to be called with the response schema list.

onError function(Error)

A callback function to be called in case of a failed request.

opt_params H.service.ServiceParameters optional

Contains service parameters to be sent with the request as query parameters.

Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the request.
Example
// Assumption: the platform is instantiated
const mapAttributesService = platform.getMapAttributesService();
mapAttributesService.getLayerIndexes(
 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