通知:Google Maps Platform 即将推出全新基本地图样式。此次地图样式更新包括全新默认调色板、经过现代化改进的图钉,以及地图体验和易用性方面的改进。所有地图样式将于 2025 年 3 月自动更新。如需详细了解适用范围以及如何提前选择启用,请参阅
全新 Google Maps Platform 地图样式。
可视化库
概述
Maps JavaScript API 利用库来提供补充功能。visualization
库包含 HeatmapLayer
类,您可以使用该类在各地理位置直观呈现数据强度。
例如,地震图绘制教程就使用 HeatMapLayer
类来绘制地震位置和强度,并一步步引导您编写所需的代码。
使用库
该可视化库是一个独立于 Maps JavaScript API 主代码的自包含库。若要使用该库中包含的功能,您必须先在 Maps JavaScript API 引导程序网址中使用 libraries
参数来加载该库:
<script async
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&loading=async&libraries=visualization&callback=initMap">
</script>
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-14。
[null,null,["最后更新时间 (UTC):2025-01-14。"],[[["The Maps JavaScript API offers a `visualization` library with a `HeatmapLayer` class for visualizing data intensity at geographical points."],["You can find a practical example of using the `HeatmapLayer` in the earthquake mapping tutorial, which demonstrates plotting earthquake locations and intensity."],["To utilize the `visualization` library's functionalities, load it separately using the `libraries` parameter in the Maps JavaScript API bootstrap URL, specifying `visualization` as the desired library."]]],[]]