-
Notifications
You must be signed in to change notification settings - Fork 517
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 region feature #336
Conversation
disabled debug mode
Add mapbox offline dependency.
…ter-mapbox-gl into feature/offline
Feature/offline
…into tobrun-master
Dependencies from git
…into feature/offlinesync
Does this leverage offline plugin too https://docs.mapbox.com/android/plugins/overview/offline/ ? |
}, | ||
); | ||
Iterable regions = json.decode(regionsJson); | ||
return regions.map((region) => OfflineRegion.fromJson(region)).toList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As as suggestion, we could follow this article https://flutter.dev/docs/cookbook/networking/background-parsing
and put json parsing into compute
, moving it to the background.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for other places that parse json
Hi, how is this PR ? any chances for merging ? I'm really waiting for this PR to be approved in order to use it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work @kleeb
Would you able to patch the remarks made?
Or if someone else is up for patching?
Looking forward getting this merged, apologies for the delay
android/build.gradle
Outdated
@@ -40,6 +40,7 @@ android { | |||
implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.0" | |||
implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0" | |||
implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v9:0.12.0" | |||
implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-offline-v8:0.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use offline-v9 instead? Plugins have the major version of the maps SDK appended to them.
@@ -61,6 +75,14 @@ private InputStream openTilesDbFile(String tilesDb) throws IOException { | |||
} | |||
} | |||
|
|||
private String extractAccessToken(MethodCall methodCall, String fallbackValue) { | |||
if (methodCall.hasArgument("accessToken")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you look into patching this @kleeb ?
Unfortunately not. We lost all developers that were contributing. Can any of you finish this up? |
Hi guys. I created a fork with the suggested corrections and I already merged with master (0.9.0). I have a project to go into production and I couldn't wait any longer. Whoever needs this functionality, can use my fork directly in the project while I do the PR correctly.
Comments:
I will make corrections appropriately in the coming days. Besides assigning the information that the key should exist in the info.plist ... |
The issue "Sometimes the example screen "Offline Regions" is not working (I didn't have time to check why)" has been fixed on my fork |
@lfofelipe would you manage to solve all conflicts between my branch and your fork ? |
Done. |
sync with bugfix branch
25 days and no merge ? :( |
@tobrun hows the status for a merge? |
Sorry about that, I'm only able to dedicate a Saturday per month to the project. |
Sweet! Thanks a lot guys and all contributors. |
Hey just wanted to say THANK YOU for your time implementing this feature. Nice work :). |
First of all, thank you @kleeb and contributors for implementing this awesome feature 👍 I did want to make you aware of a potential bug I found when testing the example app on iOS. In
Seems to be an issue with the Mapbox access token not being properly set, even though I've defined Interestingly enough, I've found that setting |
Thanks @philiplindberg for letting me know. Will check on that. |
I've been using Flutter_map and can cache a mapbox instance for each session, which is important as a user can open quite a few map views in my app, and mapbox charges for each time the access token is used. I've been working towards swapping to Mapbox_gl, but it seems to require a new Mapbox instance every time a map is opened. I've tried to cache the MapboxMap, but it creates a new instance with a new controller each time. As well as caching a region, could this also cache a Mapbox instance for a whole session? |
Added iOS and Android handling of the great Mapbox feature, which allows to download and cache dynamically selected region during the app usage.