@@ -241,6 +241,7 @@ private final class Route {
241241 didSet { updateVisible ( ) }
242242 }
243243 var layerId : String { " route- \( name) " }
244+ var cutoutLayerId : String { " route- \( name) -cutout " }
244245 private( set) var etaAnnotation : ViewAnnotation ?
245246 private var etaView : ETAView ?
246247 private var displayed = false
@@ -296,12 +297,16 @@ private final class Route {
296297 routeLayer. lineBorderWidth = . constant( 2 )
297298 routeLayer. lineBorderColor = . expression( colorExpression ( normal: " #666666 " , selected: " #327AC2 " ) )
298299 routeLayer. slot = . middle
299- // make route lines visible through obstructing 3D buildings and other aboveground features
300- routeLayer. lineCutoutWidth = . constant( 30 )
301- routeLayer. lineCutoutFadeWidth = . constant( 0.5 )
302- routeLayer. lineCutoutOpacity = . constant( 0 )
303300 try ! mapView. mapboxMap. addLayer ( routeLayer)
304301
302+ // make route lines visible through obstructing 3D buildings and other aboveground features
303+ var cutoutLayer = LineLayer ( id: cutoutLayerId, source: layerId)
304+ cutoutLayer. lineWidth = . constant( 30.0 )
305+ cutoutLayer. slot = . middle
306+ cutoutLayer. lineCutoutFadeWidth = . constant( 0.5 )
307+ cutoutLayer. lineCutoutOpacity = . constant( 0 )
308+ try ! mapView. mapboxMap. addLayer ( cutoutLayer)
309+
305310 // Annotation
306311 let etaView = ETAView ( text: time)
307312 self . etaView = etaView
0 commit comments