diff --git a/frontend/src/components/site-finder/SiteMap.tsx b/frontend/src/components/site-finder/SiteMap.tsx index 25b63f2d..a69cd427 100644 --- a/frontend/src/components/site-finder/SiteMap.tsx +++ b/frontend/src/components/site-finder/SiteMap.tsx @@ -126,6 +126,11 @@ interface Props { // §12.1-13 (#958) — opportunity-ЗУ + красные линии застройки (geom_wkt). opportunityParcels?: OpportunityParcel[]; redLines?: RedLine[]; + // #1218 — высота тайла карты (px). Default 420 — режим обычной странички + // /site-finder/[cad]. MiniMap на /analysis передаёт меньше (≈280), чтобы + // карта была компактнее. На высоту НЕ влияет на flow-контролы ниже + // (POI add button, легенда, CpLayerControlPanel) — они идут потоком. + mapHeight?: number; } // Ключи переключаемых рыночных слоёв (#999 + §12.1-13 #958). @@ -167,6 +172,7 @@ export function SiteMap({ riskZones, opportunityParcels, redLines, + mapHeight = 420, }: Props) { // Fix Leaflet default icon paths broken by webpack bundler useEffect(() => { @@ -310,7 +316,7 @@ export function SiteMap({ border: "1px solid #e5e7eb", borderRadius: 12, overflow: "hidden", - height: 420, + height: mapHeight, cursor: addMode ? "crosshair" : "grab", }} > diff --git a/frontend/src/components/site-finder/analysis/MiniMap.tsx b/frontend/src/components/site-finder/analysis/MiniMap.tsx index 4cf4b4c3..5c4ff079 100644 --- a/frontend/src/components/site-finder/analysis/MiniMap.tsx +++ b/frontend/src/components/site-finder/analysis/MiniMap.tsx @@ -1,9 +1,15 @@ "use client"; /** - * MiniMap — compact Leaflet map (400×320) showing parcel polygon + top POI. + * MiniMap — compact Leaflet map (≈400px wide) showing parcel polygon + top POI. * Dynamic import of react-leaflet (ssr:false) to avoid SSR breakage. - * Wraps SiteMap with fixed dimensions for Section 1 layout. + * Wraps SiteMap with constrained width for Section 1 layout. + * + * #1218: ранее обёртка имела `height: 320 + overflow: hidden` — это клипало + * legend + CpLayerControlPanel, рендерящиеся flow-div ПОД картой в SiteMap, + * и делало недостижимыми переключатели рыночных слоёв (Будущие проекты, + * Зоны риска, Перспективные ЗУ, Красные линии). Фикс: задаём только ширину, + * высота тайла карты — через prop `mapHeight` SiteMap; контент течёт вниз. */ import dynamic from "next/dynamic"; @@ -11,6 +17,10 @@ import type { ParcelAnalyzeResponse } from "@/lib/site-finder-api"; import type { ParcelAnalysis } from "@/types/site-finder"; import type { Geometry } from "geojson"; +// MiniMap высота тайла карты — компромисс между плотностью Section 1 и +// читаемостью. Layer-controls/легенда вне этого размера (flow ниже). +const MINIMAP_HEIGHT = 280; + // Lazy-mount to avoid SSR breakage (Leaflet uses window) const SiteMap = dynamic( () => @@ -22,7 +32,7 @@ const SiteMap = dynamic( loading: () => (