28 points bcye 2 hours ago 7 comments

pluto_modadic 31 minutes ago | parent

okay, but what clients work with this approach?

bcye 26 minutes ago | parent

There is an npm library that integrates the format into MapLibre (fork of Mapbox) and Leaflet.

perrygeo 22 minutes ago | parent

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

bcye 13 minutes ago | parent

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)

pstuart 22 minutes ago | parent

A quick search showed that this should work with HTTP range requests: https://maplibre.org/

cr125rider 21 minutes ago | parent

Protomaps, pmtiles, are actually pretty ubiquitous. Even has a GDAL driver https://gdal.org/en/stable/drivers/vector/pmtiles.html