Skip to content

Commit dad9c1c

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

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ import { getTrackRangeFeatures, isOnModeMove } from '../utils';
1717
import { RangeEditionState, TrackState } from '../types';
1818
import { ExtendedEditorContextType } from '../../editorContextTypes';
1919
import EntitySumUp from '../../../components/EntitySumUp';
20-
import { LayerType } from '../../types';
2120

2221
export const CatenaryEditionLayers: FC = () => {
2322
const dispatch = useDispatch();
2423
const { t } = useTranslation();
2524
const {
25+
editorState: { editorLayers },
2626
renderingFingerprint,
2727
state: { entity, trackSectionsCache, hoveredItem, interactionState, mousePosition },
2828
setState,
@@ -76,8 +76,6 @@ export const CatenaryEditionLayers: FC = () => {
7676
return SourcesDefinitionsIndex.catenaries(context, 'rangeEditors/catenaries/');
7777
}, [mapStyle, showIGNBDORTHO, layersSettings, issuesSettings]);
7878

79-
const layers = useMemo(() => new Set(['track_sections']) as Set<LayerType>, []);
80-
8179
// Here is where we handle loading the TrackSections attached to the speed section:
8280
useEffect(() => {
8381
const trackIDs = entity.properties?.track_ranges?.map((range) => range.track) || [];
@@ -185,7 +183,7 @@ export const CatenaryEditionLayers: FC = () => {
185183
<>
186184
<GeoJSONs
187185
colors={colors[mapStyle]}
188-
layers={layers}
186+
layers={editorLayers}
189187
selection={selection}
190188
fingerprint={renderingFingerprint}
191189
layersSettings={layersSettings}

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ import {
2222
import { PslSignFeature, RangeEditionState, TrackState } from '../types';
2323
import { ExtendedEditorContextType } from '../../editorContextTypes';
2424
import EntitySumUp from '../../../components/EntitySumUp';
25-
import { LayerType } from '../../types';
2625

2726
export const SpeedSectionEditionLayers: FC = () => {
2827
const dispatch = useDispatch();
2928
const { t } = useTranslation();
3029
const {
30+
editorState: { editorLayers },
3131
renderingFingerprint,
3232
state: { entity, trackSectionsCache, hoveredItem, interactionState, mousePosition },
3333
setState,
@@ -97,8 +97,6 @@ export const SpeedSectionEditionLayers: FC = () => {
9797
return [...pslLayers, ...pslSignLayers];
9898
}, [isPSL, mapStyle, showIGNBDORTHO, layersSettings, issuesSettings]);
9999

100-
const layers = useMemo(() => new Set(['track_sections']) as Set<LayerType>, []);
101-
102100
// Here is where we handle loading the TrackSections attached to the speed section:
103101
useEffect(() => {
104102
const trackIDs = entity.properties?.track_ranges?.map((range) => range.track) || [];
@@ -217,7 +215,7 @@ export const SpeedSectionEditionLayers: FC = () => {
217215
<>
218216
<GeoJSONs
219217
colors={colors[mapStyle]}
220-
layers={layers}
218+
layers={editorLayers}
221219
selection={selection}
222220
fingerprint={renderingFingerprint}
223221
layersSettings={layersSettings}

0 commit comments

Comments
 (0)