You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a mobile (ios/android) app that is often used while users are offline. We have generated .mbtiles files for regions all over the world, split into countries (or for large countries, into smaller regions -- like states / provinces / etc). Users download the regions they need when they will be offline, and then the map uses the mbtiles files to render the map they are in.
Currently, to render a .mbtiles file, we setup a source in the style sources that looks like this:
I had some questions about the above code. First, on iOS, we could use the tiles: section above to point to the map -- but that didn't work on Android. However, when we used the url: pattern above, it works on both iOS and Android. Is there any reason for that, or why one should be preferred over the other, or is that even a bug that Android doesn't support the tiles: syntax?
Second - when we do this, we are only able to specify a single .mbtiles file. It would be ideal for us if we could actually specify multiple .mbtiles sources somehow. For example, suppose a user download multiple countries/states that are next to each other -- ideally maplibre would just search all of them for the tile before giving up. Is that possible somehow right now?
To workaround the problem above right now, we look at what the user is looking at and get the center lat,lng for the map, and then figure out which offline region should have that tile, and then update the style based on that.. Does this seem reasonable, or is there a better/different way?
(side note: would be happy to share more sample code if it would be helpful)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Maplibre,
I'm building a mobile (ios/android) app that is often used while users are offline. We have generated
.mbtiles
files for regions all over the world, split into countries (or for large countries, into smaller regions -- like states / provinces / etc). Users download the regions they need when they will be offline, and then the map uses the mbtiles files to render the map they are in.Currently, to render a
.mbtiles
file, we setup asource
in the stylesources
that looks like this:I had some questions about the above code. First, on iOS, we could use the
tiles:
section above to point to the map -- but that didn't work on Android. However, when we used theurl:
pattern above, it works on both iOS and Android. Is there any reason for that, or why one should be preferred over the other, or is that even a bug that Android doesn't support thetiles:
syntax?Second - when we do this, we are only able to specify a single
.mbtiles
file. It would be ideal for us if we could actually specify multiple.mbtiles
sources somehow. For example, suppose a user download multiple countries/states that are next to each other -- ideally maplibre would just search all of them for the tile before giving up. Is that possible somehow right now?To workaround the problem above right now, we look at what the user is looking at and get the center lat,lng for the map, and then figure out which offline region should have that tile, and then update the style based on that.. Does this seem reasonable, or is there a better/different way?
(side note: would be happy to share more sample code if it would be helpful)
thanks so much,
Sam
Beta Was this translation helpful? Give feedback.
All reactions