Open danpat opened 5 years ago
The current road name label relies on querying the map for the road feature under the user location. Since the style can be arbitrarily customized, MapLayerInteractor.addStreetsLayer()
lays down a line layer bound to the Streets source and ensures that it gets obscured by the original style’s own road layers:
The line layer needs to have a source layer of road
(to avoid snagging other named features like rivers). The layer should also have a filter that requires class
to be an appropriate value. The set of appropriate values depends on the current route step’s mode
:
Route step mode | Feature class |
---|---|
driving |
* `motorway` * `motorway_link` * `trunk` * `trunk_link` * `primary` * `primary_link` * `secondary` * `secondary_link` * `tertiary` * `tertiary_link` * `street` * `street_limited` * `track` * `service` * `roundabout` |
walking cycling |
All of the above plus: * `pedestrian` * `path` |
ferry |
* `ferry` |
train |
* `major_rail` * `minor_rail` * `service_rail` |
We should also investigate whether the SDK is querying for features based on the raw location or the snapped location. In principle, this issue would be much less likely to reproduce if the query point is a snapped location. The filtering above would still help with situations like an elevated rail line running on a viaduct above a roadway.
In this example, "100 Steps" is referring to this path: https://www.openstreetmap.org/way/166468142 which is adjacent to the road.
It seems to be nearly perpendicular to the road at both endpoints. WaynameFeatureFilter.filterQueriedFeatures()
has quite a bit of code to weed out results that go off in a different direction than the route. It looks more involved than the corresponding iOS code that it was ported from. But the fixes suggested above would still be relevant for more pathological cases where pathways run parallel or coincident to roadways.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Street names will be available from NN as part of EH work.
cc @mskurydin
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Android API: Unknown Mapbox Navigation SDK version: Unknown
Steps to trigger behavior
When navigating, the "current road" label can sometimes show the name of a nearby footway.
In this example, "100 Steps" is referring to this path: https://www.openstreetmap.org/way/166468142 which is adjacent to the road.
Expected behavior
When navigating using a Driving profile, foot-accessible paths should not be considered for detecting the current road name.
Actual behavior
Looks like we're simply picking the name of the nearest map feature to the current position - if there's position error, the displayed name can be incorrect.