Develop separate map style & data server #598
gmaclennan
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the idea
Serve map tiles & styles with an encapsulated solution that can exist as an independent module. Should rasterize vector tiles for iD editor and serve static map images.
Why?
Currently our offline map server is a mix of different pieces: we server static raster tiles for ID editor, and separately serve
style.json
for mapbox-gl with accompanying vector tiles, which we store as.asar
compressed archives. We separately serve static map images with a custom solution that renders them in an electron renderer process (usingmapbox-gl-js
with access to the DOM).Goals
An integrated solution for managing map data:
Requirements
a.
.asar
filesb.
z/x/y
folders of tilesc.
.zip
files containingstyle.json
, sprites, font SDFs andz/x/y
tilesd.
.mbtiles
files - fix Reading offline maps from MBTiles #103style.json
, font SDFs, sprites and.asar
tiles (the format currently used by Mapeo)mapbox://
urls)mapbox-gl-native
using something like https://github.com/sindresorhus/got#cache-adapters so that static maps API does not re-request lots of data.Stretch goals
.ttf
files rather than rendered SDFs)Prior Art
maptiler/tileserver-gl
does a lot of this, but the way the code is written would require a lot of modifications to implement all requirements. Would be worth borrowing some of the code but maintaining a separate module.naturalatlas/tilestrata
Gotchas
mapbox-gl-native
does not support Node >=12 but Natural Atlas is maintaining a forked versionQuestions
Should we support directly reading from existing files e.g.
mbtiles
vs. importing a copy? Importing a copy gives us more control (e.g. what would happen if the user moved the file we were reading tiles from?) but requires disk space.Implementation suggestions
Use fastify for efficient http serving and built-in validation and error handling.
Beta Was this translation helpful? Give feedback.
All reactions