This class encapsulates the HERE Traffic Vector Tile API endpoint.
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#getTrafficVectorTileService on a platform instance.
| Name | Type | Description |
|---|---|---|
opt_options |
H.service.trafficVectorTile.Service.Options |
optional
Configuration options for Traffic Vector Tile service |
Throws:
Example
// Assumption: the platform is instantiated
myService = platform.getTrafficVectorTileService();
Extends
Members
-
The property name to use when specifying options for this service within the
H.service.Platform.Options#servicesConfig.
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
-
createLayer (style, opt_providerOptions, opt_layerOptions)H.map.layer.TileLayer
-
To create an Traffic Vector Tile map layer according to the passed configuration.
Name Type Description styleH.map.render.Style.<!Object> The style to use for rendering data provided by the provider.
opt_providerOptionsH.service.trafficVectorTile.Provider.Options optional The options to instantiate the provider.
opt_layerOptionsH.map.layer.ITileLayer.Options optional The options to instantiate the layer.
Returns:
Type Description H.map.layer.TileLayer Example
// Assumption: the platform is instantiated const config = ` sources: omv: type: OMV layers: traffic_flow: data: {source: omv} draw: lines: order: 340 width: 2px color: red `; map.addLayer(platform.getTrafficVectorTileService().createLayer(new H.map.render.webgl.Style(config))); -
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
Type Definitions
-
This type encapsulates configuration options for an instance of an Traffic Vector Tile Service.
Properties:
Name Type Argument Description baseUrlH.service.Url <optional>
The base URL of the service. If supplied, it overrides all defaults (either coming from platform or service internals) including authentication params
subDomainstring <optional>
the subdomain of the service relative to the platform's base URL
pathstring <optional>
The path to use within the service URL
headersObject <optional>
A map of HTTP headers to be sent with each request made by the service
layerstring <optional>
Specifies which kind of traffic information is used for tile requests. See HERE Traffic Vector Tile API – Traffic layers for more details