Skip to content

Commit

Permalink
front: infra is displayed on the warped map
Browse files Browse the repository at this point in the history
  • Loading branch information
clarani committed Oct 5, 2023
1 parent 939092a commit a006526
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions front/src/common/Map/WarpedMap/DataLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { getMap } from 'reducers/map/selectors';
import { OSM_URL } from 'common/Map/const';
import { simplifyFeature } from 'common/Map/WarpedMap/core/helpers';
import OrderedLayer from 'common/Map/Layers/OrderedLayer';
import { transformMapRequest } from 'reducers/map';

const TIME_LABEL = 'Loading OSRD and OSM data around warped path';

Expand Down Expand Up @@ -141,6 +142,7 @@ const DataLoader: FC<{
ref={setMapRef}
mapStyle={osmBlankStyle}
style={{ width: '100%', height: '100%' }}
transformRequest={transformMapRequest}
>
{state === 'render' && (
<>
Expand Down
4 changes: 2 additions & 2 deletions front/src/common/Map/WarpedMap/WarpedMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { EditorSource, SourcesDefinitionsIndex } from 'common/Map/Layers/GeoJSON
import OrderedLayer, { OrderedLayerProps } from 'common/Map/Layers/OrderedLayer';
import { genOSMLayerProps } from 'common/Map/Layers/OSM';
import osmBlankStyle from 'common/Map/Layers/osmBlankStyle';
import { transformMapRequest, Viewport } from 'reducers/map';
import { Viewport } from 'reducers/map';
import { getMap } from 'reducers/map/selectors';
import { AllowancesSettings, Train } from 'reducers/osrdsimulation/types';

Expand Down Expand Up @@ -145,7 +145,7 @@ const WarpedMap: FC<{
onMove={(e) => {
setViewport({
...e.viewState,
transformRequest: transformMapRequest,
transformRequest: undefined,
width: e.target.getContainer().offsetWidth,
height: e.target.getContainer().offsetHeight,
});
Expand Down

0 comments on commit a006526

Please sign in to comment.