Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does anyone know if there is a way to host just a few of the tiles in a static way? For example, if I wanted to build a web page which just shows a map at zoom level 6 for a lat/lng point, and then go to zoom level 13. That would require a tiny subset of tiles; is there a simple way to add the tiles plus the JS code in a static way so no external downloads were necessary?



Yes, that’s pretty easy. I did it for Half Moon Bay, California here: https://simonw.github.io/hmb-map/

Code here: https://github.com/simonw/hmb-map

TIL here: https://til.simonwillison.net/gis/pmtiles


I've used maptiler to do this. You can give it a boundary and zoom levels, along with a theme, and generate prerendered tiles that you can then server just using http. This has worked well with leaflet.


Look at https://protomaps.com/ - You can have a single file in a that represents the vector data for a region at multiple zoom levels. There used to be a really nice UI where you could just select a region. They've changed things around a bit since then so I'm not sure how it works now.


The replacement for the UI is to use the "pmtiles extract" command line tool:

https://docs.protomaps.com/guide/getting-started#_3-extract-...


You can simply pre-render them and store the png tiles in a folder. The folder structure and naming has to be such that e.g. leaflet understands it. Did this for a research demo here: https://map2seq.schumann.pub/nllni/demo/


Is there actually a simple way to pre-render? AFAIK it's a lot of work and learning at least if you're coming from scratch.


QGIS can make a tile pyramid of the current map/project at a specific set of bounds.


I've used TileMill to create tiles for a specific layer of data for a specific area. (Fire evacuation zones for a county.)

https://github.com/tilemill-project


I had success with Protomaps (https://protomaps.com/).




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: