PMTiles Makes Self-Hosting Map Tiles Affordable
Commercial map APIs like Mapbox become expensive beyond free tiers, charging $5 per 1,000 map loads. PMTiles addresses this by offering a single-file tile format using HTTP Range requests for efficient deployment to any storage backend—enabling developers to self-host maps without external APIs.
The Protomaps toolkit provides pre-built world map data and CLI tools to extract specific regions or zoom levels. On Bunny.net’s CDN, hosting costs break down to $0.01/GB for bandwidth and storage from $0.01 to $0.055 per GB/month depending on replication. The full 139GB world map with continent-wide replication costs approximately $5/month in storage, with actual bandwidth charges per request varying based on user behavior.
Deployment involves uploading via S3 compatibility protocols using rclone, configuring the CDN pull zone with CORS and caching settings optimized for large files, and embedding the tiles in websites via MapLibre GL. The author recommends implementing rate limits—such as 10kB/s throttling after 10MB per request—to prevent unexpected bills from heavy downloading.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.