Skip to content

Commit 95ac784

Browse files
committed
fix layer activation for non generated forms
1 parent ecc0314 commit 95ac784

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

front/src/applications/editor/tools/rangeEdition/catenary/CatenaryEditionLayers.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const CatenaryEditionLayers: FC = () => {
2323
const dispatch = useDispatch();
2424
const { t } = useTranslation();
2525
const {
26+
editorState,
2627
renderingFingerprint,
2728
state: { entity, trackSectionsCache, hoveredItem, interactionState, mousePosition },
2829
setState,
@@ -76,8 +77,6 @@ export const CatenaryEditionLayers: FC = () => {
7677
return SourcesDefinitionsIndex.catenaries(context, 'rangeEditors/catenaries/');
7778
}, [mapStyle, showIGNBDORTHO, layersSettings, issuesSettings]);
7879

79-
const layers = useMemo(() => new Set(['track_sections']) as Set<LayerType>, []);
80-
8180
// Here is where we handle loading the TrackSections attached to the speed section:
8281
useEffect(() => {
8382
const trackIDs = entity.properties?.track_ranges?.map((range) => range.track) || [];
@@ -185,7 +184,7 @@ export const CatenaryEditionLayers: FC = () => {
185184
<>
186185
<GeoJSONs
187186
colors={colors[mapStyle]}
188-
layers={layers}
187+
layers={editorState.editorLayers}
189188
selection={selection}
190189
fingerprint={renderingFingerprint}
191190
layersSettings={layersSettings}

front/src/applications/editor/tools/rangeEdition/speedSection/SpeedSectionEditionLayers.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export const SpeedSectionEditionLayers: FC = () => {
2828
const dispatch = useDispatch();
2929
const { t } = useTranslation();
3030
const {
31+
editorState,
3132
renderingFingerprint,
3233
state: { entity, trackSectionsCache, hoveredItem, interactionState, mousePosition },
3334
setState,
@@ -97,8 +98,6 @@ export const SpeedSectionEditionLayers: FC = () => {
9798
return [...pslLayers, ...pslSignLayers];
9899
}, [isPSL, mapStyle, showIGNBDORTHO, layersSettings, issuesSettings]);
99100

100-
const layers = useMemo(() => new Set(['track_sections']) as Set<LayerType>, []);
101-
102101
// Here is where we handle loading the TrackSections attached to the speed section:
103102
useEffect(() => {
104103
const trackIDs = entity.properties?.track_ranges?.map((range) => range.track) || [];
@@ -217,7 +216,7 @@ export const SpeedSectionEditionLayers: FC = () => {
217216
<>
218217
<GeoJSONs
219218
colors={colors[mapStyle]}
220-
layers={layers}
219+
layers={editorState.editorLayers}
221220
selection={selection}
222221
fingerprint={renderingFingerprint}
223222
layersSettings={layersSettings}

0 commit comments

Comments
 (0)