带 sprite 的样式图标 - Amazon Location Service

带 sprite 的样式图标

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

有关更多信息,请参阅《Amazon Location Service API 参考》中的 GetSprites

使用案例

  • 使用 sprite 表,为特定样式和配色方案渲染自定义地图元素。

  • 获取各种地图样式(例如标准、单色或混合)的 sprite。

  • 通过修改 sprite,自定义地图上的图标。

了解请求

该请求需要 URI 参数,例如 ColorSchemeFileNameStyle。这些参数允许根据地图的配色方案、样式和所需的特定 sprite 文件对 sprite 表进行自定义。

  • ColorScheme:定义 sprite 的配色方案,例如“浅色”或“深色”。

  • FileName:要检索的 sprite 文件的名称,可以是 PNG 文件,也可以是 JSON 文件。

  • Style:指定地图样式,例如“标准”或“单色”。

了解响应

该响应包含 CacheControlContentTypeETag 之类的标头,并以二进制 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.
Standard Dark
Collection of colorful icons and shapes representing various services and concepts.
Monochrome Light
Collection of various icons and shapes representing different concepts and services.
Monochrome Dark
Collection of various icons and shapes representing different concepts and services.
Hybrid
Collection of colorful icons representing various travel, transportation, and service symbols.