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
-
The property name to use when specifying options for this service within the
H.service.Platform.Options#servicesConfig. -
List of available entry points scoped to the custom layer creation, modification, fetching and search.
Properties:
Name Description LAYERS_DELETELAYERS_GRANTLAYERS_LISTLAYERS_MODIFYLAYERS_UPLOADLAYERS_IMPORTSEARCH_ALLSEARCH_BBOXSEARCH_CORRIDORSEARCH_PROXIMITYSEARCH_QUADKEYSEARCH_TILE -
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 TXTJSON
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
removeEventListenerordisposeon the given object when you no longer need it.Name Type Description typestring The name of the event
handlerfunction An event handler function
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject 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
EventTargetobject is being disposed.Name Type Description callbackfunction The callback function.
opt_scopeObject 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 rowsArray.<!H.service.extension.customLocation.Table.Row> The data rows to append. All rows must have a
GEOMETRY_IDcell whose value isnullor an empty string.onResultfunction(!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.
onErrorfunction(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.
Throws:
-
if rows with defined
GEOMETRY_IDare passed or if theonResultoronErrorcallback is not valid.
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
Tableinstance in response, that represents the created layer. The operation fails (onErroris triggered) if the layer already exists or the provided meta information contains invalid properties.Name Type Description metaInfoH.service.extension.customLocation.MetaInfo The meta information for the layer
onResultfunction(H.service.extension.customLocation.Table) The callback to invoke when the layer could be created.
onErrorfunction(Error) The callback to invoke if an error occurs.
Throws:
-
if the provided meta information or one of the callbacks is invalid.
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 layerConfigH.service.extension.customLocation.LayerConfig The configuration for the data layer to load.
optionsH.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 layerIdstring The ID of the data layer to delete.
onResultfunction(H.service.ServiceResult) The callback to invoke if the layer could be deleted.
onErrorfunction(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 rowsArray.<!H.service.extension.customLocation.Table.Row> The data rows to delete. All rows must have a defined GEOMETRY_ID cell.
onResultfunction(!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.
onErrorfunction(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.
Throws:
-
if several rows with the same
GEOMETRY_IDhave been passed, if rows without definedGEOMETRY_IDare passed or if theonResultoronErrorcallback is not valid.
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
EventTargetobject.Name Type Description evtH.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
EventTargetmay 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
Tableinstance, that represents the requested layer, to work with.Name Type Description layerIdstring The ID of the requested layer.
onResultfunction(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.onErrorfunction(Error) The callback to invoke if an error occurs.
Returns:
Type Description H.util.ICancelable a handle that allows to cancel the request. -
getUrl ()H.service.Url inherited
-
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 layerIdstring The ID of the layer.
grantsArray.<!H.service.extension.customLocation.Grant> The grants for other App-IDs to access the layer.
onResultfunction(H.service.extension.customLocation.Table) The callback to invoke if the access is granted.
onErrorfunction(Error) The callback to invoke if an error occurs.
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
EventTargetinstance.Name Type Description typestring The name of the event
handlerfunction A previously added event handler
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject 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 entryPointH.service.extension.customLocation.Service.EntryPoint The entry point of the API.
entryPointTypeH.service.extension.customLocation.Service.EntryPointType The response type for the entry point.
paramsH.service.ServiceParameters A key-value map of query parameters to use for the request.
onResultfunction(H.service.ServiceResult) The callback which is called when result is returned.
onErrorfunction(Error) The callback which is called when error occurred (i.e request timeout, or server error)
Throws:
-
If passed arguments are invalid
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_paramsargument). for more details).Name Type Description layerIdstring The ID of the data layer to download.
onResultfunction(!Array.<!H.service.extension.customLocation.Table.Row>, boolean) The callback to invoke when a chunk of data is received. The following arguments are passed:
- The list of received entries of the data layer.
- An indicator whether it's the last chunk.
onErrorfunction(Error) The callback to invoke when an error occurred.
opt_paramsH.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.
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 layerIdsArray.<string> The IDs of the layers to search in.
boundingBoxH.geo.Rect The geographical area where to search.
onResultfunction(!Array.<!H.service.extension.customLocation.Table.Row>, boolean) The callback to invoke when a chunk of data is received. The following arguments are passed:
- The list of received entries of the data layer.
- An indicator whether it's the last chunk.
onErrorfunction(Error) The callback to invoke when an error occurred.
opt_paramsH.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.
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 layerIdsArray.<string> The IDs of the layers to search in.
corridorH.geo.LineString | string The center line of the corridor. Either defined as a
H.geo.LineStringor as aRouteIdstring that was obtained from a previous Router call. SeeH.service.RoutingService#calculateRouteor Routing API CalculateRouteResponseType.radiusnumber The radius of the corridor in meters.
onResultfunction(!Array.<!H.service.extension.customLocation.Table.Row>, boolean) The callback to invoke when a chunk of data is received. The following arguments are passed:
- The list of received entries of the data layer.
- An indicator whether it's the last chunk.
onErrorfunction(Error) The callback to invoke when an error occurred.
opt_paramsH.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.
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 layerIdsArray.<string> The IDs of the layers to search in.
centerH.geo.Point The geographical point to search around.
radiusnumber The search radius in meters.
onResultfunction(!Array.<!H.service.extension.customLocation.Table.Row>, boolean) The callback to invoke when a chunk of data is received. The following arguments are passed:
- The list of received entries of the data layer.
- An indicator whether it's the last chunk.
onErrorfunction(Error) The callback to invoke when an error occurred.
opt_paramsH.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.
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 rowsArray.<!H.service.extension.customLocation.Table.Row> The data rows to update. All rows must have an defined
GEOMETRY_IDcell.onResultfunction(!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.
onErrorfunction(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.
Throws:
-
if several rows with the same
GEOMETRY_IDhave been passed, if rows without definedGEOMETRY_IDare passed or if theonResultoronErrorcallback is not valid.
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"'})