fix(map): keep the selected place findable on the map

Selecting a place no longer spiderfies a city-sized cluster: the reveal
only fans open bubbles of up to 12 stops, or stacks whose stops all share
one coordinate, so a zoomed-out trip with hundreds of places stays usable
(#2990).

The selected pin now carries a white border inside a pulsing blue ring on
both renderers (static under reduced motion), and the map measures the
place card instead of assuming a fixed 320px, so the selection pans the
pin above even a tall card on portrait tablets and eases it back out when
the card grows over it later (#2991).

Closes #2990
Closes #2991
This commit is contained in:
Maurice
2026-11-06 11:51:16 +01:00
parent d7c4324afc
commit 4c0583845a
26 changed files with 713 additions and 107 deletions
@@ -3,6 +3,7 @@ import { ParkingSquare } from 'lucide-react'
import { renderIconMarkup } from '../../utils/iconMarkup'
import { isServiceStopType, serviceColor } from './roadtripModel'
import { STOP_KIND_BY_KEY } from './stopKinds'
import { SELECTED_MARKER } from '../Map/markerLook'
/**
* Smaller than a place marker on purpose.
@@ -42,10 +43,9 @@ export function serviceMarkerHtml(stopType: string | null | undefined, selected:
color: '#fff',
strokeWidth: 2.4,
}))
const ring = selected
? '0 0 0 3px rgba(17,24,39,0.25), 0 4px 12px rgba(0,0,0,0.3)'
: '0 2px 6px rgba(0,0,0,0.25)'
return `<div style="
// Selected, it carries the same ring as a selected place pin, so the two read alike.
const ring = selected ? SELECTED_MARKER.ring : '0 2px 6px rgba(0,0,0,0.25)'
return `<div class="${selected ? SELECTED_MARKER.className : ''}" style="
width:${size}px;height:${size}px;border-radius:50%;
background:${serviceColor(stopType)};
border:${BORDER}px solid #fff;box-shadow:${ring};