Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving multiple maps (.MBTiles) in th same server. #1209

Open
fr111 opened this issue Mar 13, 2024 · 2 comments
Open

Serving multiple maps (.MBTiles) in th same server. #1209

fr111 opened this issue Mar 13, 2024 · 2 comments

Comments

@fr111
Copy link

fr111 commented Mar 13, 2024

Hello everyone,

I'm trying to serve multiple maps in my tileserver-gl server free version deployed in Linux Ubuntu 22.04 but unfortunately I just can serve one. My maps are in the folder /data but the server just reads the first one (alphabetic order). I already made a lot of changes in the file style/config.json and in the file /build/style/style.json.
My server is being deployed with docker containers.
I have two .mbtiles with different maps. I want to access them using QGIS desktop. I can access one but the second one the system simple does not read it.
It's enough just to make changes in config.json or I need to make changes also in style.json?
Can you provide me an example?
Why the system just reads the first map?

Thank you.

Regards,

FR

@acalcutt
Copy link
Collaborator

acalcutt commented Mar 13, 2024

Without a config and no mbtiles files specified, tileserver-gl just picks the first mbtiles file in the directory. It sounds like you have an issue where it is not using your config file and is just picking up the first mbtiles file.

When using docker, typically you have a local folder set up. it looks like in your case that is 'build', so it would look something like this (it doesn't need to be exactly like this, it is just an example)

/build/config.json
/build/fonts/
/build/styles/stylename/style.json
/build/sprites 

If you look at the second example at https://github.com/maptiler/tileserver-gl?tab=readme-ov-file#getting-started-with-docker you can see an example of this structure at https://github.com/maptiler/tileserver-gl/releases/download/v1.3.0/test_data.zip

In the example command
docker run --rm -it -v $(pwd):/data -p 8080:8080 maptiler/tileserver-gl
$(pwd) is the local folder that is being mapped to /data inside the docker machine. You can either browse to your /build path before running this command, or change the command to
docker run --rm -it -v /build:/data -p 8080:8080 maptiler/tileserver-gl
by default, tileserver-gl is looking for a config.json in your root path, wich is /data, and /data maps to what is inside your local /build folder

You could also tell tileserver-gl the path to your config file, you just what to remember inside the docker all your paths start with /data , so if your config is in style/config.json , you can specy the config location with -c
docker run --rm -it -v /build:/data -p 8080:8080 maptiler/tileserver-gl -c /data/style/config.json

In my own server at tiles.wifidb.net, I use a config like this
https://github.com/acalcutt/wifidb-tileserver-gl/blob/master/tileserver-gl/configs/config-pmtiles.json
(note though I am not using docker here, so my paths are a little different that what you will need)

Don't forget to check out the documentation at
https://maptiler-tileserver.readthedocs.io/en/latest/config.html

@fr111
Copy link
Author

fr111 commented Mar 15, 2024

Hello Acalcutt,

hope you are well.

Thank you very much for your explanation.

Regards
FR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants