-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add option to load offline maps database for NavigationView #1895
Conversation
23bfeb6
to
da59cd5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1895 +/- ##
============================================
+ Coverage 36.47% 37.01% +0.54%
- Complexity 1093 1130 +37
============================================
Files 262 273 +11
Lines 8894 9055 +161
Branches 669 675 +6
============================================
+ Hits 3244 3352 +108
- Misses 5359 5404 +45
- Partials 291 299 +8 |
da59cd5
to
693eddc
Compare
…anges from downstream
Edited: |
94d4c7a
to
e119160
Compare
15cb1a1
to
bf53589
Compare
b707249
to
32c54c8
Compare
I run into the following error when trying to build the project using the latest
Could you think of what could be the causing it @LukasPaczos? Do you know if something has changed recently in that regard? Want to note that I cannot reproduce when using |
@Guardiola31337 Gradle |
…te_buffer-SNAPSHOT-7 version, retrieve a geometry from nn instead of a feature collection and test downloading a geometry using offline geometry region definition via offline region download activity
…ger tests (for now)
…se callback, navigation view model progress change listener and offline metadata provider tests
…eometry with buffer checks into guard clauses
1316ae6
to
17d7551
Compare
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 @danesfeder
@Guardiola31337 huge team lift thanks @Guardiola31337 🍍 |
…anges from downstream
…anges from downstream
Hi i want to implement offline maps for NavigationView. But I don't understand how to implement it, I'm using the following class in android. I appreciate the help. https://github.com/mapbox/mapbox-navigation-android/blob/46a3d0b7f6f01b31abc6d243853c63b347683c65/app/src/main/java/com/mapbox/services/android/navigation/testapp/activity/navigationui/EmbeddedNavigationActivity.java import com.mapbox.api.directions.v5.models.BannerInstructions; import retrofit2.Call; public class EmbeddedNavigationActivity extends AppCompatActivity implements OnNavigationReadyCallback, private static final Point ORIGIN = Point.fromLngLat(-77.03194990754128, 38.909664963450105); private NavigationView navigationView; private boolean bottomSheetVisible = true; @OverRide
} @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide @OverRide private void startNavigation(DirectionsRoute directionsRoute) {
} private void fetchRoute() { /**
private void setBottomSheetCallback(NavigationViewOptions.Builder options) {
} private void setupNightModeFab() { private void toggleNightMode() { private void initNightMode() { private int getCurrentNightMode() { private void alternateNightMode(int currentNightMode) { private int retrieveNightModeFromPreferences() { private void saveNightModeToPreferences(int nightMode) { private void setSpeed(Location location) {
} |
Description
Closes #1843
Fixes #1910
This PR adds functionality to the
NavigationView
andNavigationLauncher
that will allow side-loading of a Maps offline database. It also adds functionality to fetch more offline data, if needed, based on the current route geometry + buffer, which we will receive from the current progress.Goal
Allow developers to utilize offline Maps SDK for less data consumption or addressing connectivity issues.
Implementation
Upon initialization,
NavigationViewModel
instantiates aMapOfflineManager
if an offline database path is passed via theNavigationViewOptions
. At that point, if the database loads successfully, we set the map connection to false withMapbox.setConnected(false)
.After navigation has begun, each route will be turned into a geometry with a buffer using a new API from
Navigator
that @kevinkreiser is hooking us up with. We will request each route with and GL will detect overlap / download offline tiles as needed.Testing
Please describe the manual tests that you ran to verify your changes
SNAPSHOT
upstream dependencies if needed)Checklist