<iframe src="https://developers.devsite.google/frame/maps/documentation/javascript/reference/3.63/visualization_59b288b1a42d5a69a7ba3c7626b09d4d45d2b0bfe953127788d7fded01d43053.frame" class="framebox inherit-locale redirect-iframe" allow="clipboard-write https://developers.devsite.google" allowfullscreen is-upgraded></iframe>

## [HeatmapLayer](https://developers.google.com/maps/documentation/javascript/reference/3.63/visualization.md.txt#HeatmapLayer)
class


`google.maps.visualization.HeatmapLayer`
class

> [!WARNING]
> **[Deprecated:](https://developers.google.com/maps/deprecations.md.txt)** The Heatmap Layer functionality in the Maps JavaScript API is no longer supported. This API was deprecated in May 2025 and will be made unavailable in a later version of the Maps JavaScript API, releasing in May 2026. For more info, see <https://developers.google.com/maps/deprecations>).

A layer that provides a client-side rendered heatmap, depicting the intensity of data at geographical points.

This class extends
`MVCObject`.

Access by calling `const {HeatmapLayer} = await google.maps.importLibrary("visualization")`.   
See [Libraries in the Maps JavaScript API](https://developers.google.com/maps/documentation/javascript/libraries.md.txt).

| ### Constructor ||
|---|---|
| `HeatmapLayer` | `HeatmapLayer([opts])` **Parameters:** - `opts`: `HeatmapLayerOptions optional` Creates a new instance of `HeatmapLayer`. |

| ### Methods ||
|---|---|
| `getData` | `getData()` **Parameters:** None **Return Value:** `MVCArray<LatLng|WeightedLocation>` Returns the data points currently displayed by this heatmap. |
| `getMap` | `getMap()` **Parameters:** None **Return Value:** `Map|undefined` |
| `setData` | `setData(data)` **Parameters:** - `data`: `MVCArray<LatLng|WeightedLocation>|Array<LatLng|WeightedLocation>` **Return Value:** None Sets the data points to be displayed by this heatmap. |
| `setMap` | `setMap(map)` **Parameters:** - `map`: `Map optional` **Return Value:** None Renders the heatmap on the specified map. If map is set to `null`, the heatmap will be removed. |
| `setOptions` | `setOptions(options)` **Parameters:** - `options`: `HeatmapLayerOptions optional` **Return Value:** None |

## [HeatmapLayerOptions](https://developers.google.com/maps/documentation/javascript/reference/3.63/visualization.md.txt#HeatmapLayerOptions)
interface


`google.maps.visualization.HeatmapLayerOptions`
interface

This object defines the properties that can be set on a `HeatmapLayer` object.

| ### Properties ||
|---|---|
| `data optional` | **Type:** `MVCArray<LatLng|WeightedLocation>|Array<LatLng|WeightedLocation> optional` The data points to display. Required. |
| `dissipating optional` | **Type:** `boolean optional` Specifies whether heatmaps dissipate on zoom. By default, the radius of influence of a data point is specified by the radius option only. When dissipating is disabled, the radius option is interpreted as a radius at zoom level 0. |
| `gradient optional` | **Type:** `Array<string> optional` The color gradient of the heatmap, specified as an array of CSS color strings. All CSS3 colors are supported except for extended named colors. |
| `map optional` | **Type:** `Map optional` The map on which to display the layer. |
| `maxIntensity optional` | **Type:** `number optional` The maximum intensity of the heatmap. By default, heatmap colors are dynamically scaled according to the greatest concentration of points at any particular pixel on the map. This property allows you to specify a fixed maximum. |
| `opacity optional` | **Type:** `number optional` **Default:** `0.6` The opacity of the heatmap, expressed as a number between 0 and 1. |
| `radius optional` | **Type:** `number optional` The radius of influence for each data point, in pixels. |

## [WeightedLocation](https://developers.google.com/maps/documentation/javascript/reference/3.63/visualization.md.txt#WeightedLocation)
interface


`google.maps.visualization.WeightedLocation`
interface

A data point entry for a heatmap. This is a geographical data point with a weight attribute.

| ### Properties ||
|---|---|
| `location` | **Type:** `LatLng` The location of the data point. |
| `weight` | **Type:** `number` The weighting value of the data point. |