fix(portal): build error + simple feature panel without enrichment/CF
Fixed: - Added setLayoutProperty to MapLike type (was missing, broke build) - Replaced FeatureInfoPanel with simple inline panel showing only: SIRUTA, Nr. cadastral, Suprafata (no enrichment, no CF extract, no "Actualizeaza" button) - Fixed unknown type errors in JSX property access - Hidden basemap boundaries + UAT layers for cleaner map Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -43,7 +43,7 @@ import {
|
|||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { cn } from "@/shared/lib/utils";
|
import { cn } from "@/shared/lib/utils";
|
||||||
import { SelectionToolbar, type SelectionMode } from "@/modules/geoportal/components/selection-toolbar";
|
import { SelectionToolbar, type SelectionMode } from "@/modules/geoportal/components/selection-toolbar";
|
||||||
import { FeatureInfoPanel } from "@/modules/geoportal/components/feature-info-panel";
|
// Simple inline feature panel — no enrichment, no CF extract
|
||||||
import type { MapViewerHandle } from "@/modules/geoportal/components/map-viewer";
|
import type { MapViewerHandle } from "@/modules/geoportal/components/map-viewer";
|
||||||
import type {
|
import type {
|
||||||
BasemapId,
|
BasemapId,
|
||||||
@@ -1126,6 +1126,7 @@ type MapLike = {
|
|||||||
getLayer(id: string): unknown;
|
getLayer(id: string): unknown;
|
||||||
getSource(id: string): unknown;
|
getSource(id: string): unknown;
|
||||||
setFilter(id: string, filter: unknown[] | null): void;
|
setFilter(id: string, filter: unknown[] | null): void;
|
||||||
|
setLayoutProperty(id: string, prop: string, value: unknown): void;
|
||||||
fitBounds(
|
fitBounds(
|
||||||
bounds: [number, number, number, number],
|
bounds: [number, number, number, number],
|
||||||
opts?: Record<string, unknown>,
|
opts?: Record<string, unknown>,
|
||||||
@@ -1478,11 +1479,50 @@ function HartaContent() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Top-right: basemap switcher + feature panel */}
|
{/* Top-right: basemap switcher + simple feature info */}
|
||||||
<div className="absolute top-3 right-3 z-10 flex flex-col items-end gap-2">
|
<div className="absolute top-3 right-3 z-10 flex flex-col items-end gap-2">
|
||||||
<PortalBasemapSwitcher value={basemap} onChange={setBasemap} />
|
<PortalBasemapSwitcher value={basemap} onChange={setBasemap} />
|
||||||
{clickedFeature && selectionMode === "off" && (
|
{clickedFeature && selectionMode === "off" && (
|
||||||
<FeatureInfoPanel feature={clickedFeature} onClose={() => setClickedFeature(null)} />
|
<div className="bg-background/95 backdrop-blur-sm border rounded-lg shadow-lg w-64 overflow-hidden">
|
||||||
|
<div className="flex items-center justify-between px-3 py-2 border-b">
|
||||||
|
<h3 className="text-sm font-semibold truncate">
|
||||||
|
{String(clickedFeature.properties.cadastral_ref ?? clickedFeature.properties.object_id ?? "Parcela")}
|
||||||
|
</h3>
|
||||||
|
<Button variant="ghost" size="sm" className="h-6 w-6 p-0 shrink-0" onClick={() => setClickedFeature(null)}>
|
||||||
|
<span className="text-xs">✕</span>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<div className="px-3 py-2 text-xs space-y-1">
|
||||||
|
{(() => {
|
||||||
|
const p = clickedFeature.properties;
|
||||||
|
const sir = String(p.siruta ?? "");
|
||||||
|
const cad = String(p.cadastral_ref ?? "");
|
||||||
|
const area = Number(p.area_value ?? 0);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{sir && (
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-muted-foreground">SIRUTA</span>
|
||||||
|
<span className="font-medium">{sir}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{cad && (
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-muted-foreground">Nr. cadastral</span>
|
||||||
|
<span className="font-medium">{cad}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{area > 0 && (
|
||||||
|
<div className="flex justify-between">
|
||||||
|
<span className="text-muted-foreground">Suprafata</span>
|
||||||
|
<span className="font-medium">{area.toLocaleString("ro-RO")} mp</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user