

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

# 如何获取特定位置的静态地图
<a name="get-static-map-specific-position"></a>

在本主题中，您将了解如何根据特定参数从 Amazon Location Service 检索静态地图。您将了解如何为中心位置、边界框和一组有界位置生成静态地图。提供的示例将帮助您自定义地图的宽度、高度和样式。

**注意**  
生成静态地图时必须传递 `map` 或 `map@2x`。

## 获取中心位置的地图图像
<a name="get-map-center-position"></a>

在本示例中，您将创建一个宽度为 `1024`、高度为 `1024` 的地图图像，中心坐标设置为 `-123.1143,49.2763`，其中 `longitude=-123.1143` 且 `latitude=49.2763`，缩放级别为 `15`。

------
#### [ Request URL ]

```
https://maps.geo.eu-central-1.amazonaws.com/v2/static/map?style=Satellite&width=1024&height=1024&zoom=15&center=-123.1156126,49.2767046&key=API_KEY
```

------
#### [ Response image ]

![\[Aerial view of a coastal city with dense urban layout, harbor, and large stadium visible.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/static-center.png)


------

## 获取边界框的地图图像
<a name="get-map-bounding-box"></a>

在本示例中，您将通过设置东南亚地区的边界框来生成该区域的地图图像。

`bbox` 格式为 `{southwest_longitude},{southwest_latitude},{northeast_longitude},{northeast_latitude}`。

------
#### [ Request URL ]

```
https://maps.geo.eu-central-1.amazonaws.com/v2/static/map?style=Satellite&width=1024&height=1024&bounding-box=90.00,-21.94,146.25,31.95&key=API_KEY
```

------
#### [ Response image ]

![\[Satellite view of Southeast Asia, showing mainland, islands, and surrounding waters.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/static-bounding-box.png)


------

## 获取有界位置的地图图像
<a name="get-map-bounded-positions"></a>

在本示例中，您将生成一张覆盖巴黎多个必游之地的地图，每个景点都用其坐标（经度、纬度）进行了标注。有界位置包括：埃菲尔铁塔、卢浮宫博物馆、巴黎圣母院、香榭丽舍大街、凯旋门、圣心大教堂、卢森堡花园、奥赛博物馆、协和广场和巴黎歌剧院。

边界位置的格式为 `{longitude1},{latitude1},{longitude2},{latitude2} ... {longitudeN},{latitudeN}`。

------
#### [ Request URL ]

```
https://maps.geo.eu-central-1.amazonaws.com/v2/static/map?style=Satellite&width=1024&height=1024&bounded-positions=2.2945,48.8584,2.3376,48.8606,2.3500,48.8529,2.3076,48.8698,2.2950,48.8738,2.3431,48.8867,2.3372,48.8462,2.3266,48.8600,2.3212,48.8656,2.3317,48.8719&key=API_KEY
```

------
#### [ Response image ]

![\[Aerial view of Paris showing dense urban layout, Seine River, and iconic landmarks.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/static-bounding-position.png)


------