Maps API for JavaScript Developer's Guide

H.service.traffic.flow.Provider

Class Summary

Extends: H.map.provider.RemoteTileProvider

This class represents a provider for continuous fetching of traffic flow data from the HERE Traffic API.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

getStyle () : {H.map.Style}

To obtain the style used for rendering the provider data.

setStyle (style)

Sets the style to be used for rendering the provider data.

Class Description

This class represents a provider for continuous fetching of traffic flow data from the HERE Traffic API.

Note that as this provider provides vector data for rendering traffic flow, it can be used only with the WEBGL engine H.map.render.webgl.RenderEngine (see H.Map.Options#engineType).

It allows filtering of flow items by various parameters as well as makes possible to edit the default styling.

Use traffic raster layer from H.service.DefaultLayers when using the P2D engine.

Example

// Assumption: the platform is instantiated
var trafficService = platform.getTrafficService(),
  provider = new H.service.traffic.flow.Provider(trafficService);
map.addLayer(new H.map.layer.TileLayer(provider));

Constructor Details

H.service.traffic.flow.Provider(service, opt_refreshTime, opt_additionalParameters)

Parameters:
 
service:
{H.service.traffic.Service}
 
The traffic service instance to use by the provider.
opt_refreshTime:
{number=} [optional]
 
A value indicating an interval between provider tiles updates (in ms), defaults to 3 minutes
opt_additionalParameters:
{H.service.ServiceParameters=} [optional]
 
Contains an additional set of URL parameters. By default both TMC and DLR data will be fetched. Shape and functional class of the flow items will be always fetched.
Throws:
 
{H.lang.InvalidArgumentError}
 
if specified options are not valid.

Method Details

getStyle () : {H.map.Style}

To obtain the style used for rendering the provider data.

Returns:
 
{H.map.Style}

setStyle (style)

Sets the style to be used for rendering the provider data.

Parameters:
 
style:
{H.map.Style}