Hiển thị dữ liệu KML
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Định kiểu dựa trên dữ liệu cho tập dữ liệu
Bạn có thể tải dữ liệu KML lên dưới dạng một tập dữ liệu và sử dụng Định kiểu dựa trên dữ liệu để hiển thị dữ liệu đó trên bản đồ. Phương pháp này mang lại hiệu suất cao hơn và nhiều lựa chọn tạo kiểu hơn.
Bạn cũng có thể dùng các thư viện của bên thứ ba để phân tích cú pháp tệp KML trong trình duyệt và hiển thị dữ liệu bằng Lớp dữ liệu hoặc các lớp phủ khác của Maps JavaScript API.
Sau đây là một số thư viện phổ biến của bên thứ ba để phân tích cú pháp KML:
[null,null,["Cập nhật lần gần đây nhất: 2026-05-21 UTC."],[],["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"]]