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.customLocation.Service (opt_options) Deprecated : since 3.1.30.12

This class provides methods for creation, modification and fetching of the custom data layers using HERE Fleet Telematics API. 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#getCustomLocationService 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
fleetService = platform.getCustomLocationService();

Extends

Members

H.service.extension.customLocation.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.customLocation.Service.EntryPoint string Deprecated : since 3.1.63.0 staticconstant

List of available entry points scoped to the custom layer creation, modification, fetching and search.

Properties:

H.service.extension.customLocation.Service.EntryPointType string Deprecated : since 3.1.63.0 staticconstant

The available response type formats of the HERE Fleet Telematics API. Not all entry points support all types, see API Reference for more details.

Properties:
Name Description
TXT
JSON

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

appendRows (rows, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To append rows to the data layers.

See:
Throws:

if rows with defined GEOMETRY_ID are passed or if the onResult or onError callback is not valid.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the delete request.
Example
function onResult(table) {
  var row = table.addRow();
  row.setCell('COMPANY', 'HERE Technologies');
  row.setCell('WKT', new H.geo.Point(52.5309, 13.3849));
  fleetService.appendRows([row], console.log, console.error);
}
fleetService.getLayer('MY_LAYER', onResult, console.error);

createLayer (metaInfo, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To create a new custom data layer on the HERE Fleet Telematics API. Provides a Table instance in response, that represents the created layer. The operation fails (onError is triggered) if the layer already exists or the provided meta information contains invalid properties.

Throws:

if the provided meta information or one of the callbacks is invalid.

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

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

To create a tile layer which can be added to the map in order to visualize data from the specified custom data layer.

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

The configuration for the data layer to load.

options H.service.extension.TileProvider.Options

The options to configure the tile provider.

Returns:
Type Description
H.map.layer.TileLayer | H.map.layer.MarkerTileLayer The created tile layer.
Example
// Assumption: The platform is already instantiated and a layer with ID "LAYER1" exists on the
// HERE Fleet Telematics backend:
fleetService = platform.getCustomLocationService();

// Create a tile layer:
tileLayer = fleetService.createTileLayer({layerId: 'LAYER1'}, {
  resultType: H.service.extension.TileProvider.ResultType.MARKER
});
// Add the tile layer to the map
map.addLayer(tileLayer);

deleteLayer (layerId, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To delete an existing custom data layer from the HERE Fleet Telematics API.

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

deleteRows (rows, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To delete rows from the data layer.

See:
Throws:

if several rows with the same GEOMETRY_ID have been passed, if rows without defined GEOMETRY_ID are passed or if the onResult or onError callback is not valid.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the delete request.
Example
// Precondition: There is only one entry in the layer that has a COMPANY value of "HERE Technologies"
function onResult(rows, isLastChunk) {
  fleetService.deleteRows(rows, console.log, console.error);
}
fleetService.searchAll("MY_LAYER', onResult, console.error, {filter: 'COMPANY === "HERE Technologies"'})

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.

getLayer (layerId, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To fetch the meta information for a custom data layer from the HERE Fleet Telematics API and create a Table instance, that represents the requested layer, to work with.

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

This method returns the configured service URL.

Returns:
Type Description
H.service.Url

grantAccess (layerId, grants, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To set the rights for other APP-IDs to access a data layer.

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

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.

See:
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
// Fetching list of layers
// Assumption: the platform is instantiated
var service = platform.getCustomLocationService();
service.request(
    H.service.extension.customLocation.Service.EntryPoint.LAYERS_LIST,
    H.service.extension.customLocation.Service.EntryPointType.JSON, {},
    console.log, console.error);

searchAll (layerId, onResult, onError, opt_params)H.util.ICancelable Deprecated : since 3.1.63.0

To search for custom geometries by attribute filter, or download a complete layer. It's possible to limit the resulting entries by different query parameters (see opt_params argument). for more details).

See:
Throws:

if the passed parameters have invalid type.

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

searchByBoundingBox (layerIds, 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 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.

searchByCorridor (layerIds, 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, 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.

updateRows (rows, onResult, onError)H.util.ICancelable Deprecated : since 3.1.63.0

To update rows of the data layers.

See:
Throws:

if several rows with the same GEOMETRY_ID have been passed, if rows without defined GEOMETRY_ID are passed or if the onResult or onError callback is not valid.

Type
H.lang.InvalidArgumentError
Returns:
Type Description
H.util.ICancelable a handle that allows to cancel the delete request.
Example
// Precondition: There is only one entry in the layer that has a COMPANY value of "HERE Technologies"
function onResult(rows, isLastChunk) {
  var row = rows[0];
  row.setCell("WKT", new H.geo.Point(52.5309, 13.3849));
  fleetService.updateRows([row], console.log, console.error);
}
fleetService.searchAll("MY_LAYER', onResult, console.error, {filter: 'COMPANY === "HERE Technologies"'})
Was this article helpful?
TitleResults for “How to create a CRG?”Also Available inAlert