Sprites
The sprite sheet a style draws its icons from, and the individual icons in
it. Every command here takes a style ID first, plus the common flags —
--username/-u, --token/-t, --profile, --id — described in
Shared parameters.
mapbox sprites get-jsonmapbox sprites uploadmapbox sprites upload-batchmapbox sprites deletemapbox sprites delete-batch
mapbox sprites get-json
The sprite index: where each icon sits in the sheet, and how big it is.
Parameters:
| Parameter | Description |
|---|---|
<style-id> | Unique identifier for the style. |
Examples:
mapbox sprites get-json ckstyle00000000000000001a
This read sits behind a 15-minute cache, so it can lag a recent upload or delete. The four commands below answer with the index themselves.
mapbox sprites upload
Adds one SVG to a style's sprite under the given icon name. Limits: 512 px per side, under 400 KB, and 1,000 images per sprite.
Parameters:
| Parameter | Description |
|---|---|
<style-id> | Unique identifier for the style. |
<icon-name> | URL-encoded name of the sprite image. |
--file | The SVG file. Its bytes become the request body. |
Examples:
mapbox sprites upload ckstyle00000000000000001a zz-clitest-1 \
--file icon.svg
mapbox sprites upload-batch
Adds up to 25 SVGs in one request, 100 KB each. Each icon takes its name
from its filename: zz-clitest-3.svg becomes the icon zz-clitest-3.
Parameters:
| Parameter | Description |
|---|---|
<style-id> | Unique identifier for the style. |
--file | File to upload, repeatable. Each becomes a part in the multipart field images. |
Examples:
mapbox sprites upload-batch ckstyle00000000000000001a \
--file zz-clitest-3.svg --file zz-clitest-4.svg
mapbox sprites delete
Removes one icon from the sprite.
Parameters:
| Parameter | Description |
|---|---|
<style-id> | Unique identifier for the style. |
<icon-name> | URL-encoded name of the sprite image. |
Examples:
mapbox sprites delete ckstyle00000000000000001a zz-clitest-1
mapbox sprites delete-batch
Removes up to 150 icons in one request.
Parameters:
| Parameter | Description |
|---|---|
<style-id> | Unique identifier for the style. |
--data/-d | A JSON array of icon names, not an object. |
Examples:
mapbox sprites delete-batch ckstyle00000000000000001a \
-d '["zz-clitest-5","zz-clitest-6"]'