适用于 Google 地图网络服务的客户端库
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
适用于 Google 地图服务的 Java 客户端、Python 客户端、Go 客户端和 Node.js 客户端是由社区提供支持的客户端库,并且根据 Apache 2.0 许可开放源代码。您可以在 GitHub 下载这些客户端库、贡献代码并查找安装说明和示例代码:
为何要使用客户端库?
借助适用于 Google 地图服务的 Java 客户端、Python 客户端、Go 客户端和 Node.js 客户端,您可以在自己的服务器上使用 Google 地图网络服务。这些客户端库封装了以下 API 的功能:
除了这些 API 提供的功能外,客户端库还能略微简化一些常见任务。
- 自动速率限制:默认情况下,按照各网络服务的预期速率限制发送请求。您可以通过
new GeoApiContext().setQueryRateLimit(qpm)
提供自定义 QPM 限制。
- 失败时重试:客户端库将在 API 发送
5xx
错误时自动重试任何请求。重试使用指数退避,这有助于解决间歇性故障。
- 轻松进行身份验证:利用客户端库,您可以使用 API 密钥轻松进行身份验证。
- POJO:Java 客户端库将针对每个 API 响应返回原生对象。Python 客户端库将从 API 收到的结构原样返回。
- 异步或同步:所有请求都支持同步或异步调用样式。
条款及条件
适用于 Google 地图网络服务的客户端库已获得 Apache 2.0 许可。
客户端库是 Google 地图网络服务的封装容器。使用 Google 地图网络服务时,需遵守 Google Maps Platform 服务条款。
重要提示:这些客户端库不在标准 Google 弃用政策或支持协议的涵盖范围内。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[],[],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."]]