flutter_map_tile_caching icon indicating copy to clipboard operation
flutter_map_tile_caching copied to clipboard

[FEATURE] how we can download mutiple region at same time.

Open Hamza117411 opened this issue 1 year ago • 3 comments
trafficstars

What do you want implemented?

FMTCStore('mapStore').download.startForeground(region: downloadable, skipExistingTiles: true, skipSeaTiles: true, maxBufferLength:500, instanceId:MapFunctions.generateRandomNumber(0, 1000), ) i have added instance id for multiple downloading. but when we can all region its just download last region that in queue.

What other alternatives are available?

No response

Can you provide any other information?

No response

Severity

Minimum: Not required for my use

Hamza117411 avatar Oct 04 '24 08:10 Hamza117411

Hi @Hamza117411, Can you please add a little more detail if this is not resolved already? In general, you should also try to avoid downloading multiple regions simultaneously.

JaffaKetchup avatar Oct 23 '24 21:10 JaffaKetchup

image I have created three base regions that need to be downloaded. Currently, I'm unsure whether I should download each region one by one or if it's possible to initiate multiple downloads simultaneously. I've already implemented a random instanceId for each download using the following **instanceId:MapFunctions.generateRandomNumber(0, 1000),** However, the requirement is to download all regions at once, rather than one at a time. How can I modify the current implementation to ensure all regions are downloaded simultaneously?

m-hamza-tanbits avatar Oct 24 '24 02:10 m-hamza-tanbits

It may be that the multiple simultaneous download functionality is bugged. When you start each download, are you listening to each individually as a stream? You may need to listen to the download progress stream for it to begin.

However, I'm not sure it is necessary to download them simultaneously. It's likely to reduce the performance of all of them (although a larger buffer might help reduce this, as the database can only have one write at any one time). In v10, there is a new MultiRegion, which will download them sequentially, but in one download - this will remove the setup/teardown costs of multiple sequential downloads, and make it easier to track the progress. You can try this with the latest prerelease (usually stable, but not always for production quality), or by depending on the 'multi-store-provider' branch directly from Git (potentially unstable).

JaffaKetchup avatar Oct 24 '24 21:10 JaffaKetchup