

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

# 带 sprite 的样式图标
<a name="styling-iconography-with-sprites"></a>

sprite 是一种便携式网络图形（PNG）图像文件，其中包含小型栅格图像，例如图标、标记以及地图上渲染的其他元素。可以根据样式、配色方案和变体等参数自定义 sprite。Amazon Location Service 通过 `GetSprites` API 提供 sprite 表。您也可以使用自定义图标，方法是加载自己的图标集（参阅[如何在地图上添加图标](how-to-add-icon-on-map.md)），或自定义样式描述符以加载您的自定义 sprite。

欲了解更多信息，请参阅[GetSprites](https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetSprites.html)《*亚马逊定位服务 API 参考*》。

## 使用案例
<a name="use-cases"></a>
+ 使用 sprite 表，为特定样式和配色方案渲染自定义地图元素。
+ 获取各种地图样式（例如标准、单色或混合）的 sprite。
+ 通过修改 sprite，自定义地图上的图标。

## 了解请求
<a name="styling-understand-the-request"></a>

该请求需要 URI 参数，例如 `ColorScheme`、`FileName` 和 `Style`。这些参数允许根据地图的配色方案、样式和所需的特定 sprite 文件对 sprite 表进行自定义。
+ **`ColorScheme`**：定义 sprite 的配色方案，例如“浅色”或“深色”。
+ **`FileName`**：要检索的 sprite 文件的名称，可以是 PNG 文件，也可以是 JSON 文件。
+ **`Style`**：指定地图样式，例如“标准”或“单色”。

## 了解响应
<a name="styling-understand-the-response"></a>

该响应包含 `CacheControl`、`ContentType` 和 `ETag` 之类的标头，并以二进制 blob 或 JSON 文件的形式返回 sprite 数据。这些标头包含缓存信息、响应的内容类型以及 sprite 数据的版本控制。
+ **`CacheControl`**：sprite 文件的缓存配置。
+ **`ContentType`**：响应的格式，表明是包含 PNG 数据，还是 JSON 数据。
+ **`ETag`**：sprite 版本的标识符，用于进行缓存验证。
+ **`Blob`**：包含 sprite 表的主体或 JSON 偏移文件。

------
#### [ Standard Light ]

![\[Collection of colorful icons representing various services and concepts in cloud computing.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/styling-standard-light.png)


------
#### [ Standard Dark ]

![\[Collection of colorful icons and shapes representing various services and concepts.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/styling-standard-dark.png)


------
#### [ Monochrome Light ]

![\[Collection of various icons and shapes representing different concepts and services.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/styling-monochrome-light.png)


------
#### [ Monochrome Dark ]

![\[Collection of various icons and shapes representing different concepts and services.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/styling-monochrome-dark.png)


------
#### [ Hybrid ]

![\[Collection of colorful icons representing various travel, transportation, and service symbols.\]](http://docs.aws.amazon.com/zh_cn/location/latest/developerguide/images/styling-hybrid.png)


------