mapbox-navigation-ios icon indicating copy to clipboard operation
mapbox-navigation-ios copied to clipboard

Replace route line casing layer with line border property

Open 1ec5 opened this issue 3 years ago • 0 comments

Once the line-border-width and line-border-color style properties make it from mapbox/mapbox-gl-js#12208 into the iOS map SDK, we should use them instead of a separate layer for the route line casing. Unifying the route line layers will allow us to more accurately depict situations where a route doubles back on itself, such as in the situations described in #1733. In these cases, the casing will overlap one segment but underlap another. It may seem like a small detail, but an interleaved casing would to the sense of realism and clarifying to the user which direction they should go, especially in the case of a Michigan turn, where the user would physically travel over the same intersection twice. It’ll also be a lot easier to style the line border via a Style.

NavigationMapView currently has relatively involved code to add a casing layer underneath the main route line layer. By default, we should short-circuit this code in favor of the lineBorderWidth and lineBorderColor properties. However, for backwards compatibility, we need to continue to honor the NavigationMapViewDelegate.navigationMapView(_:casingShapeFor:) and NavigationMapViewDelegate.navigationMapView(_:routeCasingLineLayerWithIdentifier:sourceIdentifier:) methods by entering the existing code path and avoiding the lineBorder property.

https://github.com/mapbox/mapbox-navigation-ios/blob/664e4f39e4016bac0dd0896014cb592498959c00/Sources/MapboxNavigation/NavigationMapView.swift#L715-L722

/cc @mapbox/navigation-ios

1ec5 avatar Sep 21 '22 18:09 1ec5