Maps API for JavaScript Developer's Guide

H.data.heatmap.Colors

Class Summary

This class defines a standard way to customize the colors displayed in a heat map by associating custom colors with the normalized "heat" values.

[ For full details, see the Class Details ]

Property Summary

Table 1. Properties
Properties

static DEFAULT : {H.data.heatmap.Colors}

This static member defines the default heatmap colors. It uses color interpolation and has the following color stops:

Class Description

This class defines a standard way to customize the colors displayed in a heat map by associating custom colors with the normalized "heat" values.

It associates colors with "heat" values via the "stops" property. This property is a map, where the keys are numbers ranging from 0 to 1, inclusive, and the values are colors associated with these numeric values. The colors are represented using CSS syntax, i.e. hexadecimal notation ("#RGB" or "#RRGGBB") or rgb(a) notation ("rgba(R, G, B, A)"), etc. The range (0 .. 1) stands for the normalized "heat" value.

Example

var colors = new H.data.heatmap.Colors({
  '0': 'rgba(255, 0, 0, 0.5)',   // half-transparent red
  '0.5': 'rgba(255, 255, 0, 0.5)', // half-transparent yellow
  '1': 'rgba(255, 255, 255, 0.5)'  // half-transparent white
  },
  true  // interpolate between the stops to create a smooth color gradient
);

Constructor Details

H.data.heatmap.Colors(stops, opt_interpolate)

Parameters:
 
stops:
{Object<string, string>}
 
The color stops.
opt_interpolate:
{boolean=} [optional]
 
The flag indicating whether interpolation is to be used to display smooth color transitions in the heat map (true) or whether the heat map is to be posterized (false), default is false.

Property Details

static DEFAULT: {H.data.heatmap.Colors}

This static member defines the default heatmap colors. It uses color interpolation and has the following color stops:

Example

{
 '0':   '#008', // dark blue
 '0.2': '#0b0', // medium green
 '0.5': '#ff0', // yellow
 '0.7': '#f00'  // red
}

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.