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.24k stars 639 forks source link

How to add new vectors #40

Closed jinky32 closed 8 years ago

jinky32 commented 8 years ago

Hi,

I'm sorry that this is such a newbie question but there you go!

I've followed the instructions on this repo and the application is running nicely on localhost. However I had/have the same 404 issue described in #37. Following advice I have re-downloaded the vectors and also added some other ones.

I would like to show one of my own vectors which is relevant to the UK. I have downloaded the UK vector and have modified config.json:

"data": { "uk-vector": { "mbtiles": "zurich_switzerland.mbtiles", "mbtiles": "united_kingdom.mbtiles", "mbtiles": "switzerland.mbtiles", "mbtiles": "outdoor800.mbtiles" } }

I have also modified basic-v9.json:

"sources": { "mapbox": { "url": "mbtiles://switzerland.mbtiles", "type": "vector", "url": "mbtiles://outdoor800.mbtiles", "type": "vector", "url": "mbtiles://united_kingdom.mbtiles", "type": "vector", "url": "mbtiles://zurich_switzerland.mbtiles", "type": "vector" } },

however when I run the application I still get 404 errors such as:

GET /data/zurich-vector/6/33/21.pbf 404 3.944 ms - 19 GET /data/zurich-vector/6/32/22.pbf 404 3.709 ms - 19

which I guess means some config somewhere is still looking for the zurich vector even though it is not referenced in config.json or basic-v9.json.

Also when I try to zoom out to see the UK I see:

screen shot 2016-08-12 at 9 09 24 am

What am I missing?!

klokan commented 8 years ago

Thanks @jinky32 for a nice newbie request - this is important for us to know what is not clear on this open-source project and on the configuration.

A fast answer: data section defines identifiers - each can have only one mbtiles file in - and the identifier creates the public URL like /data/{your-identifier}/{z}/{x}/{y}.pbf.

@petrsloup - a clear request for a chapter in the manual?

jinky32 commented 8 years ago

@klokan @petrsloup OK thanks!

So I can modify data as such: "data": { "uk-vector": { "mbtiles": "united_kingdom.mbtiles" }, "uk-coverage": { "mbtiles": "outdoor800.mbtiles" } }

and the vector data appears correctly in the interface at http://localhost:8080/ (in the data section), but how do I see my own data outdoor800.mbtiles overlaid on united_kingdom.mbtiles?

I've tried modifying bright-v9.json in two ways: "sources": { "mapbox": { "url": "mbtiles://united_kingdom.mbtiles", "url": "mbtiles://outdoor800.mbtiles", "type": "vector" } },

and

"sources": { "mapbox": { "url": "mbtiles://united_kingdom.mbtiles", "type": "vector" }, "mapbox": { "url": "mbtiles://outdoor800.mbtiles", "type": "vector" } },

but get 404 errors such as:

GET /data/uk-coverage/9/269/180.pbf 404 6.170 ms - 19 GET /data/uk-coverage/8/133/89.pbf 404 3.549 ms - 19

for both

klokan commented 8 years ago

A similar problem again: "mapbox" is an identifier of source under "sources". You can choose your id - but it is not possible to have two sources with the same name - which you have now...

See: https://www.mapbox.com/mapbox-gl-style-spec/

BTW we offer commercial consulting and support for TileServer-GL. Contact info@klokantech.com if you are interested.

jinky32 commented 8 years ago

@klokan I am interested and have a call with you tomorrow at 14.00 ;-)

petrsloup commented 8 years ago

See http://tileserver.readthedocs.io/