addProtocol for multiple mbtiles under the same source #5890
Unanswered
BenOnTrack
asked this question in
Q&A
Replies: 1 comment 4 replies
-
If you are using addProtocol I don't see any value in passing two tile addresses. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a svelte app, that has a maplibre Map and that contains a unique source (I'm using the wrapper maplibre-svelte)
According to https://maplibre.org/maplibre-style-spec/sources/, this implementation is correct (as similar to
maplibre-streets
)I have locally stored my 2 .mbtiles that contains "basemap" tiles respectively for Taiwan and Japan.
I've added a custom "mbtiles" protocol that fetches the tiles with the
addProtocol
method.It works great if I have a unique source, for instance
tiles = {["mbtiles://./basemap/asia/taiwan/{z}/{x}/{y}"]}
and I'm panning above Taiwan.If I keep both sources as showed above, then I end up with a glitch where some tiles for Taiwan would be showed and some not (as if they were overlapped by the
null
tiles fetched from the source Japan). In other words, I expect Japan tiles to returnnull
(since I'm panning over Taiwan) but I would not expect that it overlaps the correct tiles fetched from Taiwan...So I end up with something like:
where half of the tiles from Taiwan source are properly showed, and half of them seem to be overlapped with blank tiles (or not showed)
I perfectly know that the workaround is to split my vector tile source for each source (something like basemap-taiwan / basemap-japan) and duplicate my 100+ layers style but it is not sustainable if I have multiple sources (let's assume one per country) and it would be a pain to manage dynamically (assume new source once the User download new .mbtiles).
Is there any way this should work ?
Beta Was this translation helpful? Give feedback.
All reactions