mapbox-gl-native
mapbox-gl-native copied to clipboard
Offline Tile Count API
Since there is a limit the offline tiles to 6000 per user I need two methods:
- How many tiles in a given
MGLCoordinateBounds
- How many tiles are currently saved on the device (so I can calculate remaining available)
This way I can appropriately inform user if their MGLCoordinateBounds
is going to successfully download or not. AKA "Choose a smaller area, zoom size, or go delete your other offline packs to make room".
How many tiles in a given
MGLCoordinateBounds
This tool estimates the number of tiles needed for an arbitrary tile pyramid, but it hasn’t been ported to the SDKs themselves, since the actual number of tiles would depend on various factors, such as how many tiles could be reused from another downloaded pack. mapbox/mapbox-gl-native#4258 has some ideas for a more rigorous estimate.
How many tiles are currently saved on the device (so I can calculate remaining available)
You can obtain the pack’s progress and count its downloaded tiles.
With #9906, we should be able to implement: +[MGLOfflineStorage tileCountForRegion:]
or something similar.
Note that the tile count depends on the minzoom
and maxzoom
specified in the source's TileJSON, so calculating it depends on having downloaded at least that resource.
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
This is still a fairly popular feature request, any objections to reopening?
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
Whenever this issue is closed, its status on project boards automatically moves to “Resolved”... but when it’s inevitably reopened, it stays as “Resolved”. Not sure who owns those project board(s), but this seems like a flaw in the stalebot/project board relationship.
Hi, this feature is requested recently again by our customer. Is there any plan to further develop or invest in this feature?
I agree this feature is a must for us too. We're getting crashes and have to "hack" our way into downloading a pack, suspending it, and then deleting it to approximate the size of the region the user wants to save. There is a huge need for this and it seems to be getting ignored.