Thư viện ứng dụng cho Dịch vụ web của Google Maps
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.
Ứng dụng Java, Ứng dụng Python, Ứng dụng Go và Ứng dụng Node.js cho Dịch vụ bản đồ của Google là các thư viện ứng dụng do cộng đồng hỗ trợ, nguồn mở theo Giấy phép Apache 2.0. Bạn có thể tải xuống và đóng góp các tệp này trên GitHub. Tại đây, bạn cũng sẽ tìm thấy hướng dẫn cài đặt và mã mẫu:
Tại sao nên sử dụng thư viện ứng dụng?
Ứng dụng Java, Ứng dụng Python, Ứng dụng Go và Ứng dụng Node.js cho Dịch vụ Google Maps cho phép bạn làm việc với các dịch vụ web của Google Maps trên máy chủ của mình.
Các API này gói chức năng của các API sau:
Ngoài chức năng do các API này cung cấp, thư viện ứng dụng còn giúp thực hiện một số tác vụ phổ biến dễ dàng hơn một chút.
- Tự động giới hạn tốc độ Theo mặc định, các yêu cầu được gửi ở giới hạn tốc độ dự kiến cho từng dịch vụ web. Bạn có thể cung cấp giới hạn QPM tuỳ chỉnh bằng
new GeoApiContext().setQueryRateLimit(qpm)
.
- Thử lại khi không thành công Thư viện ứng dụng sẽ tự động thử lại mọi yêu cầu nếu API gửi lỗi
5xx
. Các lần thử lại sử dụng thời gian đợi luỹ thừa, giúp ích trong trường hợp xảy ra lỗi không liên tục.
- Xác thực dễ dàng Thư viện ứng dụng giúp bạn dễ dàng xác thực bằng khoá API.
- POJO Thư viện Java trả về các đối tượng gốc cho từng phản hồi API. Thư viện Python trả về cấu trúc như nhận được từ API.
- Không đồng bộ hoặc đồng bộ Tất cả yêu cầu đều hỗ trợ kiểu gọi đồng bộ hoặc không đồng bộ.
Điều khoản và điều kiện
Thư viện ứng dụng khách cho các dịch vụ web của Google Maps được cấp phép theo Giấy phép Apache 2.0.
Thư viện ứng dụng khách là trình bao bọc cho các dịch vụ web của Google Maps. Các dịch vụ web của Google Maps chịu sự điều chỉnh của Điều khoản dịch vụ của Nền tảng Google Maps.
Lưu ý quan trọng: Các thư viện này không thuộc phạm vi chính sách ngừng sử dụng hoặc thoả thuận hỗ trợ tiêu chuẩn của Google.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[],[],null,["# Client Libraries for Google Maps Web Services\n\nThe Java Client, Python Client, Go Client and\nNode.js Client for Google Maps Services are community supported client libraries, open sourced under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0). They are\navailable for download and contributions on GitHub, where you will also find installation\ninstructions and sample code: \n\n- [Java Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-java)\n- [Python Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-python)\n- [Go Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-go)\n- [Node.js Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)\n- [Objective-C Client for Google Maps Services](https://github.com/google/google-api-objectivec-client-for-rest)\n- [Google API Client - Java Developer's Guide](/api-client-library/java/google-api-java-client/dev-guide)\n\nWhy use the client libraries?\n-----------------------------\n\nThe Java Client, Python Client, Go Client\nand Node.js Client for Google Maps Services enable you to work with Google Maps web services on your server.\nThey wrap the functionality of the following APIs:\n\n- [Directions API (Legacy)](/maps/documentation/directions)\n- [Distance Matrix API (Legacy)](/maps/documentation/distancematrix)\n- [Elevation API](/maps/documentation/elevation)\n- [Geocoding API](/maps/documentation/geocoding)\n- [Places API](/maps/documentation/places/web-service)\n- [Roads API](/maps/documentation/roads)\n- [Time Zone API](/maps/documentation/timezone)\n\nIn addition to the functionality provided by these APIs, the client libraries\nmake some common tasks a little easier.\n\n- **Automatic Rate Limiting** By default, requests are sent at the expected rate limit for each web service. You can provide custom QPM limits with `new GeoApiContext().setQueryRateLimit(qpm)`.\n- **Retry on Failure** The client libraries will automatically retry any request if the API sends a `5xx` error. Retries use exponential back-off, which helps in the event of intermittent failures.\n- **Easy Authentication** The client libraries make it easy to authenticate with your API key.\n- **POJOs** The Java libraries return native objects for each of the API responses. The Python libraries return the structure as it is received from the API.\n- **Asynchronous or synchronous** All requests support synchronous or asynchronous calling style.\n\nTerms and conditions\n--------------------\n\nThe client libraries for the Google Maps web services are licensed under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\n\nThe client libraries are wrappers for the Google Maps web services. The Google Maps\nweb services are governed by the [Google Maps Platform Terms of Service](https://cloud.google.com/maps-platform/terms).\n\n**Important** : These libraries are **not covered**\nby the standard Google deprecation policy or support agreement."]]