-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: improvements to local MBTiles FileSource #32
Comments
Good ideas. Unfortunately we currently don't have any documentation for this FileSource, but you can check #17 |
This could be related to relative paths in the style spec. See maplibre/maplibre-gl-js#645 |
At first glance, that seems like it would add unwanted complexity and potential confusion here because:
Instead, my proposal here was more about passing in a property to At first, I thought the use of absolute paths was going to add a lot of friction compared to relative paths (e.g., in mbgl-renderer) but that has not proven to be the case. For my existing use cases, the caller (e.g., a Python wrapper) lives on the same server and has knowledge of the absolute paths. If we were to build a new service API that allowed the caller to pass in render requests and style JSON via HTTP requests, we could just add another bit of configuration there and have it do a find / replace on |
MapLibre should error out rather than pass along `null` that can cause exception. Fix for https://jira.lyft.net/browse/MAPS-42057
Context: I'm working on Python bindings to build a self-hosted static renderer similar to
mbgl-renderer
that I built on top of the (now unmaintained?)mapbox-gl-native
NodeJS bindings and was starting to build up a similar FileSource for local mbtiles when I discovered it was already implemented here (thanks!).I use a somewhat different approach to resolving local mbtiles files to tileJSON and tiles: e.g.,
"mbtiles://land/{z}/{x}/{y}.pbf"
=>/<mbtiles root path>/land.mbtiles
tile request.(style JSON example)
though I am open to other alternatives of resolving this that don't require full filesystem paths in the style JSON files; an approach like is used for assets is more appropriate. Style JSON strings are sent by client applications to the static renderer; the root path containing the mbtiles files is set as a property for running the static renderer server.
It looks like the current implementation only resolves absolute file paths? I couldn't find a full request URL or test that would reveal this in the codebase, but from inspection of the code a tile request looks something like
/<absolute mbtiles file path>?file={x}/{y}/{z}.pbf
Is there more documentation / examples for this FileSource anywhere?
I'd like to make the following changes to the MBTiles FileSource, but wanted to be sure that the overall direction seems reasonable:
MaptilerFileSource
=>MBTilesFileSource
ResourceOptions
to set root path containing local MBTiles files, similar to asset pathMBTilesFileSource
and a couple small mbtiles files as test fixtures; I don't see that there are any tests now, so it's a bit hard to know if the above changes would break any downstream usageThe text was updated successfully, but these errors were encountered: