Params of interest are prefixed by a colon (:
) in the listed endpoint.
- Params
styleId: string
: The ID for the style.
Retrieve the StyleJSON for a style. Adheres to the StyleJSON spec.
- Params
styleId: string
: The ID for the style.
Fetch the assets used to preview a style in a web page. Uses Mapbox GL JS for rendering. Mostly helpful for debugging purposes.
- Params
styleId: string
: The ID for the style.
Delete a style. Returns a 204 No Content
code if successful.
- Body
accessToken?: string
: Access token used to make upstream requests to the provider. Note that this access token will be persisted in the database and used for subsequent upstream requests.url: string
: The upstream URL to fetch the style from.style: StyleJSON
: A valid StyleJSON payload. Note that this will be ignored if theurl
param is provided.id?: string
: The ID to assign the created. If not provided, one will be randomly generated. This will only be used if thestyle
param is provided. Note that this will be ignored if theurl
param is provided.
Create a style, either by fetching a StyleJSON definition from an upstream source, or providing the raw payload of a valid definition. Returns the resulting StyleJSON that adheres to the StyleJSON spec.
- Params
styleId: string
: The ID of the style.spriteInfo: string
: The name of the sprite asset. May or may not include a scale factor at the end, such as@2x
,@3x
, etc. See Mapbox docs for more information.
Retrieve a sprite image for a style. Note that this is usually used by a map client (based on a style definition) and not directly by the end user (more info).
- Params
styleId: string
: The ID of the style.spriteInfo: string
: The name of the sprite asset. May or may not include a scale factor at the end, such as@2x
,@3x
, etc. See Mapbox docs for more information.
Retrieve the sprite JSON document for a style. Note that this is usually used by a map client (based on a style definition) and not directly by the end user (more info).
- Params:
fontstack
: A comma-separated list of font names. Ensure that this string is URL-encoded.start
: A multiple of256
between0
and65280
end
:start
plus255
- Query:
styleId
(optional): The ID of the style requesting the glyphs. This is used to determine the upstream url to use for fetching glyphs from a remote service if necessary. If not provided, the server will only attempt to find a locally available match.access_token
(optional): An access token that may be needed to make upstream requests to a remote service.
Get a glyph range. This is typically used by a map renderer and most end-users will not directly make requests to this endpoint.
A successful response will return the protocol buffer-encoded sdf value for the requested range i.e. a Content-Type
header of application/x-protobuf
.
This endpoint goes through the following steps to determine what to respond with:
- Check if there any matches for a locally stored font.
- If there is a match, return the glyphs using that font.
- If there is no match, proceed to step 2.
- If
styleId
is provided, look up the associated upstream fonts url for the style and use that to make an upstream request. The upstream request can potentially fail if an access token is needed andaccess_token
is not provided.- If the upstream request succeeds, forward that response.
- If the upstream request fails due to:
- a non-404 upstream HTTP error, forward the error
- lack of internet connection or a
440 Not Found
error, go to step 3
- Return the glyph range using the default pre-bundled font (Opens Sans)
- Params
tilesetId: string
: The ID of the tileset.
Retrieve the tilejson definition of a tileset. Adheres to the TileJSON spec.
- Params
tilesetId: string
: The ID of the tileset.
- Body
- A valid TileJSON definition that adheres to the TileJSON spec.
Update a tileset. Returns the updated tileset TileJSON if successful.
- Params
tilesetId: string
: The ID of the tileset.zoom: number
: The zoom level of the tile.x: number
: The x coordinate of the tile.y: number
: The y coordinate of the tile.
Retrieve a tile for a given tileset. Note that this is usually used by a map client (based on a style definition) and not directly by the end user (more info).