Skip to content

Commit

Permalink
front: fix map marker offset
Browse files Browse the repository at this point in the history
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
  • Loading branch information
emersion committed Nov 26, 2024
1 parent a2b230f commit eabc327
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ export default function RenderItinerary({

return (
<Source type="geojson" data={geojsonPath}>
<Marker longitude={originLongitude} latitude={originLatitude} anchor="bottom">
<Marker longitude={originLongitude} latitude={originLatitude} anchor="bottom" offset={[0, 8]}>
<img src={originIcon} alt="origin" />
</Marker>
{vias.map(([longitude, latitude], index) => (
<Marker key={`via-${index}`} longitude={longitude} latitude={latitude} anchor="bottom">
<Marker key={`via-${index}`} longitude={longitude} latitude={latitude} anchor="bottom" offset={[0, 8]}>
<img src={viaIcon} alt={`via ${index + 1}`} />
<span className={cx('map-pathfinding-marker', 'via-number', 'stdcm-via')}>
{index + 1}
</span>
</Marker>
))}
<Marker longitude={destinationLongitude} latitude={destinationLatitude} anchor="bottom">
<Marker longitude={destinationLongitude} latitude={destinationLatitude} anchor="bottom" offset={[0, 8]}>
<img src={destinationIcon} alt="destination" />
</Marker>
<OrderedLayer
Expand Down

0 comments on commit eabc327

Please sign in to comment.