perf(geoportal): extend PMTiles to z18 — eliminate Martin for terenuri/cladiri entirely

PMTiles now covers z0-z18 (full zoom range). Martin sources kept only for
selection highlight and fallback when PMTiles not configured.
All terenuri/cladiri fill/line/label layers served from PMTiles when active.
Zero PostGIS load for tile rendering at any zoom level.

File will be ~1-2 GB but eliminates all cold-load latency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-28 17:23:04 +02:00
parent c269d8b296
commit 870e1bd4c2
2 changed files with 29 additions and 27 deletions
+2 -2
View File
@@ -83,8 +83,8 @@ tippecanoe \
--named-layer=gis_terenuri:terenuri_overview.fgb \
--named-layer=gis_cladiri:cladiri_overview.fgb \
--minimum-zoom=0 \
--maximum-zoom=16 \
--base-zoom=16 \
--maximum-zoom=18 \
--base-zoom=18 \
--drop-densest-as-needed \
--detect-shared-borders \
--simplification=10 \
+18 -16
View File
@@ -467,13 +467,12 @@ export const MapViewer = forwardRef<MapViewerHandle, MapViewerProps>(
// === Terenuri (parcels) ===
if (usePmtiles) {
// PMTiles serves z13-z16 (pre-generated, instant), Martin only z17-z18 (close detail)
map.addLayer({ id: "l-terenuri-pm-fill", type: "fill", source: "overview-pmtiles", "source-layer": SOURCES.terenuri, minzoom: 13, maxzoom: 17,
// PMTiles serves ALL zoom levels (z13-z18) — zero PostGIS load
map.addLayer({ id: "l-terenuri-pm-fill", type: "fill", source: "overview-pmtiles", "source-layer": SOURCES.terenuri, minzoom: 13,
paint: { "fill-color": "#22c55e", "fill-opacity": 0.15 } });
map.addLayer({ id: "l-terenuri-pm-line", type: "line", source: "overview-pmtiles", "source-layer": SOURCES.terenuri, minzoom: 13, maxzoom: 17,
map.addLayer({ id: "l-terenuri-pm-line", type: "line", source: "overview-pmtiles", "source-layer": SOURCES.terenuri, minzoom: 13,
paint: { "line-color": "#15803d", "line-width": 0.8 } });
// PMTiles labels z16 (cadastral_ref available in PMTiles)
map.addLayer({ id: "l-terenuri-pm-label", type: "symbol", source: "overview-pmtiles", "source-layer": SOURCES.terenuri, minzoom: 16, maxzoom: 17,
map.addLayer({ id: "l-terenuri-pm-label", type: "symbol", source: "overview-pmtiles", "source-layer": SOURCES.terenuri, minzoom: 16,
layout: {
"text-field": ["coalesce", ["get", "cadastral_ref"], ""],
"text-font": ["Noto Sans Regular"],
@@ -481,15 +480,15 @@ export const MapViewer = forwardRef<MapViewerHandle, MapViewerProps>(
"text-max-width": 8,
},
paint: { "text-color": "#166534", "text-halo-color": "#fff", "text-halo-width": 1 } });
// Martin source kept for selection highlight (no minzoom layer means no tile requests)
map.addSource(SOURCES.terenuri, { type: "vector", tiles: [`${m}/${SOURCES.terenuri}/{z}/{x}/{y}`], minzoom: 17, maxzoom: 18 });
} else {
map.addSource(SOURCES.terenuri, { type: "vector", tiles: [`${m}/${SOURCES.terenuri}/{z}/{x}/{y}`], minzoom: 10, maxzoom: 18 });
}
map.addLayer({ id: LAYER_IDS.terenuriFill, type: "fill", source: SOURCES.terenuri, "source-layer": SOURCES.terenuri, minzoom: usePmtiles ? 17 : 13,
map.addLayer({ id: LAYER_IDS.terenuriFill, type: "fill", source: SOURCES.terenuri, "source-layer": SOURCES.terenuri, minzoom: 13,
paint: { "fill-color": "#22c55e", "fill-opacity": 0.15 } });
map.addLayer({ id: LAYER_IDS.terenuriLine, type: "line", source: SOURCES.terenuri, "source-layer": SOURCES.terenuri, minzoom: usePmtiles ? 17 : 13,
map.addLayer({ id: LAYER_IDS.terenuriLine, type: "line", source: SOURCES.terenuri, "source-layer": SOURCES.terenuri, minzoom: 13,
paint: { "line-color": "#15803d", "line-width": 0.8 } });
map.addLayer({ id: LAYER_IDS.terenuriLabel, type: "symbol", source: SOURCES.terenuri, "source-layer": SOURCES.terenuri, minzoom: usePmtiles ? 17 : 16,
map.addLayer({ id: LAYER_IDS.terenuriLabel, type: "symbol", source: SOURCES.terenuri, "source-layer": SOURCES.terenuri, minzoom: 16,
layout: {
"text-field": ["coalesce", ["get", "cadastral_ref"], ""],
"text-font": ["Noto Sans Regular"],
@@ -497,24 +496,27 @@ export const MapViewer = forwardRef<MapViewerHandle, MapViewerProps>(
"text-max-width": 8,
},
paint: { "text-color": "#166534", "text-halo-color": "#fff", "text-halo-width": 1 } });
}
// === Cladiri (buildings) ===
if (usePmtiles) {
// PMTiles serves z14-z16, Martin only z17-z18
map.addLayer({ id: "l-cladiri-pm-fill", type: "fill", source: "overview-pmtiles", "source-layer": SOURCES.cladiri, minzoom: 14, maxzoom: 17,
// PMTiles serves ALL zoom levels (z14-z18) — zero PostGIS load
map.addLayer({ id: "l-cladiri-pm-fill", type: "fill", source: "overview-pmtiles", "source-layer": SOURCES.cladiri, minzoom: 14,
paint: { "fill-color": "#3b82f6", "fill-opacity": 0.5 } });
map.addLayer({ id: "l-cladiri-pm-line", type: "line", source: "overview-pmtiles", "source-layer": SOURCES.cladiri, minzoom: 14, maxzoom: 17,
map.addLayer({ id: "l-cladiri-pm-line", type: "line", source: "overview-pmtiles", "source-layer": SOURCES.cladiri, minzoom: 14,
paint: { "line-color": "#1e3a5f", "line-width": 0.6 } });
map.addSource(SOURCES.cladiri, { type: "vector", tiles: [`${m}/${SOURCES.cladiri}/{z}/{x}/{y}`], minzoom: 17, maxzoom: 18 });
} else {
map.addSource(SOURCES.cladiri, { type: "vector", tiles: [`${m}/${SOURCES.cladiri}/{z}/{x}/{y}`], minzoom: 12, maxzoom: 18 });
}
map.addLayer({ id: LAYER_IDS.cladiriFill, type: "fill", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: usePmtiles ? 17 : 14,
map.addLayer({ id: LAYER_IDS.cladiriFill, type: "fill", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: 14,
paint: { "fill-color": "#3b82f6", "fill-opacity": 0.5 } });
map.addLayer({ id: LAYER_IDS.cladiriLine, type: "line", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: usePmtiles ? 17 : 14,
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 — extract suffix after last dash (e.g. "291479-C1" → "C1")
map.addLayer({ id: LAYER_IDS.cladiriLabel, type: "symbol", source: SOURCES.cladiri, "source-layer": SOURCES.cladiri, minzoom: 16,
map.addLayer({ id: LAYER_IDS.cladiriLabel, type: "symbol",
source: usePmtiles ? "overview-pmtiles" : SOURCES.cladiri,
"source-layer": SOURCES.cladiri, minzoom: 16,
layout: {
"text-field": [
"case",