Offline tiles in a webapp #588
Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
For the best interactive use cases you should store a full subpyramid up to the zoom 0 tile.
How large do you intend to allow the end user to download? A neighborhood, a city, or country? There is an efficient algorithm for extracting a subset of a PMTiles archive for any polygonal area that consumes little memory for hundreds of millions of tiles, by batching tiles that are adjacent on the space-filling curve. The only implementation I know if is the one in the go-pmtiles CLI: https://github.com/protomaps/go-pmtiles/blob/main/pmtiles/extract.go#L237 This is difficult to port to JavaScript because it depends on Roaring Bitmaps. If your offline area is only a few hundred tiles you may be able to get away with just downloading each of them individually. |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'd like to add an "offline mode" to MapComplete, using PMTiles. I'd extract some data from the full PMtiles archive, depending on the area the user wants to have locally.
I'm now wondering what the best approach for this would be:
What would be the most appropriate route to take?
Beta Was this translation helpful? Give feedback.
All reactions