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: Service

Table of Contents

Class: Service

new H.service.extension.platformData.Service (opt_options) Deprecated : since 3.1.30.12

This class encapsulates the HERE Fleet Telematics API in a service stub, providing methods to access its resources related to 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#getPlatformDataService on a platform instance.

Name Type Description
opt_options H.service.Options optional

Configuration options of the service

Throws:
Example
// Assumption: the platform is instantiated
platformDataService = platform.getPlatformDataService();

Extends

Members

H.service.extension.platformData.Service.CONFIG_KEY string Deprecated : since 3.1.63.0 staticconstant

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

H.service.extension.platformData.Service.EntryPoint string Deprecated : since 3.1.63.0 static

List of available entry points.

Properties:

H.service.extension.platformData.Service.EntryPointType string Deprecated : since 3.1.63.0 static

List of available entry point response types. Not all entry points support all types, see API Reference for more details.

Properties:

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

createTileLayer (layerConfig, options)H.map.layer.TileLayer | H.map.layer.MarkerTileLayer Deprecated : since 3.1.63.0

This method creates a tile layer which can be added to the map in order to continuously fetch and render data for the specified layer from the HERE Fleet Telematics API.

Name Type Description
layerConfig H.service.extension.platformData.LayerConfig

The configuration for the layer to load.

options H.service.extension.TileProvider.Options

The options to use when creating the tile provider.

Returns:
Type Description
H.map.layer.TileLayer | H.map.layer.MarkerTileLayer An object representing the tile layer
Example
// Assumption: the platform is instantiated
fleetService = platform.getPlatformDataService();

// Create tile layer and pass function to style map objects
tileLayer = fleetService.createTileLayer({layerId: 'PSTLCB_MP', level: 12}, {
  resultType: H.service.extension.TileProvider.ResultType.MARKER
});

// Add layer to the map
map.addLayer(tileLayer);

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.

request (entryPoint, entryPointType, params, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

This method sends a request to a resource with the provided name and type from the HERE Fleet Telematics API.

Returns:
Type Description
H.util.ICancelable request handle
Example
// Fetching documentation 'doc/maps' resource in txt format
// Assumption: the platform is instantiated
var service = platform.getPlatformDataService();
service.request(
    H.service.extension.platformData.Service.EntryPoint.DOC_MAPS,
    H.service.extension.platformData.Service.EntryPointType.TXT, {},
    console.log, console.error);

searchByBoundingBox (layerIds, keyAttributes, boundingBox, onResult, onError, opt_params)H.util.ICancelable Deprecated : since 3.1.63.0

To search for data layer entries within a rectangular geographical area. See bounding box search details in the API Reference. for more details.

Throws:

If passed arguments are invalid

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

searchByCorridor (layerIds, keyAttributes, corridor, radius, onResult, onError, opt_params)H.util.ICancelable Deprecated : since 3.1.63.0

To search for data layer entries that are within a given radius along a polyline. See corridor polygon search details in the API Reference. for more details.

Throws:

if the passed parameters have invalid type.

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

searchByProximity (layerIds, keyAttributes, center, radius, onResult, onError, opt_params)H.util.ICancelable Deprecated : since 3.1.63.0

To search for data layer entries that are within a given radius around a specified geographical center. See proximity search details in the API Reference.

Throws:

if the passed parameters have invalid type.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the search request.
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert