Protomaps: Self-hosting map tiles has gotten cheap and easy
PMTiles and object storage like Bunny.net enable cheap, self-hosted map tile delivery that undercuts commercial APIs like Mapbox.
summary is enough It provides a practical, step-by-step walkthrough for deploying self-hosted vector maps, complemented by a rich comment thread on alternative architectures.
summary
Commercial mapping APIs can become prohibitively expensive for viral projects, prompting developers to seek self-hosted alternatives. Protomaps introduces PMTiles, a single-file tile format supporting HTTP Range requests that runs directly on object storage or CDNs. This guide details how to upload global map data to Bunny.net via rclone, configure caching and rate limits, and render tiles using MapLibre GL. Commenters enthusiastically endorse this approach while sharing alternative stacks using Cloudflare R2 and OpenFreeMap.
key points
- PMTiles packs map data into a single file queryable via HTTP Range requests, eliminating the need for a traditional tile server.
- Hosting the 139GB global map on Bunny.net costs roughly $5 monthly for storage plus minimal bandwidth fees, vastly undercutting Mapbox.
- Configuring CDN features like large object caching and download speed limits prevents unexpected runaway bills.
who should read it
Web developers and indie hackers looking to escape high commercial mapping API costs.
discussion warm
consensus
Commenters overwhelmingly validate moving away from commercial providers like Mapbox and Google Maps in favor of self-hosted object storage running for just a few dollars a month.
pushback
A few commenters note that direct HTTP Range requests against object storage can suffer from high latency and poor browser caching, suggesting tile servers like Martin for better performance.
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 …
It highlights the latency downsides of direct object storage range requests and proposes using a tile server like Martin for improved caching and performance.
Generated by an LLM from the article and thread. Check the sources before relying on it.