Google 會運用 AI 技術將內容翻譯成你偏好的語言,但可能會出錯。
顯示 KML 資料
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資料集資料導向樣式
您可以將 KML 資料上傳為資料集,並使用資料導向樣式在地圖上顯示。這種做法可提升成效,並提供更多樣式選項。
如要開始使用資料集,請參閱「資料集總覽」。
第三方程式庫
您也可以使用第三方程式庫在瀏覽器中剖析 KML 檔案,並使用 Maps JavaScript API 的資料層或其他疊加層顯示資料。
如要剖析 KML,可使用下列熱門的第三方程式庫:
將 KML 資料轉換為 GeoJSON 後,您可以使用 map.data.addGeoJson() 將資料載入資料層。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-07-09 (世界標準時間)。
[null,null,["上次更新時間:2026-07-09 (世界標準時間)。"],[],["This tutorial demonstrates how to display KML file information on a Google Map and in a sidebar. Key actions include: initializing a Google Map, creating a `KmlLayer` object to load a KML file from a URL, and configuring the layer to suppress info windows. An event listener is added to capture clicks on KML features. When a click occurs, the feature's `infoWindowHtml` content is extracted and used to update the content of a designated sidebar `div`, dynamically displaying the selected feature's information.\n"]]