Static Tiles API
The Mapbox Static Tiles API serves raster tiles generated from Mapbox Studio styles. Raster tiles can be used in traditional web mapping libraries like Leaflet, OpenLayers, and others to create interactive slippy maps. The Static Tiles API is well-suited for maps with limited interactivity or use on devices that do not support WebGL.
Retrieve raster tiles from styles
Retrieve raster tiles from a Mapbox Studio style.
- The returned raster tile will be 512 pixels by 512 pixels by default.
- If the queried tileset contains raster layers, the returned tile will be a JPEG.
- If the queried tileset contains only vector layers, the returned tile will be a PNG.
Leaflet.js uses this endpoint to render raster tiles from a Mapbox Studio style with L.tileLayer
.
Required parameters | Type | Description |
---|---|---|
username | string | The username of the account to which the style belongs. |
style_id | string | The ID of the style from which to return a raster tile. |
{z}/{x}/{y} | integer | The tile coordinates as described in the Slippy Map Tilenames specification. They specify the tile's zoom level {z} , column {x} , and row {y} . |
You can further refine the results from this endpoint with the following optional parameters:
Optional parameters | Type | Description |
---|---|---|
tilesize | integer | The size in pixels of the returned tile, either 512 or 256 . The default is 512×512 pixels. Requesting 256×256 tiles from the endpoint can have significant cost implications because they are one quarter of the size of 512×512 tiles. Thus requiring 4 times as many API requests to render the same area. Review the pricing guide for details. |
@2x | string | Render the raster tile at a @2x scale factor, so tiles are scaled to 1024×1024 pixels. |
Note that 512×512 image tiles are offset by one zoom level compared to 256×256 tiles. For example, 512×512 tiles at zoom level 4 are equivalent to 256×256 tiles at zoom level 5.
Example request: Retrieve raster tiles from styles
# Returns a default 512×512 pixel tile as a JPEG
$ curl "https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/1/1/0?access_token=YOUR_MAPBOX_ACCESS_TOKEN"
# Returns a 1024×1024 pixel tile as a JPEG
$ curl "https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/512/1/1/0@2x?access_token=YOUR_MAPBOX_ACCESS_TOKEN"