Skip to content

[Bug]: Waypoint 'separatesLegs' flag not being applied during navigation #4725

Open
@RL-William-Coates

Description

@RL-William-Coates

Mapbox Navigation SDK version

3.3.1

Steps to reproduce

Create a multi-waypoint route with the map matching API, set 'separatesLegs' to false for all waypoints except the first and last. Start navigation.

Expected behavior

The voice instructions do not call out waypoints as destinations.

Actual behavior

The voice instructions are calling out waypoints as destinations.

As demonstrated by the screenshots below. Waypoint 2 is at the end of the road, and the voice instructions are calling it out as a destination. If I print out the step instructions of the route, waypoints are not being treated as destinations.

SCR-20241002-lpgt

SCR-20241002-lopi

Is this a one-time issue or a repeatable issue?

repeatable

Activity

kried

kried commented on Oct 16, 2024

@kried
Contributor

Hi @RL-William-Coates

We were unable to reproduce your problem. Both voice and visual instructions do not mention silent waypoints, also the problem does not repeat itself during reroutes.

Could you please share the history route file with us so we can investigate your specific route? You can record it using HistoryRecorder. There is a sample app using historyRecorder.

Or you can send us a sample app or code sample where you can reproduce the issue.

RL-William-Coates

RL-William-Coates commented on Oct 17, 2024

@RL-William-Coates
Author

Hi @kried

Attached is a history replay of me reproducing the issue.

Also attached is a modified version of History-Recording.swift to help you reproduce the issue yourself. The main changes are in the userDidLongTap logic, and requestRoute() function. Simulate Navigation must be OFF. Here are some further instructions:

Set initial user location: 51.994726, -2.394331

Create first waypoint at: 51.998013, -2.379042
Create second waypoint at: 52.036780, -2.422791

Start navigation

Change user location to: 51.994930, -2.394601 (this needs to cause a rerouting event)
Change user location to: 51.994985, -2.393452 (this helps you get back on route)

Now both the voice and visual instructions treat the middle waypoint at the end of Beach lane as a destination. It even displays a waypoint marker on the map.

history_replay.gz
History-Recording.swift.zip

kried

kried commented on Oct 17, 2024

@kried
Contributor

Thank you for the detailed report. We were able to reproduce the problem and pass it on to the corresponding Directions API team.

kried

kried commented on May 27, 2025

@kried
Contributor

Hi @RL-William-Coates

Please try v3.9.0 Nav SDK or newer.
It added support for:

Routing

  • Added RerouteConfig.rerouteStrategyForMatchRoute to configure rerouting behavior with map-matched routes.

This version added the support for the reroutes for Map Matching requests. You can enable it by setting rerouteConfig.rerouteStrategyForMatchRoute = .navigateToFinalDestination. In this case, after the reroute, a new Directions API request will be made, keeping the same value separatesLegs as in the initial request.

    let config = CoreConfig(
        credentials: .init(),
        routingConfig: RoutingConfig(
            rerouteConfig: RerouteConfig(
                rerouteStrategyForMatchRoute: .navigateToFinalDestination
            )
        )
    )
RL-William-Coates

RL-William-Coates commented on May 28, 2025

@RL-William-Coates
Author

@kried why does this new parameter not contain an option to reroute to the next waypoint in the matched route? I'm not sure why you'd want to skip all middle waypoints and reroute to the final destination for a multi-waypoint route? Unless 'final destination' in this instance does refer to the next waypoint?

RL-William-Coates

RL-William-Coates commented on May 30, 2025

@RL-William-Coates
Author

I've confirmed this to mean re-route to the final waypoint in the route. I cannot see what the use-case is for this? Re-route to the next waypoint is what's required for our use-case.

roopepal

roopepal commented on Jun 5, 2025

@roopepal
Contributor

Hi @RL-William-Coates

why does this new parameter not contain an option to reroute to the next waypoint in the matched route?

Currently, the underlying navigator implementation does not support comprehensive multi-waypoint rerouting in the context of Map Matching.

Given that, I'd like to take a step back and understand your use case for Map Matching a bit better. Specifically, whether your requirements could be satisfied with the Directions API instead? It offers better rerouting support, including multiple and silent waypoints.

RL-William-Coates

RL-William-Coates commented on Jun 5, 2025

@RL-William-Coates
Author

Hi @roopepal,

We provide routes that nearly always require greater than 25 waypoints (the max for the Directions API). Unless it's possible to increase this limit, I believe map matching is our only option.

roopepal

roopepal commented on Jun 5, 2025

@roopepal
Contributor

@RL-William-Coates

I see, thanks. Yes, it is possible to increase the limit. Please contact us through https://www.mapbox.com/contact/sales/, and our support team will help you with it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kried@roopepal@RL-William-Coates

        Issue actions

          [Bug]: Waypoint 'separatesLegs' flag not being applied during navigation · Issue #4725 · mapbox/mapbox-navigation-ios