Skip to content

Commit

Permalink
railway direction with hover color
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie committed Oct 26, 2024
1 parent 08e5119 commit fb08b1a
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions proxy/js/styles.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ const colors = {
},
},
},
signals: {
direction: '#a8d8bcff'
}
};

const turntable_casing_width = 2;
Expand Down Expand Up @@ -2159,18 +2162,27 @@ const layers = {
['!=', ['get', 'azimuth'], null],
],
],
paint: {
'icon-color': colors.signals.direction,
'icon-halo-color': ['case',
['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo,
'white',
],
'icon-halo-width': 2.0,
'icon-halo-blur': 2.0,
},
layout: {
'icon-overlap': 'always',
'icon-image': ['case',
['get', 'direction_both'], 'general/signal-direction-both',
'general/signal-direction',
['get', 'direction_both'], 'sdf:general/signal-direction-both',
'sdf:general/signal-direction',
],
'icon-anchor': ['case',
['get', 'direction_both'], 'center',
'top',
],
'icon-rotate': ['get', 'azimuth'],
}
},
},
...imageLayerWithOutline(
'speed_railway_signals',
Expand Down Expand Up @@ -2395,18 +2407,27 @@ const layers = {
['!=', ['get', 'azimuth'], null],
['!=', ['get', 'feature'], ''],
],
paint: {
'icon-color': colors.signals.direction,
'icon-halo-color': ['case',
['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo,
'white',
],
'icon-halo-width': 2.0,
'icon-halo-blur': 2.0,
},
layout: {
'icon-overlap': 'always',
'icon-image': ['case',
['get', 'direction_both'], 'general/signal-direction-both',
'general/signal-direction',
['get', 'direction_both'], 'sdf:general/signal-direction-both',
'sdf:general/signal-direction',
],
'icon-anchor': ['case',
['get', 'direction_both'], 'center',
'top',
],
'icon-rotate': ['get', 'azimuth'],
}
},
},
...imageLayerWithOutline(
'railway_signals_medium',
Expand Down Expand Up @@ -2659,18 +2680,27 @@ const layers = {
['!=', ['get', 'azimuth'], null],
['!=', ['get', 'feature'], ''],
],
paint: {
'icon-color': colors.signals.direction,
'icon-halo-color': ['case',
['boolean', ['feature-state', 'hover'], false], colors.hover.textHalo,
'white',
],
'icon-halo-width': 2.0,
'icon-halo-blur': 2.0,
},
layout: {
'icon-overlap': 'always',
'icon-image': ['case',
['get', 'direction_both'], 'general/signal-direction-both',
'general/signal-direction',
['get', 'direction_both'], 'sdf:general/signal-direction-both',
'sdf:general/signal-direction',
],
'icon-anchor': ['case',
['get', 'direction_both'], 'center',
'top',
],
'icon-rotate': ['get', 'azimuth'],
}
},
},
...imageLayerWithOutline(
'electrification_signals',
Expand Down

0 comments on commit fb08b1a

Please sign in to comment.