File tree Expand file tree Collapse file tree
ui/src/components/map/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { FC } from 'react' ;
2+ import { useMap } from 'react-map-gl/maplibre' ;
23import { theme } from '../../../generated/theme' ;
34import { ArrowLayout , ArrowPaint , ArrowRenderLayer } from './ArrowRenderLayer' ;
5+ import { ACTIVE_LINE_STROKE_ID } from './editorStyles' ;
46import { LinePaint , LineRenderLayer } from './LineRenderLayer' ;
57import {
68 NEW_ROUTE_ARROWS_ID ,
@@ -25,7 +27,12 @@ export const RouteGeometryLayer: FC<RouteGeometryLayerProps> = ({
2527 defaultColor = colors . routes . bus ,
2628 isHighlighted,
2729} ) => {
28- const beforeId = isHighlighted ? undefined : 'route_base' ;
30+ const { current : map } = useMap ( ) ;
31+ const hasActiveLineStrokeLayer = ! ! map ?. getLayer ( ACTIVE_LINE_STROKE_ID ) ;
32+ const beforeId =
33+ isHighlighted && hasActiveLineStrokeLayer
34+ ? ACTIVE_LINE_STROKE_ID
35+ : 'route_base' ;
2936
3037 const color = isHighlighted ? colors . selectedMapItem : defaultColor ;
3138
You can’t perform that action at this time.
0 commit comments