ไลบรารีการแสดงภาพ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ภาพรวม
Maps JavaScript API ใช้ไลบรารีเพื่อมอบฟีเจอร์เสริม
visualization
ไลบรารีประกอบด้วยคลาส HeatmapLayer
ซึ่งคุณใช้เพื่อแสดงภาพความเข้มของข้อมูล ณ จุดทางภูมิศาสตร์ได้
ตัวอย่างเช่น บทแนะนำการทำแผนที่แผ่นดินไหวใช้HeatMapLayer
คลาสเพื่อพล็อตตำแหน่งและความรุนแรงของแผ่นดินไหว และแนะนำโค้ดให้คุณทีละขั้นตอน
ใช้คลัง
ไลบรารีการแสดงข้อมูลเป็นภาพเป็นไลบรารีแบบสแตนด์อโลนที่แยกจากโค้ด Maps JavaScript API หลัก หากต้องการใช้ฟังก์ชันการทำงานที่มีอยู่ในไลบรารีนี้ คุณต้องโหลดไลบรารีก่อนโดยใช้พารามิเตอร์ libraries
ใน URL การเริ่มต้นของ Maps JavaScript API ดังนี้
<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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-27 UTC
[null,null,["อัปเดตล่าสุด 2025-08-27 UTC"],[[["\u003cp\u003eThe Maps JavaScript API offers a \u003ccode\u003evisualization\u003c/code\u003e library with a \u003ccode\u003eHeatmapLayer\u003c/code\u003e class for visualizing data intensity at geographical points.\u003c/p\u003e\n"],["\u003cp\u003eYou can find a practical example of using the \u003ccode\u003eHeatmapLayer\u003c/code\u003e in the earthquake mapping tutorial, which demonstrates plotting earthquake locations and intensity.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize the \u003ccode\u003evisualization\u003c/code\u003e library's functionalities, load it separately using the \u003ccode\u003elibraries\u003c/code\u003e parameter in the Maps JavaScript API bootstrap URL, specifying \u003ccode\u003evisualization\u003c/code\u003e as the desired library.\u003c/p\u003e\n"]]],[],null,["# Visualization Library\n\nOverview\n--------\n\nThe Maps JavaScript API uses libraries to provide supplemental\nfeatures. The `visualization` library includes the\n[`HeatmapLayer`](/maps/documentation/javascript/heatmaplayer) class, which you can use to visualize data\nintensity at geographical points.\n\nFor example, the [earthquake mapping tutorial](/maps/documentation/javascript/tutorials/earthquakes) uses the `HeatMapLayer`\nclass to plot earthquake locations and intensity, and walks you step by step\nthrough the code.\n\nUse the library\n---------------\n\nThe visualization library is a self-contained library, separate from the main\nMaps JavaScript API code. To use the functionality contained\nwithin this library, you must first load it using the `libraries` parameter in\nthe Maps JavaScript API bootstrap URL:\n\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\n\u003cbr /\u003e"]]