Skip to content

Commit

Permalink
front: handle new signaling system
Browse files Browse the repository at this point in the history
  • Loading branch information
Akctarus authored and flomonster committed Oct 20, 2023
1 parent 9b4fec5 commit 5296048
Show file tree
Hide file tree
Showing 15 changed files with 90 additions and 4,340 deletions.
8 changes: 5 additions & 3 deletions front/src/applications/editor/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import Background from '../../common/Map/Layers/Background';
import OSM from '../../common/Map/Layers/OSM';
import Hillshade from '../../common/Map/Layers/Hillshade';
import Platforms from '../../common/Map/Layers/Platforms';
import osmBlankStyle from '../../common/Map/Layers/osmBlankStyle';
import { useMapBlankStyle } from '../../common/Map/Layers/blankStyle';
import IGN_BD_ORTHO from '../../common/Map/Layers/IGN_BD_ORTHO';
import { Viewport } from '../../reducers/map';
import { getMapMouseEventNearestFeature } from '../../utils/mapHelper';
Expand Down Expand Up @@ -58,6 +58,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
children,
}) => {
const dispatch = useDispatch();
const mapBlankStyle = useMapBlankStyle();
const mapRef = useRef<MapRef>(null);
const [mapState, setMapState] = useState<MapState>({
isLoaded: true,
Expand All @@ -70,6 +71,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
const editorState = useSelector((state: { editor: EditorState }) => state.editor);
const showOSM = useSelector(getShowOSM);
const terrain3DExaggeration = useSelector(getTerrain3DExaggeration);

const extendedContext = useMemo<ExtendedEditorContextType<CommonToolState>>(
() => ({
...context,
Expand Down Expand Up @@ -109,7 +111,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
{...viewport}
ref={mapRef}
style={{ width: '100%', height: '100%' }}
mapStyle={osmBlankStyle}
mapStyle={mapBlankStyle}
onMove={(e) => setViewport(e.viewState)}
onMoveStart={() => setMapState((prev) => ({ ...prev, isDragging: true }))}
onMoveEnd={() => {
Expand Down Expand Up @@ -282,7 +284,7 @@ const MapUnplugged: FC<PropsWithChildren<MapProps>> = ({
)}
</ReactMapGL>
</div>
{children}
;{children}
</>
);
};
Expand Down
6 changes: 4 additions & 2 deletions front/src/applications/referenceMap/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ import Switches from 'common/Map/Layers/Switches';
import TracksGeographic from 'common/Map/Layers/TracksGeographic';
import TracksOSM from 'common/Map/Layers/TracksOSM';
import colors from 'common/Map/Consts/colors';
import osmBlankStyle from 'common/Map/Layers/osmBlankStyle';
import { useMapBlankStyle } from 'common/Map/Layers/blankStyle';
import { CUSTOM_ATTRIBUTION } from 'common/Map/const';
import LineSearchLayer from 'common/Map/Layers/LineSearchLayer';

import 'common/Map/Map.scss';

function Map() {
const mapBlankStyle = useMapBlankStyle();

const { viewport, mapSearchMarker, mapStyle, showOSM, layersSettings } = useSelector(
(state: RootState) => state.map
);
Expand Down Expand Up @@ -108,7 +110,7 @@ function Map() {
ref={mapRef}
cursor="normal"
style={{ width: '100%', height: '100%' }}
mapStyle={osmBlankStyle}
mapStyle={mapBlankStyle}
onMove={(e) => updateViewportChange(e.viewState)}
onMoveEnd={(e) => updateViewportChange(e.viewState, true)}
attributionControl={false} // Defined below
Expand Down
18 changes: 0 additions & 18 deletions front/src/assets/mapstyles/style_osrd_blank.json

This file was deleted.

151 changes: 0 additions & 151 deletions front/src/assets/mapstyles/style_osrd_empty.json

This file was deleted.

Loading

0 comments on commit 5296048

Please sign in to comment.