Heatmaps Stay organized with collections Save and categorize content based on your preferences.
HeatmapLayerclass
google.maps.visualization.HeatmapLayerclass
Deprecated: 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, seehttps://developers.google.com/maps/deprecations).
A layer that provides a client-side rendered heatmap, depicting the intensity of data at geographical points.
This class extendsMVCObject.
Access by callingconst {HeatmapLayer} = await google.maps.importLibrary("visualization").
SeeLibraries in the Maps JavaScript API.
Constructor | |
|---|---|
HeatmapLayer | HeatmapLayer([opts])Parameters:
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: Return Value: None Sets the data points to be displayed by this heatmap. |
setMap | setMap(map)Parameters:
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:
Return Value: None |
Inherited:addListener,bindTo,get,notify,set,setValues,unbind,unbindAll | |
HeatmapLayerOptionsinterface
google.maps.visualization.HeatmapLayerOptionsinterface
This object defines the properties that can be set on aHeatmapLayer object.
Properties | |
|---|---|
dataoptional | Type: MVCArray<LatLng|WeightedLocation>|Array<LatLng|WeightedLocation>optionalThe data points to display. Required. |
dissipatingoptional | Type: booleanoptionalSpecifies 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. |
gradientoptional | Type: Array<string>optionalThe color gradient of the heatmap, specified as an array of CSS color strings. All CSS3 colors are supported except for extended named colors. |
mapoptional | Type: MapoptionalThe map on which to display the layer. |
maxIntensityoptional | Type: numberoptionalThe 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. |
opacityoptional | Type: numberoptionalDefault: 0.6The opacity of the heatmap, expressed as a number between 0 and 1. |
radiusoptional | Type: numberoptionalThe radius of influence for each data point, in pixels. |
WeightedLocationinterface
google.maps.visualization.WeightedLocationinterface
A data point entry for a heatmap. This is a geographical data point with a weight attribute.
Properties | |
|---|---|
location | Type: LatLngThe location of the data point. |
weight | Type: numberThe weighting value of the data point. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-11-21 UTC.