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

Copy navigation models to navigation core #84

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

boldtrn
Copy link
Collaborator

@boldtrn boldtrn commented Oct 6, 2023

Fixes #37.

This is a bigger change and would result in releasing a new major version due to several breaking changes. This is the foundation to finally loosening this repository from the Mapbox API and make it easier for anyone to include third party routers. So we could consider looking at #64 afterwards.

I would like to ask everyone to give this a good test, if everything works out, we can merge this soon.

CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@@ -225,7 +226,7 @@ class MockNavigationActivity :
this.accessToken(getString(R.string.mapbox_access_token))
this.origin(origin)
this.destination(destination)
this.voiceUnits(DirectionsCriteria.METRIC)
this.voiceUnits(com.mapbox.services.android.navigation.v5.models.DirectionsCriteria.METRIC)
Copy link
Collaborator

Choose a reason for hiding this comment

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

full qualifier here is not necessary, you forgot to remove the com.mapbox.api.directions.v5.models.DirectionsCriteria import in line 14. Replace that import with com.mapbox.services.android.navigation.v5.models.DirectionsCriteria

@Fabi755
Copy link
Collaborator

Fabi755 commented Oct 13, 2023

The code changes are looking good for me. I also understand the idea of this changes. But what I don't understand is the module architecture.

The core module holding the logic and models, the ui module will holds UI components. But why we locating the Mapbox specific things also in the ui module. For example MapboxRouteFetcher. Or the DirectionsResponse in two variants, where the new copied one is located in core and the existing one also exist as dependency of ui.

@boldtrn
Copy link
Collaborator Author

boldtrn commented Oct 13, 2023

But why we locating the Mapbox specific things also in the ui module.

My first goal was to remove all dependencies to Mapbox APIs out of the core. So you can use the basic navigation without Mapbox.

I think most serious apps will write their own UI as it is right now anyway, so apps can decide how they want to implement the route fetching and don't need to carry the unnecessary Mapbox weight in their apps.

The ideal setup IMHO would be the further modularize the UI that it's possible to have use some of the UI elements in your own app.

Then we could have a module for Mapbox routing, one for GraphHopper, one for Valhalla, one for...

@Fabi755
Copy link
Collaborator

Fabi755 commented Oct 13, 2023

Okay, then we have the same thoughts. Thanks for explaining this!

@boldtrn boldtrn merged commit 0f8cf44 into maplibre:main Oct 13, 2023
2 checks passed
@boldtrn boldtrn deleted the issue_37_local_models branch October 13, 2023 15:49
@boldtrn
Copy link
Collaborator Author

boldtrn commented Oct 13, 2023

Thanks for all the reviews. I would kindly ask everyone to give this a good test in your apps as well, if nothing odd comes up, we can release a new major version in 1-2 weeks or so.

@Fabi755
Copy link
Collaborator

Fabi755 commented Oct 13, 2023

I already tested the changed code base in our app, by review process. I don't see any issues with our implementation. ✅

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.

Create local Models for Navigation
4 participants