From 61b390d9514c950388af57858ea109b7062ce946 Mon Sep 17 00:00:00 2001 From: romainvalls Date: Mon, 29 Apr 2024 11:53:34 +0200 Subject: [PATCH] front: display bpcc in infra editor --- front/src/applications/editor/Map.tsx | 6 ++++++ front/src/applications/editor/components/LayersModal.tsx | 1 + front/src/applications/editor/consts.ts | 1 + front/src/config/layerOrder.ts | 2 ++ 4 files changed, 10 insertions(+) diff --git a/front/src/applications/editor/Map.tsx b/front/src/applications/editor/Map.tsx index 44bbb1d0778..e2a5b9a335b 100644 --- a/front/src/applications/editor/Map.tsx +++ b/front/src/applications/editor/Map.tsx @@ -18,6 +18,7 @@ import { CUSTOM_ATTRIBUTION } from 'common/Map/const'; import colors from 'common/Map/Consts/colors'; import Background from 'common/Map/Layers/Background'; import { useMapBlankStyle } from 'common/Map/Layers/blankStyle'; +import NeutralSections from 'common/Map/Layers/extensions/SNCF/NeutralSections'; import Hillshade from 'common/Map/Layers/Hillshade'; import IGN_BD_ORTHO from 'common/Map/Layers/IGN_BD_ORTHO'; import IGN_CADASTRE from 'common/Map/Layers/IGN_CADASTRE'; @@ -324,6 +325,11 @@ const MapUnplugged = ({ colors={colors[mapStyle]} layerOrder={LAYER_GROUPS_ORDER[LAYERS.PLATFORMS.GROUP]} /> + {/* Tool specific layers */} {!isNil(infraID) && activeTool.layersComponent && mapRef.current && ( diff --git a/front/src/applications/editor/components/LayersModal.tsx b/front/src/applications/editor/components/LayersModal.tsx index 56c04fd51ab..a0508ad73c6 100644 --- a/front/src/applications/editor/components/LayersModal.tsx +++ b/front/src/applications/editor/components/LayersModal.tsx @@ -40,6 +40,7 @@ export const LAYERS: Array<{ layers: Layer[]; icon: string | JSX.Element }> = [ layers: ['platforms'], icon: , }, + { layers: ['neutral_sections'], icon: }, ]; interface LayersModalProps { diff --git a/front/src/applications/editor/consts.ts b/front/src/applications/editor/consts.ts index bbd1a9bc357..cc53c99aaea 100644 --- a/front/src/applications/editor/consts.ts +++ b/front/src/applications/editor/consts.ts @@ -15,6 +15,7 @@ const INFRA_EDITOR_LAYERS = [ 'switches', 'track_sections', 'platforms', + 'neutral_sections', ] as const; export const LAYERS_SET: Set = new Set(INFRA_EDITOR_LAYERS); export type Layer = (typeof INFRA_EDITOR_LAYERS)[number]; diff --git a/front/src/config/layerOrder.ts b/front/src/config/layerOrder.ts index 610920b18b9..315a35538ec 100644 --- a/front/src/config/layerOrder.ts +++ b/front/src/config/layerOrder.ts @@ -55,6 +55,7 @@ export const LAYERS = Object.freeze({ TRAIN: { GROUP: LAYER_GROUPS.TRAIN }, // 7 ERRORS: { GROUP: LAYER_GROUPS.ERRORS }, + DEAD_SECTIONS: { GROUP: LAYER_GROUPS.DEAD_SECTIONS }, }); export const LAYER_ENTITIES_ORDERS: Record = Object.freeze({ @@ -71,4 +72,5 @@ export const LAYER_ENTITIES_ORDERS: Record = Object.freeze({ neutral_signs: LAYER_GROUPS_ORDER[LAYERS.SIGNALS.GROUP], errors: LAYER_GROUPS_ORDER[LAYERS.ERRORS.GROUP], platforms: LAYER_GROUPS_ORDER[LAYERS.PLATFORMS.GROUP], + neutral_section: LAYER_GROUPS_ORDER[LAYERS.DEAD_SECTIONS.GROUP], });