feat(parcel-sync): add building status layer to Harta tab (gis_cladiri_status)

Buildings now color-coded on legal status in ParcelSync map view:
- Blue fill: building has legal documents (build_legal = 1)
- Red fill: building without legal documents (build_legal = 0)

Previously only parcels had status coloring; buildings were plain blue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-28 18:53:12 +02:00
parent ee86af6183
commit b46eb7a70f
@@ -363,7 +363,67 @@ export function MapTab({ siruta, sirutaValid, sessionConnected, syncLocalCount,
} }
} }
// Buildings: keep base layer visible with siruta filter (already applied above) // ── Enrichment overlay for BUILDINGS ──
if (!map.getSource("gis_cladiri_status")) {
map.addSource("gis_cladiri_status", {
type: "vector",
tiles: [`${martinBase}/gis_cladiri_status/{z}/{x}/{y}`],
minzoom: 14,
maxzoom: 18,
});
// Data-driven fill: red = no legal docs, blue = has legal docs
map.addLayer(
{
id: "l-ps-cladiri-fill",
type: "fill",
source: "gis_cladiri_status",
"source-layer": "gis_cladiri_status",
minzoom: 14,
filter,
paint: {
"fill-color": [
"case",
["==", ["get", "build_legal"], 1],
"#3b82f6", // blue: legal docs OK
"#ef4444", // red: no legal docs
],
"fill-opacity": 0.55,
},
},
"l-terenuri-fill",
);
map.addLayer(
{
id: "l-ps-cladiri-line",
type: "line",
source: "gis_cladiri_status",
"source-layer": "gis_cladiri_status",
minzoom: 14,
filter,
paint: {
"line-color": [
"case",
["==", ["get", "build_legal"], 1],
"#1e40af", // dark blue: legal
"#b91c1c", // dark red: no legal
],
"line-width": 1.5,
},
},
"l-terenuri-fill",
);
} else {
try {
if (map.getLayer("l-ps-cladiri-fill"))
map.setFilter("l-ps-cladiri-fill", filter);
if (map.getLayer("l-ps-cladiri-line"))
map.setFilter("l-ps-cladiri-line", filter);
} catch {
/* noop */
}
}
}, [mapReady, siruta, sirutaValid]); }, [mapReady, siruta, sirutaValid]);
/* ── Boundary cross-check: load mismatched parcels ─────────── */ /* ── Boundary cross-check: load mismatched parcels ─────────── */