0

I am using MapBox on my app and I have a fragment which is separate from the activity that has the map. In that fragment I have a ListView, which contains a list of region names. I want to create the option to click on the ListView and generate a download of that region. I have looked at this guide: https://www.mapbox.com/android-docs/map-sdk/overview/offline/ but that refers to downloading a specific region when activity starts.

How do I connect my ListView items with the option to download specific regions?

I have already created the LatLngBounds, metadata and OfflineTilePyramidRegionDefinition of the regions I need.

Thanks!

Mickey
  • 1,405
  • 2
  • 13
  • 33

1 Answers1

0

Are you specifically speaking about downloading a region without actually showing the map? I'd recommend trying out the Offline Plugin @tobrun has been working on. It runs the download in the background inside a service which will allow your users to leave the app and continue downloading the region.

cammace
  • 3,138
  • 1
  • 13
  • 18
  • Yes, I will have predefined regions which will be displayed inside a ListView, part of a fragment. Another fragment will have the ability to delete already downloaded regions, so no need for map display. The suggestion sounds great, but I'm not sure what to do with the link you've posted here, it connects me to a pull request. Thanks! – Mickey Sep 11 '17 at 15:41