diff --git a/src/modules/geoportal/components/map-viewer.tsx b/src/modules/geoportal/components/map-viewer.tsx index 0abee83..3a62c23 100644 --- a/src/modules/geoportal/components/map-viewer.tsx +++ b/src/modules/geoportal/components/map-viewer.tsx @@ -440,28 +440,28 @@ export const MapViewer = forwardRef( map.addLayer({ id: LAYER_IDS.cladiriLine, type: "line", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: 14, paint: { "line-color": "#1e3a5f", "line-width": 0.6 } }); // Building body labels (C1, C2...) — only at high zoom to avoid clutter - map.addLayer({ id: LAYER_IDS.cladiriLabel, type: "symbol", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: 17, + // cadastral_ref format: "77102-C1" → show "C1" + // Uses regex-like approach: if contains "-", show everything after last "-" + map.addLayer({ id: LAYER_IDS.cladiriLabel, type: "symbol", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: 16, + filter: ["all", + ["has", "cadastral_ref"], + ["!=", ["index-of", "-", ["coalesce", ["get", "cadastral_ref"], ""]], -1], + ], layout: { - "text-field": [ - "case", - // Extract body suffix: "77102-C1" → "C1", "77102-C2" → "C2" - ["has", "cadastral_ref"], - ["case", - ["!=", ["index-of", "-C", ["get", "cadastral_ref"]], -1], - ["slice", ["get", "cadastral_ref"], ["+", ["index-of", "-C", ["get", "cadastral_ref"]], 1]], - "" // no "-C" suffix → no label - ], - "" + "text-field": ["slice", + ["coalesce", ["get", "cadastral_ref"], ""], + ["+", ["index-of", "-", ["coalesce", ["get", "cadastral_ref"], ""]], 1], ], "text-font": ["Noto Sans Regular"], - "text-size": 10, + "text-size": 11, "text-anchor": "center", - "text-allow-overlap": false, + "text-allow-overlap": true, + "text-ignore-placement": false, }, paint: { - "text-color": "#1e40af", + "text-color": "#1e3a8a", "text-halo-color": "#ffffff", - "text-halo-width": 1.2, + "text-halo-width": 1.5, }, }); diff --git a/src/modules/parcel-sync/services/enrich-service.ts b/src/modules/parcel-sync/services/enrich-service.ts index f14a502..d2e1ec5 100644 --- a/src/modules/parcel-sync/services/enrich-service.ts +++ b/src/modules/parcel-sync/services/enrich-service.ts @@ -298,6 +298,10 @@ export async function enrichFeatures( if (baseRef) add(baseRef); } + console.log( + `[enrich] siruta=${siruta}: ${terenuri.length} terenuri, ${cladiri.length} cladiri in DB, ${buildingMap.size} chei in buildingMap`, + ); + // ── Fetch immovable list from eTerra ── push({ phase: "Descărcare listă imobile", downloaded: 0 }); const immovableListById = new Map();