I am trying to customize a style.json to add a WMS for mapbox using the docs:
https://docs.mapbox.com/mapbox-gl-js/style-spec/
Specifically this part:
By providing a url to a WMS server that supports EPSG:3857 (or EPSG:900913) as a source of tiled data. The server url should contain a "{bbox-epsg-3857}"replacement token to supply the bbox parameter.
"wms-imagery": {
"type": "raster",
"tiles": [
'http://a.example.com/wms?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=example'
],
"tileSize": 256
}
I've tried various iterations of code but I can't seem to figure it out. I think I've got the right structure. I am not new to coding (python) but I am new to using this tool, so I am sure it's something simple.
Here is the Sources section of the json that is causing the error:
"sources": {
"composite": {
"url": "mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,<hiddenmapboxid>",
"type": "vector"
},
"fires_viirs_24": {
"type": "raster",
"tiles":[
"https://firms.modaps.eosdis.nasa.gov/wms/?REQUEST=GetMap&layers=fires_viirs_24&WIDTH=512&HEIGHT=512&BBOX={bbox-espg-3857}&SRS=EPSG:3857&MAP_KEY=<hiddenAPIKey>"
],
"tileSize": 512
}
}
this causes "style must include source url" error. But as far as I can see it's formatted exactly like the docs says it should be.
I've tried surrounding the "tiles" url like '' which throws an "unexpected token" error. Then tried "" and got "style must include source url". Also tried using the "url" instead of the "tiles" and got "invalid url".
Thanks for any help!