Maps API for JavaScript Developer's Guide

H.data.heatmap.Provider

Class Summary

Extends: H.map.provider.RemoteTileProvider

The class provides tiles to visualize value-based or density-based heat maps. User can choose between density and value based heat map.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

addData (dataPoints, opt_hardReload)

This method adds an array of H.data.heatmap.IDataPoint to the heat map. The heat map provides a visual representation of these data. Note that there is a significant performance cost to adding and removing data, once an overlay has been created. This is related to the rendering engine and tile caching. If you wish to add data after tiles have been created, the cache must be cleared and all tiles need to be recreated. For this reason, heat maps should not be used to create fast animations.

clear ()

This method removes all data from the given heat map provider. New data can be added using the H.data.heatmap.Provider#addData method.

Class Description

The class provides tiles to visualize value-based or density-based heat maps. User can choose between density and value based heat map.

Example

// Create heat map provider
var heatmapProvider = new H.data.heatmap.Provider({
  colors: new H.data.heatmap.Colors({
  '0': 'blue',
  '0.5': 'yellow',
  '1': 'red'
  }, true),
  // paint assumed values in regions where no data is available
  assumeValues: true
});

// Add the data
heatmapProvider.addData([
  {lat: 52, lng: 1, value: 1},
  {lat: 53, lng: 2, value: 2}
]);

// Create semi transparent heat map layer
var heatmapLayer = new H.map.layer.TileLayer(heatmapProvider, {
  opacity: 0.6
});

// Add layer to the map
map.addLayer(heatmapLayer);

Constructor Details

H.data.heatmap.Provider(opt_options)

Parameters:
 
opt_options:
{H.data.heatmap.Provider.Options=} [optional]
 
Configuration options

Method Details

addData (dataPoints, opt_hardReload)

This method adds an array of H.data.heatmap.IDataPoint to the heat map. The heat map provides a visual representation of these data. Note that there is a significant performance cost to adding and removing data, once an overlay has been created. This is related to the rendering engine and tile caching. If you wish to add data after tiles have been created, the cache must be cleared and all tiles need to be recreated. For this reason, heat maps should not be used to create fast animations.

As new data might invalidate the already generated tiles, those tiles should be removed form the tile cache. Pass opt_hardReload parameter to change the mode how those tiles are removed. Two modes are possible:

  • hard: A hard immediately removes the cached tiles from the tile cache and forces the provider to re-fetch the tiles. Currently cached tiles will not be used for rendering.

  • soft: A soft invalidation only marks tiles as invalid and requests the tiles to be re-fetched at the earliest convenience. The provider does not invalidate the cache immediately in this case. This means that cached tiles can still be rendered while the updated tiles are fetched.

Parameters:
 
dataPoints:
{Array<H.data.heatmap.IDataPoint>}
 
The array of data points to add.
opt_hardReload:
{boolean=} [optional]
 
a boolean flag indicating whether to invalidate in hard mode (true) or in soft mode (false), default is soft mode.

clear ()

This method removes all data from the given heat map provider. New data can be added using the H.data.heatmap.Provider#addData method.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.