I have tried the following code to exclude toll gates. But it is always showing the route with tolls.
NavigationRoute.builder(NavigationMapRouteActivity.this)
.accessToken(Mapbox.getAccessToken())
.origin(origin)
.alternatives(true)
.exclude(DirectionsCriteria.EXCLUDE_TOLL)
.destination(destination)
.build()
Alternatives also seems not working good. I can't see more than one route in my screen. I thought giving alternatives true will show one or more routes. But it is always showing only one route.
ANDROID API : 24-25
SDK VERSION : 0.41.0
It should not show the route with toll gates and it should provide one or two different routes to the user.
It is always showing the same route.
Hey @sridharvenkatesan π thanks for reaching out and report your issue.
I've just tested adding a .exclude(DirectionsCriteria.EXCLUDE_TOLL) to the NavigationLauncherActivity from the test app (which also uses .alternatives(true)) https://github.com/mapbox/mapbox-navigation-android/blob/f2a082cfd33792f2209c67979f615668d3f7a587/app/src/main/java/com/mapbox/services/android/navigation/testapp/activity/navigationui/NavigationLauncherActivity.java#L255-L259 and it's working fine π
_Routes from Washington to Philadelphia - tolls not excluded_

_Routes from Washington to Philadelphia - tolls excluded_

Wondering if it's a data problem. Could you share the origin and destination? That'll give us better insight into your concrete use case and what could be causing your problem.
Thanks in advance.
Hi @Guardiola31337. Thanks for your reply. I have tried this sample app and it is working fine. But when I tried to initialize NavigationMapboxMap, I am getting following error.
2019-08-23 17:47:16.599 22819-22819/app.abcourier.ccmobile E/Mbgl-MapChangeReceiver: Exception in onDidFinishLoadingStyle
android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190)
at android.content.res.Resources.getDrawable(Resources.java:770)
at android.content.Context.getDrawable(Context.java:525)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:463)
at com.mapbox.services.android.navigation.ui.v5.ThemeSwitcher.retrieveThemeMapMarker(ThemeSwitcher.java:50)
at com.mapbox.services.android.navigation.ui.v5.map.NavigationMapboxMap.initializeNavigationSymbolManager(NavigationMapboxMap.java:638)
at com.mapbox.services.android.navigation.ui.v5.map.NavigationMapboxMap.
at app.abcourier.ccmobile.activity.mapbox.MapBoxActivity$3.onStyleLoaded(MapBoxActivity.java:211)
This is the line where I am getting an error.
navigationMapboxMap = new NavigationMapboxMap(mapView, mapboxMap);
@Override
public void onMapReady(@NonNull final MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
mapboxMap.setStyle(getString(R.string.navigation_guidance_day), new Style.OnStyleLoaded() {
@Override
public void onStyleLoaded(@NonNull Style style) {
navigationMapboxMap = new NavigationMapboxMap(mapView, mapboxMap);
navigationMapboxMap.setOnRouteSelectionChangeListener(MapBoxActivity.this);
navigationMapboxMap.updateLocationLayerRenderMode(RenderMode.COMPASS);
}
});
}
This is the method I am getting error in NavigationMapboxMap.
private void initializeNavigationSymbolManager(MapView mapView, MapboxMap mapboxMap) {
Bitmap markerBitmap = ThemeSwitcher.retrieveThemeMapMarker(mapView.getContext());
mapboxMap.getStyle().addImage(MAPBOX_NAVIGATION_MARKER_NAME, markerBitmap);
SymbolManager symbolManager = new SymbolManager(mapView, mapboxMap, mapboxMap.getStyle());
navigationSymbolManager = new NavigationSymbolManager(symbolManager);
SymbolOnStyleLoadedListener onStyleLoadedListener = new SymbolOnStyleLoadedListener(mapboxMap, markerBitmap);
mapView.addOnDidFinishLoadingStyleListener(onStyleLoadedListener);
}
Please give me your inputs.
Hi Team,
We have issues with toll roads. In our code, we are excluding toll roads.
NavigationRoute.builder(NavigationMapRouteActivity.this)
.accessToken(Mapbox.getAccessToken())
.origin(origin)
.alternatives(true)
.profile(getRouteProfileFromSharedPreferences())
.exclude(DirectionsCriteria.EXCLUDE_TOLL)
.destination(destination)
.build()
This is working fine in most of the cases. But, In some cases, ReRoute callback methods are calling while we navigating.
Once the ReRoute callback methods are called then the exclude becomes null.
I have tried printing this log information in onProgressChange.
Log.e("Route-Progress-Exclude", routeProgress.directionsRoute().routeOptions().exclude() + "");
Whenever the ReRoute callback methods are called, the log is showing null.
I have tried with latest version 0.42.4 and still we are facing this issue.
I have found the coordinates to reproduce this issue.
Origin Coordinates 43.65423202---79.70544455 and Destination Coordinates 43.650728574511----79.7040401920922, ReRoute Coordinates 43.65438938----79.70524079.
Origin 43.76933621, 79.46783238,Destination--43.7599155339893, 79.5108612818684,Reroute 43.76873826, 79.46770264
Please check it and let me know the solution for this issue.
Hi @Guardiola31337 ,
Any updates regarding this issue?
map-toll-routing-issue01.txt
map-toll-routing-issue02.txt
Adding log files to speed up this ticket review and resolution. For such an important issue I'm very surprised this is taking so long to resolve.
@EricGeiler @sridharvenkatesan Reading between the lines of all the above, can the issue be summarized as "exclude=toll works for initial routing, but is not being carried through to reroute callbacks?"
cc @Guardiola31337
Yes that is 100% correct based on what our developer has been telling me, and the feedback from drivers on the road.. I have also witnessed it personally on my device.. exclude=tolls works for the initial routing, but if drivers take a diff turn or system calcs a re-route, then the re-route does NOT exclude tolls like we expect it to.
I have verified the OSM data for the tolls roads in question, onramps and expressway have valid flags set for tolls as per OSM or JOSM checks I did.
[cid:[email protected]]
From: Daniel Patterson notifications@github.com
Sent: Thursday, February 27, 2020 10:29 AM
To: mapbox/mapbox-navigation-android mapbox-navigation-android@noreply.github.com
Cc: Eric Geiler eric.geiler@abcourier.com; Mention mention@noreply.github.com
Subject: Re: [mapbox/mapbox-navigation-android] Excluding Tolls not working as expected (#2026)
@EricGeilerhttps://github.com/EricGeiler @sridharvenkatesanhttps://github.com/sridharvenkatesan Reading between the lines of all the above, can the issue be summarized as "exclude=toll works for initial routing, but is not being carried through to reroute callbacks?"
cc @Guardiola31337https://github.com/Guardiola31337
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/mapbox/mapbox-navigation-android/issues/2026?email_source=notifications&email_token=AOVS42UHIH46M6RHSXEZTW3RE7L5FA5CNFSM4ILUHTLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENEYGFY#issuecomment-592020247, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOVS42V3JKRFPDQE33JUOH3RE7L5FANCNFSM4ILUHTLA.
@zugaldia @danpat Any update here? Issues are worsening for the customer.
@ericaeckes it's on the team's board for investigation this sprint. We'll provide an update here as soon as we know more.
Fix for OP can be found here https://github.com/mapbox/mapbox-navigation-android/pull/2573 and it'll be available in the next release 0.42.6 π
cc @EricGeiler @sridharvenkatesan @ericaeckes @tsuz @danpat @zugaldia @Aurora-Boreal @pjleonard37
Wow, Thanks a lot everyone for the updates!
Timeline for 0.42.6 to be available for us? We need to make some business operational decisions either today or tomorrow, but we need a timeline from your team before making a decision on our end.
Toll usage is killing us money wiseβ¦.
[cid:[email protected]]
From: Pablo Guardiola notifications@github.com
Sent: Wednesday, March 11, 2020 11:01 AM
To: mapbox/mapbox-navigation-android mapbox-navigation-android@noreply.github.com
Cc: Eric Geiler eric.geiler@abcourier.com; Mention mention@noreply.github.com
Subject: Re: [mapbox/mapbox-navigation-android] Excluding Tolls not working as expected (#2026)
Fix for OP can be found here #2573https://github.com/mapbox/mapbox-navigation-android/pull/2573 and it'll be available in the next release 0.42.6 π
cc @EricGeilerhttps://github.com/EricGeiler @sridharvenkatesanhttps://github.com/sridharvenkatesan @ericaeckeshttps://github.com/ericaeckes @tsuzhttps://github.com/tsuz @danpathttps://github.com/danpat @zugaldiahttps://github.com/zugaldia @Aurora-Borealhttps://github.com/Aurora-Boreal @pjleonard37https://github.com/pjleonard37
β
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/mapbox/mapbox-navigation-android/issues/2026#issuecomment-597684515, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOVS42TYO3VIRC22XFMLE7LRG6RRHANCNFSM4ILUHTLA.
@EricGeiler
Timeline for 0.42.6 to be available for us? We need to make some business operational decisions either today or tomorrow, but we need a timeline from your team before making a decision on our end.
Definitely this week!
In the meantime, would it be helpful for you if we generate a SNAPSHOT so you can test it out on your side?
@Guardiola31337 Yes Please, we would like to take a peek at a SNAPSHOT.
Thanks again!
@EricGeiler
Yes Please, we would like to take a peek at a SNAPSHOT.
Sure thing π 0.42.6-SNAPSHOT has been released and it's available https://oss.sonatype.org/service/local/repositories/snapshots/content/com/mapbox/mapboxsdk/mapbox-android-navigation-ui/0.42.6-SNAPSHOT/mapbox-android-navigation-ui-0.42.6-20200311.163856-1.aar
Following you can find installation instructions for SNAPSHOTs:
repositories {
jcenter()
maven { url 'https://mapbox.bintray.com/mapbox' }
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
// ...
}
dependencies {
// ...
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6-SNAPSHOT'
// ...
}
Thank you for checking out the SDK π
@sridharvenkatesan Please implement and test, send me a separate build with this snapshot for testing with a few drivers. I will provide the feedback to mapbox of our testing results. Please have this build ready for tomorrow (thursday) and I will test and get mapbox feedback before end of week.
@sridharvenkatesan
@ericaeckes @tsuz @danpat @zugaldia @Aurora-Boreal @pjleonard37
I just wanted to express my gratitude to the Mapbox team! We have started testing 0.42.6-SNAPSHOT and so far, its looks excellent. I have not found any issues in my testing against the tickets I have opened with Mapbox. We have already deployed this in a test environment with success. I have done about 3 hours of testing for toll routes, and not once have i seen an abnormal route. GREAT WORK TEAM!!!!!!
We are planning to deploy to about 100 drivers tomorrow in real world production environments, with a rollback plan in place. I'll keep you updated tomorrow as to our results.
So far so good!
@sridharvenkatesan
@ericaeckes @tsuz @danpat @zugaldia @Aurora-Boreal @pjleonard37
Good Morning and Happy Friday Team Mapbox!
We have begun rolling out this snapshot build to a partial fleet of drivers. So far no issues... It also looks like some other ReRouting (Report Problem) issues have also gone away... it seems this snapshot addressed more issues that I was expecting :)
I have also noticed that i routinely see alternative routes, but in previous builds, the perceived likelihood of seeing an alternative route seemed to be much less... I did a number of tests yesterday side by side... 42.6 and 42.4/5 and noticed that 42.6 routinely provided alternatives when doing a direct comparison to 42.4/5.
So far we are pleased with the snapshot.
@EricGeiler Just an FYI note - whether you get any alternatives when you've requested them is a function of the Directions API that the SDK interfaces with, not a function of the SDK itself, so I would not have expected that behaviour to have changed.
Whether alternatives are found by the routing algorithms is a whole 'nother can of worms (it's a hard algorithmic problem to find good quality alternatives fast - we do our best).
Navigation SDK for Android release v0.42.6 is out and is available on maven central https://repo1.maven.org/maven2/com/mapbox/mapboxsdk/mapbox-android-navigation/0.42.6/ :tada:
Thanks again for checking out the SDK @EricGeiler @sridharvenkatesan
Closing here.
Most helpful comment
@sridharvenkatesan
@ericaeckes @tsuz @danpat @zugaldia @Aurora-Boreal @pjleonard37
I just wanted to express my gratitude to the Mapbox team! We have started testing 0.42.6-SNAPSHOT and so far, its looks excellent. I have not found any issues in my testing against the tickets I have opened with Mapbox. We have already deployed this in a test environment with success. I have done about 3 hours of testing for toll routes, and not once have i seen an abnormal route. GREAT WORK TEAM!!!!!!
We are planning to deploy to about 100 drivers tomorrow in real world production environments, with a rollback plan in place. I'll keep you updated tomorrow as to our results.
So far so good!