maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.19k stars 632 forks source link

Styling mbtiles with config files. #937

Open ursha opened 1 year ago

ursha commented 1 year ago

Im running tileserver-gl with docker:

docker run --rm -it -v /webmap/:/data -p 8080:8080 maptiler/tileserver-gl

My config file: { "data": { "Goldfields": { "mbtiles": "Goldfields_data.mbtiles" } }, "styles": { "GoldfieldsStyle": { "style": "styles.json" } }, "tiles": { "GoldfieldsTiles": { "url": "mbtiles://data/Goldfields" } } } My styles file : { "version": 8, "sources": { "Goldfields": { "type": "vector", "url": "Goldfields" } }, "layers": [ { "id": "GoldfieldsLayer", "type": "circle", "source": "Goldfields", "source-layer": "Goldfields", "paint": { "circle-color": "blue", "circle-radius": 5 } } ] } I see the style in tileserver web interface. But the style is not applied to my data. Any response appreciated.

node --version v16.17.0

npm --version 8.15.0

mmc1718 commented 1 year ago

Hello,

Do you have an options section in your config.json with paths defined?

e.g. I use something like "options": { "paths": { "root": "", "fonts": "/usr/src/app/node_modules/tileserver-gl-styles/fonts", "styles": "styles", "mbtiles": "" } },

You could try running without the config and use the --verbose parameter to see what default paths it uses to get an idea. I would try copying that and then replace 'styles' with the path to your style file (must be relative to the 'root' path)