文章目录
- Coogle Maps Platform
-
- 一、Overview - - 概观
-
- 1. A Quick Example - - 一个简单的例子
- 2. Authentication, quotas, pricing
-
-
- ① Authentication
- ② Quotas and pricing
- ③ Policies
-
- 3. Learn more
Coogle Maps Platform
谷歌地图平台
一、Overview - - 概观
Before you begin:
Before you start using the Maps Static API, you need a project with a billing account and the Maps Static API enabled.To learn more, see Get Started with Google Maps Platform.
开始之前:
在开始使用地图静态api之前,你需要一个具有计费账户并启用了地图静态api的项目。要了解更多信息,请参阅 谷歌地图平台 – 开始使用。
The Maps Static API lets you embed a Google Maps image on your web page without requiring JavaScript or any dynamic page loading. The Maps Static API service creates your map based on URL parameters sent through a standard HTTP request and returns the map as an image you can display on your web page.
使用地图的静态API让你可以在你的网页上嵌入Google地图图像,而无需JavaScript或任何动态页面加载。地图静态API服务根据标准HTTP请求发送的URL参数创建地图,并将该地图返回为可在网页上显示的图像。
1. A Quick Example - - 一个简单的例子
The following example contains the URL of a Maps Static API image of downtown New York City, which is displayed below:
以下示例包含纽约市区的地图静态API图像的URL,如下所示:
https://maps.googleapis.com/maps/api/staticmap?center=*lyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap
&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318
&markers=color:red%7Clabel:C%7C40.718217,-73.998284
&key=YOUR_API_KEY
Notice that you don’t need to do anything “special” to get this image to show up on the page. No JavaScript is required. All we needed to do was create a URL, and place it within an <img> tag. You can place a Google Static Maps anywhere on your webpage where you can place an image.
请注意,你无需执行任何“特殊”操作即可将该图像显示在页面上。不需要JavaScript。我们需要做的就是创建一个URL,并将其放在<img>标记中。你可以将Google静态地图放置在网页上可以放置图像的任何位置。
2. Authentication, quotas, pricing
身份验证、配额、定价和策略
① Authentication
身份验证
To use the Maps Static API, you must first enable the API and obtain the proper authentication credentials. For more information, see Get Started with Google Maps Platform.
要使用地图静态API,你必须首先启用API并获取正确的身份验证凭据。有关更多信息,请参阅Google地图平台 – Get Started 。
② Quotas and pricing
配额和定价
Review the usage and billing page for details on the quotas and pricing set for the Maps Static API.
请查看使用情况和计费页面,以详细了解地图静态API的配额和定价。
③ Policies
政策
Use of the Maps Static API must be in accordance with the Google Maps Platform Terms of Service.
地图静态API的使用必须符合Google地图平台的服务条款。
3. Learn more
学更多
See the Maps Static API developers guide for more examples, parameter usage, troubleshooting, and other details.
有关更多示例,参数用法,故障排除和其他详细信息,请参见地图静态API开发人员指南。
The Maps Static API developers guide is intended for website and mobile developers who want to include Maps Static API images within a webpage or mobile application.It provides an introduction to using the API and reference material on the available parameters.
地图静态API开发人员指南 适用于希望在网页或移动应用程序中包含地图静态API图像的网站和移动开发人员。它介绍了如何在可用参数上使用API和参考资料。