如何在静态地图的半径和缩放之间做出选择 - Amazon Location Service

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

如何在静态地图的半径和缩放之间做出选择

在本主题中,您将学习如何在使用radiuszoom何时使用 Amazon Location Service 生成静态地图之间做出选择。该radius参数可以更精确地控制覆盖区域,因此非常适合面向客户的应用程序,因为您知道确切的覆盖区域。当您想要调整显示的细节级别时,该zoom参数更适合用于地理空间分析。

有半径

在本示例中,您将使用radius带有中心位置的参数创建斯里兰卡的地图图像。

Request URL
https://maps.geo.eu-central-1.amazonaws.com/v2/static/map?style=Satellite&width=700&height=700&center=80.60596,7.76671&radius=235000&scale-unit=KilometersMiles&key=API_KEY
Response image
Satellite view of Sri Lanka, showing the teardrop-shaped island nation surrounded by ocean.

带变焦功能

在本示例中,您将使用zoom带有中心位置的参数创建斯里兰卡的地图图像。

Request URL
https://maps.geo.eu-central-1.amazonaws.com/v2/static/map?style=Satellite&width=700&height=700&zoom=8&center=80.60596,7.76671&scale-unit=KilometersMiles&key=API_KEY
Response image
Satellite view of Sri Lanka, showing the teardrop-shaped island nation surrounded by ocean.