Yeah, that’s what I’ve been doing. My map uses raster tiles that I rendered years ago using TileMill. I’m hosting these tiles as static files on a server, and pointing my app to a Mapbox style hosted on that server. The style looks like this (I’ve omitted the full URL here):
{
"version": 8,
"name": "Forest Maps",
"sources": {
"BaseMap": {
"type": "raster",
"tiles": [
"https://------/tiles/{z}/{x}/{y}.png"
],
"tileSize": 128
}
},
"layers": [
{
"id": "BaseMap",
"type": "raster",
"source": "BaseMap",
"minzoom": 3,
"layout": {
"visibility": "visible"
}
}
]
}The same type of thing could be done with vector tiles, but you’d probably need to use a tool like TileServer GL:
I played around with this at one point, and got it working, but didn’t pursue it much further, since my map is just raster data.
An issue I ran into when setting up my own vector server was that none of the Mapbox vector data (Mapbox Streets, Vector Terrain, etc.) is available outside Mapbox studio. If you’re using only your own data and none of the tilesets provided by Mapbox, TileServer GL will probably work for you.