Skip to content

Commit 4241025

Browse files
evil159jush
authored andcommitted
[maps-ios][maps-android] Expose line cutout opacity and width (#5884)
This PR expose experimental `LineLayer.lineCutoutOpacity` and `LineLayer.lineCutoutWidth` and showcases usage in dynamic view annotation example. | iOS | Android | |--------|--------| | <img width="300" alt="Screenshot 2025-08-15 at 12 57 07" src="https://github.com/user-attachments/assets/b956f04a-80c3-41fe-944b-9e53a59adcb3" /> | <img width="300" alt="Screenshot_1755251828" src="https://github.com/user-attachments/assets/c544a18d-6a72-4590-b120-67013bf41d8c" /> | Addresses: https://mapbox.atlassian.net/browse/MAPSAND-2292 and https://mapbox.atlassian.net/browse/MAPSIOS-1948 cc @mapbox/maps-ios cc @mapbox/maps-android --------- Co-authored-by: Ramon <[email protected]> GitOrigin-RevId: f264ec16c9acbad90e8115d429652bfac73179bc
1 parent 3280fae commit 4241025

File tree

9 files changed

+270
-0
lines changed

9 files changed

+270
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Mapbox welcomes participation and contributions from everyone.
1010
## 11.15.0-beta.2 - 15 August, 2025
1111

1212
* Add configuration option to configure attribution button tint color.
13+
* Expose `LineLayer.lineCutoutOpacity` and `LineLayer.lineCutoutWidth` to make route lines visible through obstructing 3D buildings and other aboveground features.
1314

1415
## 11.15.0-beta.1 - 12 August, 2025
1516

Sources/Examples/All Examples/Annotations/DynamicViewAnnotationExample.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ private final class Route {
296296
routeLayer.lineBorderWidth = .constant(2)
297297
routeLayer.lineBorderColor = .expression(colorExpression(normal: "#666666", selected: "#327AC2"))
298298
routeLayer.slot = .middle
299+
// make route lines visible through obstructing 3D buildings and other aboveground features
300+
routeLayer.lineCutoutWidth = .constant(30)
301+
routeLayer.lineCutoutOpacity = .constant(0.2)
299302
try! mapView.mapboxMap.addLayer(routeLayer)
300303

301304
// Annotation

Sources/MapboxMaps/Annotations/Generated/PolylineAnnotationManager.swift

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/MapboxMaps/Style/Generated/Layers/LineLayer.swift

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/MapboxMaps/SwiftUI/Annotations/Generated/PolylineAnnotationGroup.swift

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tests/MapboxMapsTests/Annotations/Generated/PolylineAnnotationIntegrationTests.swift

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tests/MapboxMapsTests/Annotations/Generated/PolylineAnnotationManagerTests.swift

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tests/MapboxMapsTests/Style/Generated/IntegrationTests/Layers/LineLayerIntegrationTests.swift

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)