Hacker News new | ask | show | jobs
by alexmuro 1202 days ago
The thing this article doesn't say is that maplibre-gl v2 supports directly querying pmtiles with http range requests so you don't even need lambda or cloud flare workers to make x/y/z routes in front of the file. So instead of 50c, this is essentially free.

If you are going to to set up that infrastructure you could just use an mbtiles file which has been around for years.

The interesting thing to me is that this stuff is all built on the open source technology of mapbox, and it seems like a real threat to large parts of their business model. Interested to see how it plays out.

2 comments

The solution I described in the blog post is an optional layer on top designed for high traffic deployments, see here: https://protomaps.com/docs/cdn

As most storage systems like S3 aren't free and have per-request fees, the price is pretty comparable to this CDN deployment.

Protomaps is very intentionally built with little in common with Mapbox; the main shared parts are using the same Protocol Buffers vector tile format, because there's no reason to write another one; and compatibility with the fork of Mapbox GL 1 (MapLibre GL). See https://protomaps.com/docs/faq#mapbox

Firstly, I just want to say thanks for the reply, but more so thanks for your work, its moving opensource mapping forward.

In my work we are looking at switching from mbtiles hosted with tilserver-gl(https://github.com/maptiler/tileserver-gl) to pmtiles to remove a server process. But we were self hosting already and we are already using maplibre-gl 2.

I can see why the implementation in the blog post would be better for high traffic deployments (ours isn't). It also points out to me I don't understand how a CDN would handle range request for hosting the pmtiles file directly, it probably doesn't?

As far as the mapbox stuff,in my mind, pmtiles is a direct competitor (successor) to the mbtiles format, which was a revolution in comparison to everything that came before it. A successor I welcome because it makes it even easier for me as a developer to self host and not be dependent on a SaaS to run my maps.

The modern opensource map stack wouldn't exist without mapbox and I'm personally grateful to them for that. Most people who use pmtiles will use mapbox's opensource style spec to style them, and descendants of their open source code to render them. But as a developer now its an obvious choice to not use their services after years of using them.

However I'm not doing high traffic stuff and they never made much money off me anyway.

Some CDNs handle range requests; the purpose of introducing Lambda/Workers here is to transform normal Z/X/Y URLs into range requests, so you can use PMTiles with any client like MapLibre Native or legacy code without loading a plugin.

Protomaps actually has its own vector renderer different from Mapbox GL or MapLibre at https://github.com/protomaps/protomaps.js . It does use a handful of low-level Mapbox JavaScript libraries, but otherwise was consciously developed to be 100% separate from existing Mapbox rendering and styling code, and has an objectively inferior (Leaflet) user experience.

In practice, most serious uses of Protomaps are now using MapLibre GL, so there will be more focus going on that in the project going forward.

My guess is Mapbox would worry more about competitors in the routing and Addressing space than

The biggest danger with Open tiles is a basemap is the gateway to other data services with higher costs and an easier path to a defendable technical moat. Swapping a basemap can literally be a 10 minute job