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:
Name Description
DOC_ATTRIBUTES
DOC_LAYER
DOC_LAYERS
DOC_MAPS
DOC_INDEXES
SEARCH_BBOX
SEARCH_CORRIDOR
SEARCH_PROXIMITY
SEARCH_QUADKEY
SERVICE_CONFIGURATION
STATIC
TILE
TILES
FILE
INDEX

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:
Name Description
TXT
JSON
HTML
BIN

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

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.

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

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.

Name Type Description
entryPoint H.service.extension.platformData.Service.EntryPoint

The entry point of the API.

entryPointType H.service.extension.platformData.Service.EntryPointType

The response type for the entry point.

params H.service.ServiceParameters

A key-value map of query parameters to use for the 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)

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.

Name Type Description
layerIds Array.<string>

The IDs of the layers to search in.

keyAttributes Array.<string>

The list of the key columns, one for each layer, ordered according to the order of the layers in the layerIds argument. The key column is used to identify all entry fragments (stored on different tiles within the database) that belong to an identical entry.

boundingBox H.geo.Rect

The geographical area where to search.

onResult function(!Array.<!H.service.extension.dataView.IRow.<*>>, boolean)

The callback to invoke when a chunk of data is received. The following arguments are passed:

  1. The list of received entries of the data layer.
  2. An indicator whether it's the last chunk.
onError function(Error)

The callback to invoke when an error occurred.

opt_params H.service.ServiceParameters optional

A key-value map of query parameters to use for the search. A query parameter has a higher priority than a value provided by an according method argument.

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.

Name Type Description
layerIds Array.<string>

The IDs of the layers to search in.

keyAttributes Array.<string>

The list of the key columns, one for each layer, ordered according to the order of the layers in the layerIds argument. The key column is used to identify all entry fragments (stored on different tiles within the database) that belong to an identical entry.

corridor H.geo.LineString | string

The center line of the corridor. Either defined as a H.geo.LineString or as a RouteId string that was obtained from a previous Router call. See H.service.RoutingService#calculateRoute or Routing API CalculateRouteResponseType.

radius number

The radius of the corridor in meters.

onResult function(!Array.<!H.service.extension.dataView.IRow.<*>>, boolean)

The callback to invoke when a chunk of data is received. The following arguments are passed:

  1. The list of received entries of the data layer.
  2. An indicator whether it's the last chunk.
onError function(Error)

The callback to invoke when an error occurred.

opt_params H.service.ServiceParameters optional

A key-value map of query parameters to use for the search. A query parameter has a higher priority than a value provided by an according method argument.

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.

Name Type Description
layerIds Array.<string>

The IDs of the layers to search in.

keyAttributes Array.<string>

The list of the key columns, one for each layer, ordered according to the order of the layers in the layerIds argument. The key column is used to identify all entry fragments (stored on different tiles within the database) that belong to an identical entry.

center H.geo.Point

The geographical point to search around.

radius number

The search radius in meters.

onResult function(!Array.<!H.service.extension.dataView.IRow.<*>>, boolean)

The callback to invoke when a chunk of data is received. The following arguments are passed:

  1. The list of received entries of the data layer.
  2. An indicator whether it's the last chunk.
onError function(Error)

The callback to invoke when an error occurred.

opt_params H.service.ServiceParameters optional

A key-value map of query parameters to use for the search. A query parameter has a higher priority than a value provided by an according method argument.

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.