Skip to content

Commit

Permalink
front: display bpcc in infra editor
Browse files Browse the repository at this point in the history
  • Loading branch information
RomainValls committed Apr 29, 2024
1 parent 11da135 commit 61b390d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions front/src/applications/editor/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -324,6 +325,11 @@ const MapUnplugged = ({
colors={colors[mapStyle]}
layerOrder={LAYER_GROUPS_ORDER[LAYERS.PLATFORMS.GROUP]}
/>
<NeutralSections
colors={colors[mapStyle]}
layerOrder={LAYER_GROUPS_ORDER[LAYERS.DEAD_SECTIONS.GROUP]}
infraID={infraID}
/>

{/* Tool specific layers */}
{!isNil(infraID) && activeTool.layersComponent && mapRef.current && (
Expand Down
1 change: 1 addition & 0 deletions front/src/applications/editor/components/LayersModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const LAYERS: Array<{ layers: Layer[]; icon: string | JSX.Element }> = [
layers: ['platforms'],
icon: <TbRectangleVerticalFilled style={{ width: '20px' }} className="mx-2" />,
},
{ layers: ['neutral_sections'], icon: <GiElectric style={{ width: '20px' }} className="mx-2" /> },
];

interface LayersModalProps {
Expand Down
1 change: 1 addition & 0 deletions front/src/applications/editor/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const INFRA_EDITOR_LAYERS = [
'switches',
'track_sections',
'platforms',
'neutral_sections',
] as const;
export const LAYERS_SET: Set<string> = new Set(INFRA_EDITOR_LAYERS);
export type Layer = (typeof INFRA_EDITOR_LAYERS)[number];
Expand Down
2 changes: 2 additions & 0 deletions front/src/config/layerOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Layer, number> = Object.freeze({
Expand All @@ -71,4 +72,5 @@ export const LAYER_ENTITIES_ORDERS: Record<Layer, number> = 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],
});

0 comments on commit 61b390d

Please sign in to comment.