メインコンテンツまでスキップ
For the complete documentation index, see llms.txt.

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-json

The sprite index: where each icon sits in the sheet, and how big it is.

Parameters:

ParameterDescription
<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:

ParameterDescription
<style-id>Unique identifier for the style.
<icon-name>URL-encoded name of the sprite image.
--fileThe 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:

ParameterDescription
<style-id>Unique identifier for the style.
--fileFile 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:

ParameterDescription
<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:

ParameterDescription
<style-id>Unique identifier for the style.
--data/-dA JSON array of icon names, not an object.

Examples:

mapbox sprites delete-batch ckstyle00000000000000001a \
-d '["zz-clitest-5","zz-clitest-6"]'
このpageは役に立ちましたか?