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:
Name Description
LAYERS_DELETE
LAYERS_GRANT
LAYERS_LIST
LAYERS_MODIFY
LAYERS_UPLOAD
LAYERS_IMPORT
SEARCH_ALL
SEARCH_BBOX
SEARCH_CORRIDOR
SEARCH_PROXIMITY
SEARCH_QUADKEY
SEARCH_TILE

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.

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

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

To append rows to the data layers.

Name Type Description
rows Array.<!H.service.extension.customLocation.Table.Row>

The data rows to append. All rows must have a GEOMETRY_ID cell whose value is null or an empty string.

onResult function(!Array.<!H.service.extension.customLocation.Table.Row>, boolean)

The callback to invoke when a chunk is processed. The following arguments are passed:

  • The list of processed rows.
  • An indicator whether it's the last chunk.
onError function(Error, A.<!H.service.extension.customLocation.Table.Row>, boolean)

The callback to invoke when an error occurred. The following arguments are passed:

  • The occurred error.
  • The list of rows of the chunk which caused the error.
  • An indicator whether it's the last chunk.
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.

Name Type Description
metaInfo H.service.extension.customLocation.MetaInfo

The meta information for the layer

onResult function(H.service.extension.customLocation.Table)

The callback to invoke when the layer could be created.

onError function(Error)

The callback to invoke if an error occurs.

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.

Name Type Description
layerId string

The ID of the data layer to delete.

onResult function(H.service.ServiceResult)

The callback to invoke if the layer could be deleted.

onError function(Error)

The callback to invoke if an error occurs.

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.

Name Type Description
rows Array.<!H.service.extension.customLocation.Table.Row>

The data rows to delete. All rows must have a defined GEOMETRY_ID cell.

onResult function(!Array.<!H.service.extension.customLocation.Table.Row>, boolean)

The callback to invoke when a chunk is processed. The following arguments are passed:

  • The list of processed rows.
  • An indicator whether it's the last chunk.
onError function(Error, A.<!H.service.extension.customLocation.Table.Row>, boolean)

The callback to invoke when an error occurred. The following arguments are passed:

  • The occurred error.
  • The list of rows of the chunk which caused the error.
  • An indicator whether it's the last chunk.
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.

Name Type Description
layerId string

The ID of the requested layer.

onResult function(H.service.extension.customLocation.Table)

The callback to invoke if the meta information could be fetched. It gets a Table, that represents the requested data layer, as argument.

onError function(Error)

The callback to invoke if an error occurs.

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.

Name Type Description
layerId string

The ID of the layer.

grants Array.<!H.service.extension.customLocation.Grant>

The grants for other App-IDs to access the layer.

onResult function(H.service.extension.customLocation.Table)

The callback to invoke if the access is granted.

onError function(Error)

The callback to invoke if an error occurs.

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.

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.customLocation.Service.EntryPoint

The entry point of the API.

entryPointType H.service.extension.customLocation.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, or server error)

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).

Name Type Description
layerId string

The ID of the data layer to download.

onResult function(!Array.<!H.service.extension.customLocation.Table.Row>, 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.

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.

Name Type Description
layerIds Array.<string>

The IDs of the layers to search in.

boundingBox H.geo.Rect

The geographical area where to search.

onResult function(!Array.<!H.service.extension.customLocation.Table.Row>, 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.

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.

Name Type Description
layerIds Array.<string>

The IDs of the layers to search in.

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.customLocation.Table.Row>, 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, 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.

center H.geo.Point

The geographical point to search around.

radius number

The search radius in meters.

onResult function(!Array.<!H.service.extension.customLocation.Table.Row>, 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 proximity 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.

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

To update rows of the data layers.

Name Type Description
rows Array.<!H.service.extension.customLocation.Table.Row>

The data rows to update. All rows must have an defined GEOMETRY_ID cell.

onResult function(!Array.<!H.service.extension.customLocation.Table.Row>, boolean)

The callback to invoke when a chunk is processed. The following arguments are passed:

  • The list of processed rows.
  • An indicator whether it's the last chunk.
onError function(Error, A.<!H.service.extension.customLocation.Table.Row>, boolean)

The callback to invoke when an error occurred. The following arguments are passed:

  • The occurred error.
  • The list of rows of the chunk which caused the error.
  • An indicator whether it's the last chunk.
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"'})