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
-
The property name to use when specifying options for this service within the
H.service.Platform.Options#servicesConfig. -
List of available entry points.
Properties:
Name Description DOC_ATTRIBUTESDOC_LAYERDOC_LAYERSDOC_MAPSDOC_INDEXESSEARCH_BBOXSEARCH_CORRIDORSEARCH_PROXIMITYSEARCH_QUADKEYSERVICE_CONFIGURATIONSTATICTILETILESFILEINDEX -
List of available entry point response types. Not all entry points support all types, see API Reference for more details.
Properties:
Name Description TXTJSONHTMLBIN
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
-
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 layerConfigH.service.extension.platformData.LayerConfig The configuration for the layer to load.
optionsH.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
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. -
getUrl ()H.service.Url inherited
-
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
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.platformData.Service.EntryPoint The entry point of the API.
entryPointTypeH.service.extension.platformData.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)
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 layerIdsArray.<string> The IDs of the layers to search in.
keyAttributesArray.<string> The list of the key columns, one for each layer, ordered according to the order of the layers in the
layerIdsargument. The key column is used to identify all entry fragments (stored on different tiles within the database) that belong to an identical entry.boundingBoxH.geo.Rect The geographical area where to search.
onResultfunction(!Array.<!H.service.extension.dataView.IRow.<*>>, 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 passed arguments are invalid
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 layerIdsArray.<string> The IDs of the layers to search in.
keyAttributesArray.<string> The list of the key columns, one for each layer, ordered according to the order of the layers in the
layerIdsargument. The key column is used to identify all entry fragments (stored on different tiles within the database) that belong to an identical entry.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.dataView.IRow.<*>>, 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, 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 layerIdsArray.<string> The IDs of the layers to search in.
keyAttributesArray.<string> The list of the key columns, one for each layer, ordered according to the order of the layers in the
layerIdsargument. The key column is used to identify all entry fragments (stored on different tiles within the database) that belong to an identical entry.centerH.geo.Point The geographical point to search around.
radiusnumber The search radius in meters.
onResultfunction(!Array.<!H.service.extension.dataView.IRow.<*>>, 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.