Skip to content

Commit 0464f2d

Browse files
Akctarusflomonster
authored andcommitted
front: handle new signaling system
1 parent 9385d30 commit 0464f2d

File tree

15 files changed

+90
-4340
lines changed

15 files changed

+90
-4340
lines changed

front/src/applications/editor/Map.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Background from '../../common/Map/Layers/Background';
2020
import OSM from '../../common/Map/Layers/OSM';
2121
import Hillshade from '../../common/Map/Layers/Hillshade';
2222
import Platforms from '../../common/Map/Layers/Platforms';
23-
import osmBlankStyle from '../../common/Map/Layers/osmBlankStyle';
23+
import { useMapBlankStyle } from '../../common/Map/Layers/blankStyle';
2424
import IGN_BD_ORTHO from '../../common/Map/Layers/IGN_BD_ORTHO';
2525
import { Viewport } from '../../reducers/map';
2626
import { getMapMouseEventNearestFeature } from '../../utils/mapHelper';
@@ -58,6 +58,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
5858
children,
5959
}) => {
6060
const dispatch = useDispatch();
61+
const mapBlankStyle = useMapBlankStyle();
6162
const mapRef = useRef<MapRef>(null);
6263
const [mapState, setMapState] = useState<MapState>({
6364
isLoaded: true,
@@ -70,6 +71,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
7071
const editorState = useSelector((state: { editor: EditorState }) => state.editor);
7172
const showOSM = useSelector(getShowOSM);
7273
const terrain3DExaggeration = useSelector(getTerrain3DExaggeration);
74+
7375
const extendedContext = useMemo<ExtendedEditorContextType<CommonToolState>>(
7476
() => ({
7577
...context,
@@ -109,7 +111,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
109111
{...viewport}
110112
ref={mapRef}
111113
style={{ width: '100%', height: '100%' }}
112-
mapStyle={osmBlankStyle}
114+
mapStyle={mapBlankStyle}
113115
onMove={(e) => setViewport(e.viewState)}
114116
onMoveStart={() => setMapState((prev) => ({ ...prev, isDragging: true }))}
115117
onMoveEnd={() => {
@@ -282,7 +284,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
282284
)}
283285
</ReactMapGL>
284286
</div>
285-
{children}
287+
;{children}
286288
</>
287289
);
288290
};

front/src/applications/referenceMap/Map.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ import Switches from 'common/Map/Layers/Switches';
3636
import TracksGeographic from 'common/Map/Layers/TracksGeographic';
3737
import TracksOSM from 'common/Map/Layers/TracksOSM';
3838
import colors from 'common/Map/Consts/colors';
39-
import osmBlankStyle from 'common/Map/Layers/osmBlankStyle';
39+
import { useMapBlankStyle } from 'common/Map/Layers/blankStyle';
4040
import { CUSTOM_ATTRIBUTION } from 'common/Map/const';
4141
import LineSearchLayer from 'common/Map/Layers/LineSearchLayer';
4242

4343
import 'common/Map/Map.scss';
4444

4545
function Map() {
46+
const mapBlankStyle = useMapBlankStyle();
47+
4648
const { viewport, mapSearchMarker, mapStyle, showOSM, layersSettings } = useSelector(
4749
(state: RootState) => state.map
4850
);
@@ -108,7 +110,7 @@ function Map() {
108110
ref={mapRef}
109111
cursor="normal"
110112
style={{ width: '100%', height: '100%' }}
111-
mapStyle={osmBlankStyle}
113+
mapStyle={mapBlankStyle}
112114
onMove={(e) => updateViewportChange(e.viewState)}
113115
onMoveEnd={(e) => updateViewportChange(e.viewState, true)}
114116
attributionControl={false} // Defined below

front/src/assets/mapstyles/style_osrd_blank.json

-18
This file was deleted.

front/src/assets/mapstyles/style_osrd_empty.json

-151
This file was deleted.

0 commit comments

Comments
 (0)