Skip to content

Commit bd72229

Browse files
committed
front: fix map marker offset
Set the `offset` prop to define the image "hotspot" (ie, pixel coordinate where the sign is planted on). Signed-off-by: Simon Ser <[email protected]> Closes: #9633
1 parent a2b230f commit bd72229

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

front/src/modules/simulationResult/components/SimulationResultsMap/RenderItinerary.tsx

+14-3
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,29 @@ export default function RenderItinerary({
3838

3939
return (
4040
<Source type="geojson" data={geojsonPath}>
41-
<Marker longitude={originLongitude} latitude={originLatitude} anchor="bottom">
41+
<Marker longitude={originLongitude} latitude={originLatitude} anchor="bottom" offset={[0, 8]}>
4242
<img src={originIcon} alt="origin" />
4343
</Marker>
4444
{vias.map(([longitude, latitude], index) => (
45-
<Marker key={`via-${index}`} longitude={longitude} latitude={latitude} anchor="bottom">
45+
<Marker
46+
key={`via-${index}`}
47+
longitude={longitude}
48+
latitude={latitude}
49+
anchor="bottom"
50+
offset={[0, 8]}
51+
>
4652
<img src={viaIcon} alt={`via ${index + 1}`} />
4753
<span className={cx('map-pathfinding-marker', 'via-number', 'stdcm-via')}>
4854
{index + 1}
4955
</span>
5056
</Marker>
5157
))}
52-
<Marker longitude={destinationLongitude} latitude={destinationLatitude} anchor="bottom">
58+
<Marker
59+
longitude={destinationLongitude}
60+
latitude={destinationLatitude}
61+
anchor="bottom"
62+
offset={[0, 8]}
63+
>
5364
<img src={destinationIcon} alt="destination" />
5465
</Marker>
5566
<OrderedLayer

0 commit comments

Comments
 (0)