히트맵은 지리적 지점의 데이터 강도를 나타내는 데 사용되는 시각화 기능입니다. 히트맵 레이어를 사용 설정하면 지도 상단에 색상이 지정된 오버레이가 표시됩니다. 기본적으로 강도가 높은 지역은 빨간색으로, 강도가 낮은 지역은 초록색으로 표시됩니다.
시각화 라이브러리 로드
히트맵 레이어는 google.maps.visualization 라이브러리의 일부이며, 기본적으로 로드되지 않습니다. 시각화 클래스는 기본 Maps JavaScript API 코드와 별도로, 필요한 모든 기능이 포함된 독립 라이브러리입니다. 이 라이브러리에 포함된 기능을 사용하려면 먼저 Maps JavaScript API 부트스트랩 URL의 libraries 매개변수를 사용하여 로드해야 합니다.
히트맵 레이어를 추가하려면 먼저 HeatmapLayer 객체를 만들고 여기에 배열 또는 MVCArray[] 객체 형식의 지리적 데이터를 제공해야 합니다. 데이터는 LatLng 객체 또는 WeightedLocation 객체입니다. HeatmapLayer 객체를 인스턴스화한 후 setMap() 메서드를 호출하여
지도에 추가합니다.
다음 예는 샌프란시스코 지도에 14개의 데이터 포인트를 추가합니다.
/* Data points defined as an array of LatLng objects */varheatmapData=[newgoogle.maps.LatLng(37.782,-122.447),newgoogle.maps.LatLng(37.782,-122.445),newgoogle.maps.LatLng(37.782,-122.443),newgoogle.maps.LatLng(37.782,-122.441),newgoogle.maps.LatLng(37.782,-122.439),newgoogle.maps.LatLng(37.782,-122.437),newgoogle.maps.LatLng(37.782,-122.435),newgoogle.maps.LatLng(37.785,-122.447),newgoogle.maps.LatLng(37.785,-122.445),newgoogle.maps.LatLng(37.785,-122.443),newgoogle.maps.LatLng(37.785,-122.441),newgoogle.maps.LatLng(37.785,-122.439),newgoogle.maps.LatLng(37.785,-122.437),newgoogle.maps.LatLng(37.785,-122.435)];varsanFrancisco=newgoogle.maps.LatLng(37.774546,-122.433523);map=newgoogle.maps.Map(document.getElementById('map'),{center:sanFrancisco,zoom:13,mapTypeId:'satellite'});varheatmap=newgoogle.maps.visualization.HeatmapLayer({data:heatmapData});heatmap.setMap(map);
가중치가 적용된 데이터 포인트 추가
히트맵은 LatLng 또는 WeightedLocation 객체, 또는 이 두 객체의 조합을 렌더링할 수 있습니다. 두 객체 모두 지도 상의 단일 데이터 포인트를 나타내지만 WeightedLocation 객체를 사용하면 해당 데이터 포인트에 가중치를 추가로 지정할 수 있습니다. 데이터 포인트에 가중치를 적용하면 WeightedLocation이 간단한 LatLng 객체보다 센 강도로 렌더링됩니다. 가중치는 선형 배율로 각 LatLng 객체의 암시적 가중치는 1입니다. {location: new google.maps.LatLng(37.782, -122.441), weight: 3}의 단일 WeightedLocation을 추가하면 google.maps.LatLng(37.782, -122.441)을 세 번 추가하는 것과 같습니다.
단일 배열에서 weightedLocation 및 LatLng 객체를 혼합할 수 있습니다.
다음과 같은 경우 LatLng 대신 WeightedLocation 객체를 사용하면 유용할 수 있습니다.
단일 위치에서 대량의 데이터를 추가하는 경우. 가중치가 1,000인 단일 WeightedLocation 객체를 렌더링하는 것이 LatLng 객체 1,000개를 렌더링하는 것보다 빠릅니다.
임의의 값을 기반으로 데이터를 강조하는 경우. 예를 들어 LatLng 객체를 사용하여 지진 데이터를 표시할 수 있지만 리히터 척도로 각 지진의 강도를 측정할 때는 WeightedLocation을 사용할 수도 있습니다.
/* Data points defined as a mixture of WeightedLocation and LatLng objects */varheatMapData=[{location:newgoogle.maps.LatLng(37.782,-122.447),weight:0.5},newgoogle.maps.LatLng(37.782,-122.445),{location:newgoogle.maps.LatLng(37.782,-122.443),weight:2},{location:newgoogle.maps.LatLng(37.782,-122.441),weight:3},{location:newgoogle.maps.LatLng(37.782,-122.439),weight:2},newgoogle.maps.LatLng(37.782,-122.437),{location:newgoogle.maps.LatLng(37.782,-122.435),weight:0.5},{location:newgoogle.maps.LatLng(37.785,-122.447),weight:3},{location:newgoogle.maps.LatLng(37.785,-122.445),weight:2},newgoogle.maps.LatLng(37.785,-122.443),{location:newgoogle.maps.LatLng(37.785,-122.441),weight:0.5},newgoogle.maps.LatLng(37.785,-122.439),{location:newgoogle.maps.LatLng(37.785,-122.437),weight:2},{location:newgoogle.maps.LatLng(37.785,-122.435),weight:3}];varsanFrancisco=newgoogle.maps.LatLng(37.774546,-122.433523);map=newgoogle.maps.Map(document.getElementById('map'),{center:sanFrancisco,zoom:13,mapTypeId:'satellite'});varheatmap=newgoogle.maps.visualization.HeatmapLayer({data:heatMapData});heatmap.setMap(map);
히트맵 레이어 맞춤설정
다음 히트맵 옵션을 사용하여 히트맵이 렌더링되는 방식을 맞춤설정할 수 있습니다. 자세한 내용은 HeatmapLayerOptions 문서를 참고하세요.
dissipating: 확대/축소 시 히트맵 데이터가 사라지는지 여부를 지정합니다. dissipating이 false이면 지정된 지리적 위치에서 색상 강도를 유지하기 위해 확대/축소 수준에 따라 영향력 반경이 증가합니다. 기본값은 true입니다.
gradient: 히트맵의 색상 그라디언트로 CSS 색상 문자열의 배열로 지정됩니다. 확장된 이름으로 지정된 색상 및 HSL(A) 값을 제외하고 RGBA를 포함한 모든 CSS3 색상이 지원됩니다.
maxIntensity: 히트맵의 최대 강도입니다. 기본적으로 히트맵 색상은 지도의 특정 픽셀에서 가장 집중된 지점에 따라 동적으로 배율이 조정됩니다. 이 속성을 사용하면 고정된 최댓값을 지정할 수 있습니다. 최대 강도를 설정하면 데이터 세트에 예외적으로 강도가 높은 이상점이 포함되어 있을 경우 유용합니다.
[null,null,["최종 업데이트: 2025-08-06(UTC)"],[[["\u003cp\u003eThe Heatmap Layer visualizes data intensity at geographical points using color gradients, typically with red for high intensity and green for low.\u003c/p\u003e\n"],["\u003cp\u003eTo use the Heatmap Layer, you must load the \u003ccode\u003egoogle.maps.visualization\u003c/code\u003e library using the \u003ccode\u003elibraries\u003c/code\u003e parameter in the Maps JavaScript API bootstrap URL.\u003c/p\u003e\n"],["\u003cp\u003eHeatmaps can be customized using options like \u003ccode\u003edissipating\u003c/code\u003e, \u003ccode\u003egradient\u003c/code\u003e, \u003ccode\u003emaxIntensity\u003c/code\u003e, \u003ccode\u003eradius\u003c/code\u003e, and \u003ccode\u003eopacity\u003c/code\u003e to control their appearance and behavior.\u003c/p\u003e\n"],["\u003cp\u003eData points for the heatmap can be provided as \u003ccode\u003eLatLng\u003c/code\u003e objects or \u003ccode\u003eWeightedLocation\u003c/code\u003e objects, with the latter allowing for specifying the intensity of each point using a weight value.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/utility/heatmap \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/utility/heatmap \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/heatmaplayer \"View this page for the JavaScript platform docs.\")\n\n1. [Overview](#overview)\n2. [Load the visualization library](#load_the_visualization_library)\n3. [Add Weighted Data Points](#add_weighted_data_points)\n4. [Customize a Heatmap Layer](#customize_a_heatmap_layer)\n\n| **[Deprecated:](/maps/deprecations)** The Heatmap Layer\n| functionality in the Maps JavaScript API will no longer be supported. This API was deprecated in\n| May 2025 and be made unavailable in a later version of the Maps JavaScript API, releasing in May\n| 2026. As a replacement for the Heatmap Layer, consider using third-party library integrations\n| like deck.gl, which offers a HeatmapLayer implementation. You can find more information in the\n| [deck.gl documentation](https://deck.gl/docs/api-reference/aggregation-layers/heatmap-layer).\n\nThe Heatmap Layer provides client side rendering of heatmaps.\n\nOverview\n\nA heatmap is a visualization used to depict the intensity of data at\ngeographical points. When the Heatmap Layer is enabled, a colored overlay will\nappear on top of the map. By default, areas of higher intensity will be colored\nred, and areas of lower intensity will appear green.\n\nLoad the visualization library\n\nThe Heatmap Layer is part of the `google.maps.visualization` library, and is not\nloaded by default. The Visualization classes are a self-contained library,\nseparate from the main Maps JavaScript API code. To use the functionality\ncontained within this library, you must first load it using the `libraries`\nparameter in the Maps JavaScript API bootstrap URL: \n\n```html\n\u003cscript async\n src=\"https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&loading=async&libraries=visualization&callback=initMap\"\u003e\n\u003c/script\u003e\n```\n\nAdd a Heatmap Layer\n\nTo add a Heatmap Layer, you must first create a new `HeatmapLayer`\nobject, and provide it with some geographic data in the form of an array or an\n`MVCArray[]` object. The data may be either a\n[`LatLng`](/maps/documentation/javascript/reference#LatLng)\nobject or a\n[`WeightedLocation`](/maps/documentation/javascript/reference#WeightedLocation)\nobject. After instantiating the `HeatmapLayer` object, add it to the\nmap by calling the `setMap()` method.\n\nThe following example adds 14 data points to a map of San Francisco. \n\n```javascript\n/* Data points defined as an array of LatLng objects */\nvar heatmapData = [\n new google.maps.LatLng(37.782, -122.447),\n new google.maps.LatLng(37.782, -122.445),\n new google.maps.LatLng(37.782, -122.443),\n new google.maps.LatLng(37.782, -122.441),\n new google.maps.LatLng(37.782, -122.439),\n new google.maps.LatLng(37.782, -122.437),\n new google.maps.LatLng(37.782, -122.435),\n new google.maps.LatLng(37.785, -122.447),\n new google.maps.LatLng(37.785, -122.445),\n new google.maps.LatLng(37.785, -122.443),\n new google.maps.LatLng(37.785, -122.441),\n new google.maps.LatLng(37.785, -122.439),\n new google.maps.LatLng(37.785, -122.437),\n new google.maps.LatLng(37.785, -122.435)\n];\n\nvar sanFrancisco = new google.maps.LatLng(37.774546, -122.433523);\n\nmap = new google.maps.Map(document.getElementById('map'), {\n center: sanFrancisco,\n zoom: 13,\n mapTypeId: 'satellite'\n});\n\nvar heatmap = new google.maps.visualization.HeatmapLayer({\n data: heatmapData\n});\nheatmap.setMap(map);\n```\n\nAdd Weighted Data Points\n\nA heatmap can render either\n[`LatLng`](/maps/documentation/javascript/reference#LatLng) or\n[`WeightedLocation`](/maps/documentation/javascript/reference#WeightedLocation)\nobjects, or a combination of the two. Both objects represent a single data\npoint on a map, but a `WeightedLocation` object allows you to additionally\nspecify a weight for that data point. Applying a weight to a data point will\ncause the `WeightedLocation` to be rendered with a greater intensity than a\nsimple `LatLng` object. The weight is a linear scale, in which each `LatLng`\nobject has an implicit weight of 1 --- adding a single `WeightedLocation`\nof `{location: new google.maps.LatLng(37.782, -122.441), weight: 3}` will have\nthe same effect as adding `google.maps.LatLng(37.782, -122.441)` three times.\nYou can mix `weightedLocation` and `LatLng` objects in a single array.\n\nUsing a `WeightedLocation` object in place of a `LatLng` can be useful when:\n\n- Adding large amounts of data at a single location. Rendering a single `WeightedLocation` object with a weight of 1000 will be faster than rendering 1000 `LatLng` objects.\n- Applying an emphasis to your data based upon arbitrary values. For example, you can use `LatLng` objects when plotting earthquake data, but you may want to use a `WeightedLocation` to measure the magnitude of each earthquake on the richter scale.\n\n```javascript\n/* Data points defined as a mixture of WeightedLocation and LatLng objects */\nvar heatMapData = [\n {location: new google.maps.LatLng(37.782, -122.447), weight: 0.5},\n new google.maps.LatLng(37.782, -122.445),\n {location: new google.maps.LatLng(37.782, -122.443), weight: 2},\n {location: new google.maps.LatLng(37.782, -122.441), weight: 3},\n {location: new google.maps.LatLng(37.782, -122.439), weight: 2},\n new google.maps.LatLng(37.782, -122.437),\n {location: new google.maps.LatLng(37.782, -122.435), weight: 0.5},\n\n {location: new google.maps.LatLng(37.785, -122.447), weight: 3},\n {location: new google.maps.LatLng(37.785, -122.445), weight: 2},\n new google.maps.LatLng(37.785, -122.443),\n {location: new google.maps.LatLng(37.785, -122.441), weight: 0.5},\n new google.maps.LatLng(37.785, -122.439),\n {location: new google.maps.LatLng(37.785, -122.437), weight: 2},\n {location: new google.maps.LatLng(37.785, -122.435), weight: 3}\n];\n\nvar sanFrancisco = new google.maps.LatLng(37.774546, -122.433523);\n\nmap = new google.maps.Map(document.getElementById('map'), {\n center: sanFrancisco,\n zoom: 13,\n mapTypeId: 'satellite'\n});\n\nvar heatmap = new google.maps.visualization.HeatmapLayer({\n data: heatMapData\n});\nheatmap.setMap(map);\n```\n\nCustomize a Heatmap Layer\n\nYou can customize how your heatmap will be rendered with the following heatmap\noptions. See the\n[`HeatmapLayerOptions`](/maps/documentation/javascript/reference#HeatmapLayerOptions) documentation for more information.\n\n- `dissipating`: Specifies whether heatmaps dissipate on zoom. When dissipating is false the radius of influence increases with zoom level to ensure that the color intensity is preserved at any given geographic location. Defaults to true.\n- `gradient`: The color gradient of the heatmap, specified as an array of CSS color strings. All [CSS3 colors](http://www.w3.org/TR/css3-color/#html4) --- including RGBA --- are supported except for [extended named\n colors](http://www.w3.org/TR/css3-color/#svg-color) and HSL(A) values.\n- `maxIntensity`: 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. Setting the maximum intensity can be helpful when your dataset contains a few outliers with an unusually high intensity.\n- `radius`: The radius of influence for each data point, in pixels.\n- `opacity`: The opacity of the heatmap, expressed as a number between 0 and 1.\n\nThe below example shows some of the customization options available.\n\n[View example](/maps/documentation/javascript/examples/layer-heatmap)"]]