适用于 Google 地图网络服务的客户端库
适用于 Google 地图服务的 Java 客户端、Python 客户端、Go 客户端和 Node.js 客户端是由社区提供支持的客户端库,并且根据 Apache 2.0 许可开放源代码。您可以在 GitHub 下载这些客户端库、贡献代码并查找安装说明和示例代码:
为何要使用客户端库?
借助适用于 Google 地图服务的 Java 客户端、Python 客户端、Go 客户端和 Node.js 客户端,您可以在自己的服务器上使用 Google 地图网络服务。这些客户端库封装了以下 API 的功能:
除了这些 API 提供的功能外,客户端库还能略微简化一些常见任务。
- 自动速率限制:默认情况下,按照各网络服务的预期速率限制发送请求。您可以通过
new GeoApiContext().setQueryRateLimit(qps)
提供自定义 QPS 限制。
- 失败时重试:客户端库将在 API 发送
5xx
错误时自动重试任何请求。重试使用指数退避,这有助于解决间歇性故障。
- 轻松进行身份验证:利用客户端库,您可以使用免费提供的 API 密钥轻松进行身份验证。Google Maps Platform 专业版方案客户可以使用其客户端 ID 和密钥进行身份验证。
- POJO:Java 客户端库将针对每个 API 响应返回原生对象。Python 客户端库将从 API 收到的结构原样返回。
- 异步或同步:所有请求都支持同步或异步调用样式。
条款及条件
适用于 Google 地图网络服务的客户端库已获得 Apache 2.0 许可。
客户端库是 Google 地图网络服务的封装容器。使用 Google 地图网络服务时,需遵守 Google Maps Platform 服务条款。
重要提示:这些客户端库不在标准 Google 弃用政策或支持协议的涵盖范围内。
API 密钥和客户端 ID
每项 Google 地图网络服务都需要 API 密钥或客户端 ID。如需了解何时使用 API 密钥、何时使用客户端 ID,以及如何获取 API 密钥或客户端 ID,请参阅您正在使用的 API 对应的身份验证指南:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-09-20。
[null,null,["最后更新时间 (UTC):2023-09-20。"],[[["Community-supported client libraries for Google Maps Services are available in Java, Python, Go, and Node.js, offering convenient access to various Google Maps APIs like Directions, Geocoding, and Places."],["These open-source libraries, under the Apache 2.0 License, simplify development with features such as automatic rate limiting, retry mechanisms, and easy authentication."],["Client libraries provide synchronous and asynchronous calling styles while adhering to the Google Maps Platform Terms of Service."],["They are not covered by Google's standard deprecation policy or support agreement and require an API key or client ID for usage, obtainable through API-specific authentication guides."]]],["Community-supported Java, Python, Go, and Node.js client libraries for Google Maps Services are available on GitHub under the Apache 2.0 License. These clients wrap APIs like Address Validation, Directions, and Places, offering features such as automatic rate limiting, retry on failure, and easy authentication via API keys or client IDs. They facilitate server-side interaction with Google Maps web services. The libraries support both synchronous and asynchronous requests.\n"]]