diff --git a/client/src/components/Journey/JourneyMap.test.tsx b/client/src/components/Journey/JourneyMap.test.tsx
index f0e993ae3..181dbf04f 100644
--- a/client/src/components/Journey/JourneyMap.test.tsx
+++ b/client/src/components/Journey/JourneyMap.test.tsx
@@ -386,13 +386,17 @@ describe('JourneyMap', () => {
expect(L.polyline).not.toHaveBeenCalled();
});
- it('FE-COMP-JOURNEYMAP-022: fullScreen enables wheel zoom and drops the route polyline', () => {
+ it('FE-COMP-JOURNEYMAP-022: fullScreen enables wheel zoom and still draws the dashed route polyline', () => {
render(
);
expect(vi.mocked(L.map).mock.calls[0][1]).toMatchObject({ scrollWheelZoom: true });
- // The connecting route line is a sidebar-only decoration
- expect(L.polyline).not.toHaveBeenCalled();
+ // The public sidebar and the mobile map+carousel view both pass fullScreen,
+ // and the line joining the entries has to show there too (#2606)
+ expect(L.polyline).toHaveBeenCalledWith(
+ [[48.8566, 2.3522], [52.52, 13.405]],
+ expect.objectContaining({ dashArray: '4 6' }),
+ );
});
it('FE-COMP-JOURNEYMAP-023: clicking a marker reports the entry id', () => {
diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx
index 57f50dae5..4c4615ea5 100644
--- a/client/src/components/Journey/JourneyMap.tsx
+++ b/client/src/components/Journey/JourneyMap.tsx
@@ -330,8 +330,8 @@ function JourneyMap(
coords.forEach(c => trackCoords.push(c))
}
- // route polyline — only in non-fullscreen (sidebar map) mode
- if (!fullScreen && items.length > 1) {
+ // route trail: dashed line connecting entries in time order, same as JourneyMapGL
+ if (items.length > 1) {
const routeCoords = items.map(i => [i.lat, i.lng] as L.LatLngTuple)
L.polyline(routeCoords, {
color: dark ? '#71717A' : '#A1A1AA',
diff --git a/client/src/components/Journey/JourneyMapGL.test.tsx b/client/src/components/Journey/JourneyMapGL.test.tsx
index 7fd69b831..7ab9f1993 100644
--- a/client/src/components/Journey/JourneyMapGL.test.tsx
+++ b/client/src/components/Journey/JourneyMapGL.test.tsx
@@ -277,6 +277,16 @@ describe('JourneyMapGL', () => {
expect(gl.map.addLayer).not.toHaveBeenCalled()
})
+ it('FE-COMP-JMAPGL-037: the fullScreen map draws the route once the entries arrive after mount', () => {
+ withToken()
+ const { rerender } = render()
+ expect(gl.map.addSource).not.toHaveBeenCalledWith('journey-route', expect.anything())
+
+ rerender()
+ expect(gl.map.addSource).toHaveBeenCalledWith('journey-route', expect.objectContaining({ type: 'geojson' }))
+ expect(gl.map.addLayer).toHaveBeenCalledWith(expect.objectContaining({ id: 'journey-route-line' }))
+ })
+
it('FE-COMP-JMAPGL-010: the camera fits entries and trail with the requested bottom padding', () => {
withToken()
render(