4 ms·
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
by xrd 2y ago
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?
- Raphaellll 2y agoYou 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/ https://map2seq.schumann.pub/nllni/demo/
- orblivion 2y agoIs 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.
- wiredfool 2y agoQGIS can make a tile pyramid of the current map/project at a specific set of bounds.
- jonah 2y agoI'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 https://github.com/tilemill-project
- brennopost 2y agoI had success with Protomaps (https://protomaps.com/ https://protomaps.com/).
- orblivion 2y agoLook at https://protomaps.com/ 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.
- bdon 2y agoThe replacement for the UI is to use the "pmtiles extract" command line tool: https://docs.protomaps.com/guide/getting-started#_3-extract-any-area https://docs.protomaps.com/guide/getting-started#_3-extract-...
- l72 2y agoI'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.
- simonw 2y agoYes, that’s pretty easy. I did it for Half Moon Bay, California here: https://simonw.github.io/hmb-map/ https://simonw.github.io/hmb-map/ Code here: https://github.com/simonw/hmb-map https://github.com/simonw/hmb-map TIL here: https://til.simonwillison.net/gis/pmtiles https://til.simonwillison.net/gis/pmtiles