Kiểu bản đồ mới sắp xuất hiện trên Nền tảng Google Maps. Bản cập nhật này để tạo kiểu bản đồ bao gồm một bảng màu mặc định mới và các cải tiến về trải nghiệm bản đồ cũng như khả năng hữu dụng. Tất cả kiểu bản đồ sẽ được cập nhật tự động vào tháng 3 năm 2025. Để biết thêm thông tin về phạm vi cung cấp và cách chọn tham gia sớm hơn, hãy xem bài viết Kiểu bản đồ mới cho Nền tảng Google Maps.
Trang này trình bày cách kết xuất dữ liệu địa lý trong KML
sử dụng GMUKMLParser trong
kết hợp với GMUGeometryRenderer. KML là một định dạng tệp phổ biến
để kết xuất dữ liệu địa lý như điểm, đường và đa giác.
Ảnh chụp màn hình sau đây minh hoạ một số dữ liệu KML mẫu được kết xuất trên bản đồ:
Để xem mã mẫu đầy đủ, hãy xem các ứng dụng mẫu
bật
GitHub.
Hiển thị dữ liệu KML
Để kết xuất dữ liệu KML trên bản đồ, hãy tạo GMUKMLParser với phần tử
đường dẫn đến một tài nguyên KML (trong ví dụ này là KML_Sample.kml). Sau đó:
tạo một GMUGeometryRenderer truyền GMUKMLParser
thực thể. Cuối cùng, hãy gọi GMUGeometryRenderer.render(). Chiến lược phát hành đĩa đơn
mã ví dụ sau đây minh hoạ việc kết xuất dữ liệu KML trên bản đồ:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-09-20 UTC."],[[["This documentation explains how to render geographic data in KML format using the `GMUKMLParser` and `GMUGeometryRenderer` within the Google Maps SDK for iOS Utility Library."],["KML is a popular format used for displaying geographic data, including points, lines, and polygons, on maps."],["To render KML data, create a `GMUKMLParser` instance with the path to your KML file, then use it to initialize a `GMUGeometryRenderer`, and finally, call `render()` on the renderer to display the data on your map."],["Code examples in both Swift and Objective-C are provided to demonstrate the process of rendering KML data on a map using the Google Maps SDK for iOS."]]],[]]