PMTiles icon indicating copy to clipboard operation
PMTiles copied to clipboard

Self hosting

Open ethicnology opened this issue 1 year ago • 3 comments

Hello, protomaps looks an amazing project but when it comes to self-hosting without using a listed provider or caddy there is not so much informations.

After using the command pmtiles serve and then trying to load the URL into pmtiles viewer it doesn't display anything (offset is outside the bounds of the DataView) while my logs display :

2024/10/05 12:54:13 main.go:154: served 204 %2F in 62.207µs
2024/10/05 12:54:30 main.go:154: served 204 %2F in 25.889µs
2024/10/05 12:55:02 main.go:154: served 204 %2F in 21.801µs
2024/10/05 12:55:36 main.go:154: served 204 %2F in 19.316µs
…

From pmtiles viewer I've tried, I'm serving --cors="*" 20241004.pmtiles:

  • plain http on localhost:8080
  • plain http on remote host
  • https (ssl) on remote host
  • https (ssl) through reverse proxy

ethicnology avatar Oct 05 '24 17:10 ethicnology

the PMTiles viewer is designed for client-side decoding, if you are running pmtiles serve you can use any map renderer that supports ZXY urls like maputnik: http://maplibre.org/maputnik/

but I understand it may be convenient to view those: #286

without using a listed provider or caddy there is not so much informations.

What information would be helpful in addition to these?

https://docs.protomaps.com/pmtiles/cli#serve https://docs.protomaps.com/deploy/server

bdon avatar Oct 07 '24 02:10 bdon

Thank you for your time and quick answer.

I guess once we use the command pmtiles serve what we want is to try the setup.

For example, I tried maputnik but I can't do much, I tried to open various URL on my self-hosted and then from protomaps api, they all fail.

https://api.protomaps.com/tiles/v3.json?key=with_my_key
https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=with_my_key

I also tried to use .png because most libraries are compatible with this format but it doesn't seems to work either.

ethicnology avatar Oct 08 '24 11:10 ethicnology

I tried maputnik but I can't do much

You need to add it as a TileJSON (vector) source

https://api.protomaps.com/tiles/v3.json?key=with_my_key

did you allow the CORS origin https://maplibre.org ?

I also tried to use .png because most libraries are compatible with this format but it doesn't seems to work either.

PMTiles only stores one tile type, if you store vector data you need to fetch vector data.

bdon avatar Oct 10 '24 16:10 bdon