AI-generated Key Takeaways
-
The Maps JavaScript API offers a
visualizationlibrary with aHeatmapLayerclass for visualizing data intensity at geographical points. -
You can find a practical example of using the
HeatmapLayerin the earthquake mapping tutorial, which demonstrates plotting earthquake locations and intensity. -
To utilize the
visualizationlibrary's functionalities, load it separately using thelibrariesparameter in the Maps JavaScript API bootstrap URL, specifyingvisualizationas the desired library.
Overview
The Maps JavaScript API uses libraries to provide supplemental
features. The visualization library includes the
HeatmapLayer class, which you can use to visualize data
intensity at geographical points.
For example, the earthquake mapping tutorial uses the HeatMapLayer
class to plot earthquake locations and intensity, and walks you step by step
through the code.
Use the library
The visualization library is a self-contained library, separate from the main
Maps JavaScript API code. To use the functionality contained
within this library, you must first load it using the libraries parameter in
the Maps JavaScript API bootstrap URL:
<script async
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&loading=async&libraries=visualization&callback=initMap">
</script>