From 2315c7027935f9eda4c7552cd2f77c712546d7e9 Mon Sep 17 00:00:00 2001 From: theocrsb Date: Wed, 23 Oct 2024 15:11:38 +0200 Subject: [PATCH 1/2] front: update color line of map in scenario page Signed-off-by: theocrsb --- .../SimulationResultsMap/RenderItinerary.tsx | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx b/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx index 75e77137a0e..1af29c5a1fe 100644 --- a/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx +++ b/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx @@ -11,14 +11,26 @@ interface RenderItineraryProps { export default function RenderItinerary(props: RenderItineraryProps) { const { geojsonPath, layerOrder } = props; - const paint = { - 'line-width': 3, - 'line-color': '#82be00', + const paintBackgroundLine = { + 'line-width': 4, + 'line-color': '#EDF9FF', + }; + + const paintLine = { + 'line-width': 1, + 'line-color': '#158DCF', }; return ( - + + ); } From 37a92e457e1d38ca2de0ef432f1eadbacd27f03a Mon Sep 17 00:00:00 2001 From: theocrsb Date: Tue, 29 Oct 2024 11:04:34 +0100 Subject: [PATCH 2/2] front: add start and destination icons in the scenario map Signed-off-by: theocrsb --- .../components/StdcmForm/StdcmDestination.tsx | 2 +- .../stdcm/components/StdcmForm/StdcmOrigin.tsx | 2 +- .../stdcm/components/StdcmForm/StdcmVias.tsx | 2 +- .../pictures/{stdcm => mapMarkers}/destination.svg | 0 .../{stdcm => mapMarkers}/intermediate-point.svg | 0 .../pictures/{stdcm => mapMarkers}/start.svg | 0 .../SimulationResultsMap/RenderItinerary.tsx | 14 +++++++++++++- .../ManageTrainScheduleMap/ItineraryMarkers.tsx | 6 +++--- 8 files changed, 19 insertions(+), 7 deletions(-) rename front/src/assets/pictures/{stdcm => mapMarkers}/destination.svg (100%) rename front/src/assets/pictures/{stdcm => mapMarkers}/intermediate-point.svg (100%) rename front/src/assets/pictures/{stdcm => mapMarkers}/start.svg (100%) diff --git a/front/src/applications/stdcm/components/StdcmForm/StdcmDestination.tsx b/front/src/applications/stdcm/components/StdcmForm/StdcmDestination.tsx index dde28efcf12..990a533db5d 100644 --- a/front/src/applications/stdcm/components/StdcmForm/StdcmDestination.tsx +++ b/front/src/applications/stdcm/components/StdcmForm/StdcmDestination.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import DestinationIcon from 'assets/pictures/stdcm/destination.svg'; +import DestinationIcon from 'assets/pictures/mapMarkers/destination.svg'; import { useOsrdConfActions, useOsrdConfSelectors } from 'common/osrdContext'; import type { StdcmConfSliceActions } from 'reducers/osrdconf/stdcmConf'; import type { StdcmConfSelectors } from 'reducers/osrdconf/stdcmConf/selectors'; diff --git a/front/src/applications/stdcm/components/StdcmForm/StdcmOrigin.tsx b/front/src/applications/stdcm/components/StdcmForm/StdcmOrigin.tsx index f9468c1c241..ed6ea2a5b9c 100644 --- a/front/src/applications/stdcm/components/StdcmForm/StdcmOrigin.tsx +++ b/front/src/applications/stdcm/components/StdcmForm/StdcmOrigin.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import OriginIcon from 'assets/pictures/stdcm/start.svg'; +import OriginIcon from 'assets/pictures/mapMarkers/start.svg'; import { useOsrdConfActions, useOsrdConfSelectors } from 'common/osrdContext'; import type { StdcmConfSliceActions } from 'reducers/osrdconf/stdcmConf'; import type { StdcmConfSelectors } from 'reducers/osrdconf/stdcmConf/selectors'; diff --git a/front/src/applications/stdcm/components/StdcmForm/StdcmVias.tsx b/front/src/applications/stdcm/components/StdcmForm/StdcmVias.tsx index 65372fbc06f..6d37886a465 100644 --- a/front/src/applications/stdcm/components/StdcmForm/StdcmVias.tsx +++ b/front/src/applications/stdcm/components/StdcmForm/StdcmVias.tsx @@ -4,7 +4,7 @@ import { Location } from '@osrd-project/ui-icons'; import { useTranslation } from 'react-i18next'; import { useSelector } from 'react-redux'; -import IntermediatePointIcon from 'assets/pictures/stdcm/intermediate-point.svg'; +import IntermediatePointIcon from 'assets/pictures/mapMarkers/intermediate-point.svg'; import { useOsrdConfSelectors, useOsrdConfActions } from 'common/osrdContext'; import type { StdcmConfSliceActions } from 'reducers/osrdconf/stdcmConf'; import type { StdcmConfSelectors } from 'reducers/osrdconf/stdcmConf/selectors'; diff --git a/front/src/assets/pictures/stdcm/destination.svg b/front/src/assets/pictures/mapMarkers/destination.svg similarity index 100% rename from front/src/assets/pictures/stdcm/destination.svg rename to front/src/assets/pictures/mapMarkers/destination.svg diff --git a/front/src/assets/pictures/stdcm/intermediate-point.svg b/front/src/assets/pictures/mapMarkers/intermediate-point.svg similarity index 100% rename from front/src/assets/pictures/stdcm/intermediate-point.svg rename to front/src/assets/pictures/mapMarkers/intermediate-point.svg diff --git a/front/src/assets/pictures/stdcm/start.svg b/front/src/assets/pictures/mapMarkers/start.svg similarity index 100% rename from front/src/assets/pictures/stdcm/start.svg rename to front/src/assets/pictures/mapMarkers/start.svg diff --git a/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx b/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx index 1af29c5a1fe..3270c8994a0 100644 --- a/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx +++ b/front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx @@ -1,6 +1,8 @@ import type { Feature, LineString } from 'geojson'; -import { Source } from 'react-map-gl/maplibre'; +import { Marker, Source } from 'react-map-gl/maplibre'; +import destinationIcon from 'assets/pictures/mapMarkers/destination.svg'; +import originIcon from 'assets/pictures/mapMarkers/start.svg'; import OrderedLayer from 'common/Map/Layers/OrderedLayer'; interface RenderItineraryProps { @@ -21,8 +23,15 @@ export default function RenderItinerary(props: RenderItineraryProps) { 'line-color': '#158DCF', }; + // We know we have a geometry so we have at least 2 coordinates + const [startLongitude, startLatitude] = geojsonPath.geometry.coordinates.at(0)!; + const [endLongitude, endLatitude] = geojsonPath.geometry.coordinates.at(-1)!; + return ( + + origin + + + destination + ); } diff --git a/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/ItineraryMarkers.tsx b/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/ItineraryMarkers.tsx index ad8d916f2eb..82b21e0f8d8 100644 --- a/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/ItineraryMarkers.tsx +++ b/front/src/modules/trainschedule/components/ManageTrainSchedule/ManageTrainScheduleMap/ItineraryMarkers.tsx @@ -7,10 +7,10 @@ import { Marker } from 'react-map-gl/maplibre'; import { useSelector } from 'react-redux'; import destinationSVG from 'assets/pictures/destination.svg'; +import stdcmDestination from 'assets/pictures/mapMarkers/destination.svg'; +import stdcmVia from 'assets/pictures/mapMarkers/intermediate-point.svg'; +import stdcmOrigin from 'assets/pictures/mapMarkers/start.svg'; import originSVG from 'assets/pictures/origin.svg'; -import stdcmDestination from 'assets/pictures/stdcm/destination.svg'; -import stdcmVia from 'assets/pictures/stdcm/intermediate-point.svg'; -import stdcmOrigin from 'assets/pictures/stdcm/start.svg'; import viaSVG from 'assets/pictures/via.svg'; import { useOsrdConfSelectors } from 'common/osrdContext'; import type { PathStep } from 'reducers/osrdconf/types';