Is there any way to only cache tiles from a tiled basemap that are within a certain definable area such as an envelope or a polygon? I am specifically attempting to download http://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Street_Map/MapServer for offline uses however, the basemap has somewhere near 47 billion tiles which far exceeds the cap of 100000. This being said my initial thought is to draw a rectangle around the users device position and only download the tiles that are within that bounded area. Is this feasible, or do I need to find another way to do this?
For those interested I am using xamarin for VS 2015 to write the app and this is the framework I am using to download the map: https://gist.github.com/anstrevor/90a202d8c1e587ad0803e053b33a73f9
Depending what is the extent that the user wants to download. If that is 'whole world' type of scenario then it will be hitting the limit. Where you are using MapViews extent, you can use custom polygon too.
There are several approaches to this problem but I would start from the use case to see if it's really needed to get so large area to offline use. With large areas we hit challenges with very large tpk packages, device storage requirements etc. In future you can easily take large areas offline using vector basemaps but that's taking vectors offline is not supported at the moment.
Some ideas / approaches to think and try
- Restrict application to specific scale / extent so user uses application only on the area that is relevant (ofc if you need to work all over the world this wont work that well)
- Use estimate tile cache size to determine if you need to split the request to multiple tpks / parts. For example split area into 4 segments and try to download those (this will need more than one layer to show the basemap and mechanism to handle multiple downloads / construction of layers dynamically based on the tpks available)
- Pre-create tile caches to save the time to generate tiles on requests basis. You could store these for example in ArcGIS Online organization and then you could just analyse which packages are in the are that user wants and download only those to the client. (Needs more infrastructure and work upfront)
- Use multiple tpks with different scale ranges to keep individual packages smaller. You can also use different areas for each of them.
- If your application is based around specific locations / tasks to do in specific areas, you can generate tile packages around then that could be downloaded when the task is `accepted` in a client.
There are probably more options but these came into my mind right from the bat. Hope one the approaches could work for you.