mapbox / mapbox/mapbox-navigation-ios

Replace route line casing layer with line border property

Open
#4,167 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira-sync-complete topic: cartography
Dominant language
Swift
Stars
918
Forks
326
Avg merge
1h 16m
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in NavigationMapView.swift around the casing-layer code at lines 715–722, then inspect the navigationMapView(:casingShapeFor:) and navigationMapView(:routeCasingLineLayerWithIdentifier:sourceIdentifier:) delegate paths. The default path should use lineBorderWidth and lineBorderColor, while either delegate customization continues to use the existing casing-layer path.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.