Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Offline][iOS][Android] Add option to set maximum offline tile count #549

Conversation

felix-ht
Copy link
Collaborator

Currently there is no option to change the max offline tile count, which defaults to 6000. I added the support to set this value for iOS and android. Tested for Android and iOS, but iOS offline tiles are still defunct - #545

Would be nice if one of @n8han or @shroff could take on the review.

Copy link
Collaborator

@shroff shroff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@shroff shroff merged commit 1ef1d58 into flutter-mapbox-gl:master Feb 19, 2021
@anonali
Copy link

anonali commented Apr 5, 2021

How would one go about specifying a certain tile count? Where is this parameter to be adjusted?

@felix-ht
Copy link
Collaborator Author

felix-ht commented Apr 6, 2021

@anonali you can just call

await setOfflineTileCountLimit(
      yourTileLimit,
      accessToken: yourMapboxToken,
    );

from anywhere in you code as long as you import mapbox_gl in that file.

@felix-ht felix-ht deleted the add-option-to-set-maximium-offline-count branch April 6, 2021 18:34
@anonali
Copy link

anonali commented Apr 19, 2021

@anonali you can just call

await setOfflineTileCountLimit(
      yourTileLimit,
      accessToken: yourMapboxToken,
    );

from anywhere in you code as long as you import mapbox_gl in that file.

I have tried calling and setting the tile limit to 25,000 in the example app, however, I still seem to be getting an error thrown at 6000 according to the console log (calling it on the "Offline Regions" page).

Given the example app, could you please hint where and how this should be called in thus that it would work from the Offline Regions page?

As a side note, I am also getting this error: "Pack download error: Optional("The operation couldn’t be completed. HTTP status code 401")
"
when trying to download the "Santiago" offline region. Any idea why that might be? Just seems to be happening with that specific offline region.

I don't think it concerns my credentials as I am using the same key to access other services successfully. I assume that this 401 error also has something to do with the offline tile count?

Thank you in advance!

EDIT:

I was able to get it working. The following is for anyone else that may find this useful:

`
int limit = 25000;

someFunction () async {
await setOfflineTileCountLimit(
limit,
accessToken: MapsDemo.ACCESS_TOKEN
);

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants