"use client"; /** * V2Map — the cockpit map card. Reuses the existing rich Leaflet plumbing * (PticaMapInner — parcel polygon, POI / ЖК / pipeline glyph pins, ЗОУИТ zones, * connection-point lines, custom POI, dark/satellite tiles) via a SINGLE shared * implementation loaded through dynamic(ssr:false) so Leaflet never touches the * server. Connection points + custom POIs are fetched here (same TanStack hooks * as PticaMap) and threaded into the inner map. * * The inner map brings its own overlay/legend/controls + base-layer toggle * (Спутник | Схема) and dark CartoDB tiles, matching the prototype map block. * The map title chip is rendered here over the card per the prototype `.map-head`. */ import dynamic from "next/dynamic"; import styles from "@/app/site-finder/analysis/[cad]/v2/v2.module.css"; import type { ParcelAnalysis } from "@/types/site-finder"; import { useConnectionPoints } from "@/hooks/useConnectionPoints"; import { useCustomPois } from "@/hooks/useCustomPois"; import { V2MapLegend } from "@/components/site-finder/ptica-v2/V2MapLegend"; const PticaMapInner = dynamic( () => import("@/components/site-finder/ptica/PticaMapInner"), { ssr: false, loading: () =>
Загрузка карты…
, }, ); interface Props { analysis: ParcelAnalysis; } export function V2Map({ analysis }: Props) { const cad = analysis.cad_num; const { data: connectionPoints } = useConnectionPoints(cad); const { data: customPois } = useCustomPois(cad); return (
{/* Map title — text differs per theme; only one span is shown at a time via the [data-theme="..."] selectors in v2.module.css (mirrors the prototype `.tnum-d` / `.tnum-l` toggle pattern). */}
СПУТНИК · СВЕЖИЙ СНИМОК СПУТНИК · СХЕМА ПОДКЛЮЧЕНИЙ
{/* Resource legend overlay (sibling of PticaMapInner, sits on top of the map via absolute positioning — does not touch the shared inner map). */}
); }