Bạn đang tìm kiếm các tính năng nâng cao để thêm vào bản đồ của mình? SDK Maps cho Thư viện tiện ích iOS trên GitHub là một thư viện nguồn mở gồm các lớp hữu ích cho nhiều ứng dụng. Kho lưu trữ GitHub bao gồm các lớp tiện ích và một ứng dụng minh hoạ minh hoạ cách sử dụng từng lớp.
Tiện ích
Tạo nhóm điểm đánh dấu
GMUClusterManager giúp bạn quản lý nhiều điểm đánh dấu ở các mức thu phóng khác nhau. Điều này có nghĩa là bạn có thể đặt một số lượng lớn điểm đánh dấu trên bản đồ mà không làm cho bản đồ trở nên khó đọc. Khi người dùng xem bản đồ
ở mức thu phóng cao, các điểm đánh dấu riêng lẻ sẽ hiển thị trên bản đồ. Khi người dùng thu nhỏ xuống mức thu phóng thấp hơn, các điểm đánh dấu sẽ tập hợp lại thành các cụm để giúp xem bản đồ dễ dàng hơn.
Quadtree là một cấu trúc dữ liệu hữu ích trong việc tìm các điểm ở gần một điểm duy nhất, bằng cách tìm kiếm bên trong khu vực xung quanh địa điểm yêu thích.
Để biết thông tin chi tiết, hãy xem tài liệu trên Quadtree.
KML
KML là một định dạng phổ biến để hiển thị dữ liệu địa lý, chẳng hạn như
điểm, đường kẻ và đa giác. GMUKMLParser cho phép bạn phân tích cú pháp và hiển thị dữ liệu địa lý ở định dạng KML.
Để biết thông tin chi tiết, hãy xem tài liệu về định dạng KML.
Nhập GeoJSON vào bản đồ của bạn
Bạn có thể lưu trữ các tính năng ở định dạng GeoJSON và sử dụng tiện ích này để hiển thị chúng dưới dạng một lớp trên bản đồ.
Hiển thị dữ liệu địa lý ở định dạng GeoJSON bằng cách sử dụng GMUGeoJSONParser kết hợp với GMUGeometryRenderer.
Để biết thông tin chi tiết, hãy xem tài liệu về GeoJSON.
Bản đồ nhiệt
Bản đồ nhiệt giúp người xem dễ dàng hiểu sự phân bố và
cường độ tương đối của các điểm dữ liệu trên bản đồ. Thay vì đặt một điểm đánh dấu ở từng vị trí, bản đồ nhiệt sử dụng màu sắc và hình dạng để thể hiện sự phân phối dữ liệu.
Để biết thông tin chi tiết, hãy xem tài liệu về Bản đồ nhiệt.
Điểm đánh dấu tuỳ chỉnh
Sử dụng đối tượng uỷ quyền GMUClusterRendererDelegate trên GMUDefaultClusterRenderer để tuỳ chỉnh các thuộc tính của điểm đánh dấu trước và sau khi điểm đánh dấu đó được thêm vào bản đồ.
Tiện ích hình học
Một tập hợp các hàm tiện ích hình học hình cầu Swift của mô-đun
GMSGeometryUtils
của SDK Maps dành cho iOS. Sử dụng các tiện ích này để thực hiện nhiều loại toán tử hình học, bao gồm:
Xác định khoảng cách đường tròn lớn giữa các toạ độ
Xác định xem toạ độ có nằm trong đa giác hay không
Xác định xem một toạ độ có nằm trên hay gần đường đi trong dung sai cho trước không
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThe Maps SDK for iOS Utility Library is an open-source library providing advanced features for your maps.\u003c/p\u003e\n"],["\u003cp\u003eThis library offers utilities for marker clustering, quadtrees, KML parsing, GeoJSON rendering, heatmaps, custom markers, and geometry operations.\u003c/p\u003e\n"],["\u003cp\u003eThe library includes a demo app demonstrating the use of each class.\u003c/p\u003e\n"],["\u003cp\u003eAccess the Maps SDK for iOS Utility Library and its documentation on GitHub.\u003c/p\u003e\n"]]],["The Maps SDK for iOS Utility Library offers tools for enhancing maps, including marker clustering via `GMUClusterManager` for managing numerous markers at different zoom levels. It also supports quadtrees for proximity searches, KML and GeoJSON format parsing for rendering geographic data, and heatmaps for visualizing data density. The library allows custom marker properties through `GMUClusterRendererDelegate` and provides geometry utilities (`GMSGeometryUtils`) for tasks like distance calculation and polygon analysis.\n"],null,["Select platform: [Android](/maps/documentation/android-sdk/utility \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/utility \"View this page for the iOS platform docs.\")\n\nLooking for advanced features to add to your maps? The\n[Maps SDK for iOS\nUtility Library](https://github.com/googlemaps/google-maps-ios-utils) on GitHub is an open-source library of classes that are\nuseful for a range of applications. The GitHub repository includes the utility\nclasses and a demo app that illustrates the use of each class.\n\nThe utilities\n\n|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Marker Clustering The `GMUClusterManager` helps you manage multiple markers at different zoom levels. This means you can put a large number of markers on a map without making the map hard to read. When a user views the map at a high zoom level, the individual markers show on the map. When the user zooms out to a lower zoom level, the markers gather together into clusters, to make viewing the map easier. For details, see the documentation on the [Marker Clustering](/maps/documentation/ios-sdk/utility/marker-clustering). |\n| No image for this utility. | Quadtree A quadtree is a data structure that's useful for finding points near a single point, by searching inside an area surrounding the point of interest. For details, see the documentation on the [Quadtree](/maps/documentation/ios-sdk/utility/quadtree). |\n| | KML KML is a popular format for rendering geographic data such as points, lines, and polygons. The `GMUKMLParser` lets you parse and render geographic data in the KML format. For details, see the documentation on the [KML](/maps/documentation/ios-sdk/utility/kml). |\n| | Import GeoJSON onto your map You can store features in [GeoJSON](http://geojson.org/) format and use this utility to render them as a layer on top of a map. Render geographic data in the GeoJSON format using `GMUGeoJSONParser` in conjunction with `GMUGeometryRenderer`. For details, see the documentation on the [GeoJSON](/maps/documentation/ios-sdk/utility/geojson). |\n| | Heatmaps Heatmaps make it easy for viewers to understand the distribution and relative intensity of data points on a map. Rather than placing a marker at each location, heatmaps use color and shape to represent the distribution of data. For details, see the documentation on the [Heatmaps](/maps/documentation/ios-sdk/utility/heatmap). |\n| | Custom markers Use the delegate [`GMUClusterRendererDelegate`](https://github.com/googlemaps/google-maps-ios-utils/blob/master/src/Clustering/View/GMUDefaultClusterRenderer.h) on `GMUDefaultClusterRenderer` to customize the properties of a marker before and after it is added to the map. |\n| | Geometry utilities A set of Swift spherical geometry utility functions of the [`GMSGeometryUtils`](/maps/documentation/ios-sdk/reference/objc/Functions) module of the Maps SDK for iOS. Use these extensions to perform many types of geometric operations, including: - Determine the great circle distance between coordinates - Determine if a coordinate is inside a polygon - Determine if a coordinate lies on or near a path within a specified tolerance - Determine the area of this polygon - many others |"]]