Skip to content

Commit c5ea4c2

Browse files
committed
front: kps: adjust position label
1 parent 2e5345c commit c5ea4c2

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

front/src/common/Map/Layers/BufferStops.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,17 @@ export function getBufferStopsLayerProps(params: { sourceTable?: string }): Omit
1515
'text-field': '{extensions_sncf_kp}',
1616
'text-font': ['Roboto Condensed'],
1717
'text-size': 10,
18-
'text-offset': [0, 1.2],
18+
'text-offset': [1, 0.2],
1919
'icon-image': 'HEURTOIR',
2020
'icon-size': 0.2,
21-
'text-anchor': 'center',
21+
'text-anchor': 'left',
2222
'icon-rotation-alignment': 'viewport',
2323
'icon-allow-overlap': false,
2424
'icon-ignore-placement': false,
2525
'text-allow-overlap': false,
2626
},
2727
paint: {
28-
'text-color': '#555',
29-
'text-halo-width': 2,
30-
'text-halo-color': 'rgba(255,255,255,0.75)',
31-
'text-halo-blur': 1,
28+
'text-color': '#333',
3229
},
3330
};
3431

front/src/common/Map/Layers/GeoJSONs.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ function getSignalLayers(context: LayerContext, prefix: string): LayerProps[] {
149149
{ ...getPointLayerProps(context), id: `${prefix}geo/signal-point` },
150150
{
151151
...configKPLabelLayer({
152+
bottomOffset: 6.5,
152153
colors: context.colors,
153154
fieldName: 'extensions_sncf_kp',
154155
minzoom: 12,

front/src/common/Map/Layers/OperationalPoints.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default function OperationalPoints(props: Props) {
146146
<OrderedLayer
147147
{...configKPLabelLayer({
148148
colors,
149-
fieldName: 'extensions_sncf_kp',
149+
fieldName: 'kp',
150150
minzoom: 9.5,
151151
sourceLayer: 'operational_points',
152152
})}

front/src/common/Map/Layers/Signals.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function Signals(props: PlatformProps) {
8383
/>
8484
<OrderedLayer
8585
{...configKPLabelLayer({
86+
bottomOffset: 6.5,
8687
colors,
8788
fieldName: 'extensions_sncf_kp',
8889
minzoom: 12,

front/src/common/Map/Layers/configKPLabelLayer.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { LayerProps } from 'react-map-gl/maplibre';
44
import { Theme } from 'types';
55

66
interface PlatformProps {
7+
bottomOffset?: number;
78
colors: Theme;
89
fieldName?: string;
910
maxzoom?: number;
@@ -14,6 +15,7 @@ interface PlatformProps {
1415

1516
export default function configKPLabelLayer(props: PlatformProps) {
1617
const {
18+
bottomOffset = 2.5,
1719
colors,
1820
fieldName = 'kp',
1921
maxzoom = 24,
@@ -48,7 +50,7 @@ export default function configKPLabelLayer(props: PlatformProps) {
4850
['literal', [-2.75, 0.2]],
4951
testSideExpression('RIGHT') as ExpressionFilterSpecification,
5052
['literal', [2.75, 0.2]],
51-
['literal', [0, 2.5]],
53+
['literal', [0, bottomOffset]],
5254
],
5355
}
5456
: {
@@ -62,7 +64,7 @@ export default function configKPLabelLayer(props: PlatformProps) {
6264
maxzoom,
6365
minzoom,
6466
layout: {
65-
'text-field': ['concat', 'PK ', ['get', fieldName]],
67+
'text-field': ['get', fieldName],
6668
'text-font': ['Roboto Medium'],
6769
'text-size': 9,
6870
'text-anchor': 'right',

0 commit comments

Comments
 (0)