We're doing something like this behind Cloudflare R2, same concept of owning the map infra (for privacy and access-control) and reducing load on public infrastructure.
If you are into this stuff, you can view PMTiles from the CLI with "gloss", or try to drag-and-drop on its web interface [1]. It seems large tiles (>128M) and some raster formats are failing; plus it would be nice to load from URL there. Will fix that...
(AI warning). ntmaps [2] is a Golang library that lets you use different tile providers, deployable in terminal or browser. ntplaygrounds [3] uses that and nt3d and ntactor to make a city simulation. Data is pulled from OpenStreetMap in those.
Yeah, me neither. I opened the link along with several other article links from the front page so it sat idle in a separate private tab waiting for me to get to it and just as I clicked on it MWB popped the warning. I'm using LibreOffice with container tabs and MWB Pro under Win10 Pro. Probably nothing.
You can use the pmtiles:// protocol in Maplibre GL, requires protomaps.js and a few lines of setup [1]
My experience with it is ... ok. It works. But going directly to cloud storage (s3 in my case) is unpredictable latency and neither the browser nor most servers really cache HTTP range requests granularly, so every tile is another high-latency round trip. Not worth it - I ended up putting Martin tile server in front of it.
I assume someone could write a protomaps adapter in WASM with some smart caching? Until then, Standard GET requests are just easier to cache and perform much better in practice. The downside being you have to run a server or statically generate files.
For what it's worth I think latency/reliability varies a lot with provider. Bunny Storage has quite good latency in my experience (100-300ms) and their CDN supports Range caching (from my understanding Cloudflare does too they just limit the size of the file regardless of the Range)
I've had success with using a cache in front of my buckets for great performance. In my case I have raster tiles so they get turned into z/x/y tile filenames and a cloudflare worker pulls that from the full file and caches the result in the region.
We're doing something like this behind Cloudflare R2, same concept of owning the map infra (for privacy and access-control) and reducing load on public infrastructure.
If you are into this stuff, you can view PMTiles from the CLI with "gloss", or try to drag-and-drop on its web interface [1]. It seems large tiles (>128M) and some raster formats are failing; plus it would be nice to load from URL there. Will fix that...
(AI warning). ntmaps [2] is a Golang library that lets you use different tile providers, deployable in terminal or browser. ntplaygrounds [3] uses that and nt3d and ntactor to make a city simulation. Data is pulled from OpenStreetMap in those.
[1] https://nimbleterminal.com/gloss/app.html [2] https://nimbleterminal.com/ntmaps [3] https://nimbleterminal.com/ntplaygrounds
R2 is amazing for this.
Cloudflare, generally, is amazing for this, actually. It serves my personal hiking map for about $2/mo, using R2, D1 and Workers.
Building the map itself is free via GitHub Actions.
It's bonkers how the map world has changed over the last 20 years.
That's mostly for the storage not the bandwidth right?
how are you using D1 and Workers with this?
> If you are into this stuff, you can view PMTiles from the CLI with "gloss", or try to drag-and-drop on its web interface
The official PMTiles viewer [1, 2, 3] is also pretty good.
[1]: https://pmtiles.io/
[2]: https://github.com/protomaps/PMTiles/tree/main/app
[3]: https://protomaps.com/blog/new-pmtiles-io/
Checkout the new PRs submitted to Tilemaker. It appears building the planet could soon take less than 5 minutes.
Really cool, did not know about it!
I visited the link and Malwarebytes warned of a potentially malicious site:
p - proxy - tp8ez dot bunny dot run
so I closed that window.
What else you got?
It's my API endpoint for Plausible (private website analytics), not sure why it would get flagged
Yeah, me neither. I opened the link along with several other article links from the front page so it sat idle in a separate private tab waiting for me to get to it and just as I clicked on it MWB popped the warning. I'm using LibreOffice with container tabs and MWB Pro under Win10 Pro. Probably nothing.
Thanks for the explanation.
Protomaps sounds interesting.
okay, but what clients work with this approach?
There is an npm library that integrates the format into MapLibre (fork of Mapbox) and Leaflet.
You can use the pmtiles:// protocol in Maplibre GL, requires protomaps.js and a few lines of setup [1]
My experience with it is ... ok. It works. But going directly to cloud storage (s3 in my case) is unpredictable latency and neither the browser nor most servers really cache HTTP range requests granularly, so every tile is another high-latency round trip. Not worth it - I ended up putting Martin tile server in front of it.
I assume someone could write a protomaps adapter in WASM with some smart caching? Until then, Standard GET requests are just easier to cache and perform much better in practice. The downside being you have to run a server or statically generate files.
[1]- https://docs.protomaps.com/pmtiles/maplibre
For what it's worth I think latency/reliability varies a lot with provider. Bunny Storage has quite good latency in my experience (100-300ms) and their CDN supports Range caching (from my understanding Cloudflare does too they just limit the size of the file regardless of the Range)
I've had success with using a cache in front of my buckets for great performance. In my case I have raster tiles so they get turned into z/x/y tile filenames and a cloudflare worker pulls that from the full file and caches the result in the region.
A quick search showed that this should work with HTTP range requests: https://maplibre.org/
Protomaps, pmtiles, are actually pretty ubiquitous. Even has a GDAL driver https://gdal.org/en/stable/drivers/vector/pmtiles.html