Skip to content

Commit fb08b1a

Browse files
committed
railway direction with hover color
1 parent 08e5119 commit fb08b1a

File tree

1 file changed

+39
-9
lines changed

1 file changed

+39
-9
lines changed

proxy/js/styles.mjs

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ const colors = {
5454
},
5555
},
5656
},
57+
signals: {
58+
direction: '#a8d8bcff'
59+
}
5760
};
5861

5962
const turntable_casing_width = 2;
@@ -2159,18 +2162,27 @@ const layers = {
21592162
['!=', ['get', 'azimuth'], null],
21602163
],
21612164
],
2165+
paint: {
2166+
'icon-color': colors.signals.direction,
2167+
'icon-halo-color': ['case',
2168+
['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo,
2169+
'white',
2170+
],
2171+
'icon-halo-width': 2.0,
2172+
'icon-halo-blur': 2.0,
2173+
},
21622174
layout: {
21632175
'icon-overlap': 'always',
21642176
'icon-image': ['case',
2165-
['get', 'direction_both'], 'general/signal-direction-both',
2166-
'general/signal-direction',
2177+
['get', 'direction_both'], 'sdf:general/signal-direction-both',
2178+
'sdf:general/signal-direction',
21672179
],
21682180
'icon-anchor': ['case',
21692181
['get', 'direction_both'], 'center',
21702182
'top',
21712183
],
21722184
'icon-rotate': ['get', 'azimuth'],
2173-
}
2185+
},
21742186
},
21752187
...imageLayerWithOutline(
21762188
'speed_railway_signals',
@@ -2395,18 +2407,27 @@ const layers = {
23952407
['!=', ['get', 'azimuth'], null],
23962408
['!=', ['get', 'feature'], ''],
23972409
],
2410+
paint: {
2411+
'icon-color': colors.signals.direction,
2412+
'icon-halo-color': ['case',
2413+
['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo,
2414+
'white',
2415+
],
2416+
'icon-halo-width': 2.0,
2417+
'icon-halo-blur': 2.0,
2418+
},
23982419
layout: {
23992420
'icon-overlap': 'always',
24002421
'icon-image': ['case',
2401-
['get', 'direction_both'], 'general/signal-direction-both',
2402-
'general/signal-direction',
2422+
['get', 'direction_both'], 'sdf:general/signal-direction-both',
2423+
'sdf:general/signal-direction',
24032424
],
24042425
'icon-anchor': ['case',
24052426
['get', 'direction_both'], 'center',
24062427
'top',
24072428
],
24082429
'icon-rotate': ['get', 'azimuth'],
2409-
}
2430+
},
24102431
},
24112432
...imageLayerWithOutline(
24122433
'railway_signals_medium',
@@ -2659,18 +2680,27 @@ const layers = {
26592680
['!=', ['get', 'azimuth'], null],
26602681
['!=', ['get', 'feature'], ''],
26612682
],
2683+
paint: {
2684+
'icon-color': colors.signals.direction,
2685+
'icon-halo-color': ['case',
2686+
['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo,
2687+
'white',
2688+
],
2689+
'icon-halo-width': 2.0,
2690+
'icon-halo-blur': 2.0,
2691+
},
26622692
layout: {
26632693
'icon-overlap': 'always',
26642694
'icon-image': ['case',
2665-
['get', 'direction_both'], 'general/signal-direction-both',
2666-
'general/signal-direction',
2695+
['get', 'direction_both'], 'sdf:general/signal-direction-both',
2696+
'sdf:general/signal-direction',
26672697
],
26682698
'icon-anchor': ['case',
26692699
['get', 'direction_both'], 'center',
26702700
'top',
26712701
],
26722702
'icon-rotate': ['get', 'azimuth'],
2673-
}
2703+
},
26742704
},
26752705
...imageLayerWithOutline(
26762706
'electrification_signals',

0 commit comments

Comments
 (0)