This commit is contained in:
Andras Schmelczer 2026-05-31 13:17:11 +01:00
parent c995f12f8b
commit 8dc939d761
44 changed files with 3540 additions and 2159478 deletions

View file

@ -132,10 +132,7 @@ export default function LocationSearch({
if (result.type === 'place') {
const zoom = ZOOM_FOR_TYPE[result.place_type] ?? 14;
// On mobile the drawer opens after onLocationSearched; MapPage handles
// the fly-to there with the correct viewport inset so the target isn't
// hidden behind the drawer. On desktop fly immediately for snappy feedback.
if (!isMobile) onFlyTo(result.lat, result.lon, zoom);
const flyZoom = result.place_type === 'outcode' ? POSTCODE_SEARCH_ZOOM : zoom;
try {
const params = new URLSearchParams({
lat: String(result.lat),
@ -158,10 +155,11 @@ export default function LocationSearch({
geometry: json.geometry,
latitude: json.latitude,
longitude: json.longitude,
zoom,
zoom: flyZoom,
markerLatitude: result.lat,
markerLongitude: result.lon,
});
if (!isMobile) onFlyTo(result.lat, result.lon, flyZoom);
search.saveRecentSearch(result);
search.clear();
if (isMobile) setExpanded(false);