Rob's garden / notes / note

Note

I played with pmtiles today, it’s an open source format for map tiles that you can self host on something like an S3 bucket. Then you can use those tiles client-side and it does some magic to get the right tiles from your bucket.

Of course there is a demo, it just has tiles for Newcastle which is about 40Mb:

It’s interesting how it works, it’s a single file in an S3 bucket but the client-side does HTTP Range requests to get specific bytes out of the larger binary. I think those requests are usually for requesting certain bytes in a video, rather than downloading the whole thing.

pmtiles can use those to get the tiles out that it needs at different resolutions. There is prep process where you “extract” the tiles you want from the whole planet set and they provide a nice CLI to do that.

Could be interesting to have an #Eleventy plugin that gets the exact tiles you need for an inline map then they can be statically hosted with your site.