From c534781bac98ec4de56da7c3a57ebcf387dc0e79 Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 00:38:15 +0000 Subject: [PATCH] MapLibre region fills drew nothing: the worldview clause filtered out every feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rega measured it by eye at b0cd3140 on the built tree: regions-mfe under ?provider=maplibre draws the basemap and 2,107 pins, the boundary geojson returns 200, and the fill layer holds 0 features. Mapbox draws 156. A filter that admits nothing looks exactly like data that never arrived. countryFilter() is two clauses ANDed. The ISO half was fine — the field bridge three lines above it already copies iso3 -> iso_3166_1_alpha_3 onto every geojson feature before setData, so one name is read everywhere. The WORLDVIEW half has no bridge and cannot have one: it exists because the Mapbox tileset repeats a country once per worldview and the highlight would otherwise draw two or three times over. The geojson has no such duplication and carries no worldview property at all, so both sides of the `any` were false on every feature and the `all` emptied the layer. It is Mapbox-only, not something to translate, so MapLibre now gets the ISO clause alone. I NEARLY FIXED THE WRONG HALF. Reading the RAW geojson I saw { iso3, shapeGroup, shapeName }, concluded the ISO key was wrong too, and branched it — adding a second name for a fact the bridge already normalises. The bridge was three lines above the filter I was editing. Reverted; the ISO clause is untouched. Proven headless, fail-first, by EVALUATING both filters against the real 162 features with MapLibre's own parser after applying the bridge: OLD filter admits 0 / 162 <- rega's bug, reproduced without a browser NEW filter admits 14 / 14 <- every requested country Mapbox path unchanged: still 14/14, and still drops a duplicate worldview copy The control asserts the OLD filter still admits 0, so the check reports when it has stopped demonstrating the bug it was written for. Needs eyes: rega to re-shoot row 13 on this sha. --- .../regions-dashboard/src/RegionCountryMap.vue | 18 ++++++++++++++---- public/dx-maps/doxa-maps-spa/manifest.json | 8 ++++---- public/dx-maps/manifest.json | 8 ++++---- .../region-dashboards/index.html | 2 +- .../regions-dashboard/regions-dashboard.js | 2 +- .../regions-dashboard/regions-list/index.html | 2 +- .../regions-dashboard/regions-mfe/index.html | 2 +- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/plugin-designs/regions-dashboard/src/RegionCountryMap.vue b/plugin-designs/regions-dashboard/src/RegionCountryMap.vue index c39b78508..82442bc4a 100644 --- a/plugin-designs/regions-dashboard/src/RegionCountryMap.vue +++ b/plugin-designs/regions-dashboard/src/RegionCountryMap.vue @@ -191,10 +191,20 @@ const SRC_PINS = 'rcm-people-groups' const SRC_COUNTRIES = 'rcm-country-boundaries' function countryFilter() { - // CountryMap.vue:187-191. The country-boundaries tileset carries one feature PER WORLDVIEW, so - // without this the highlight is drawn two or three times over. - return ['all', - ['in', ['get', 'iso_3166_1_alpha_3'], ['literal', props.countryCodes]], + // CountryMap.vue:187-191. The ISO half needs no branch: THE FIELD BRIDGE above already copies + // iso3 -> iso_3166_1_alpha_3 onto every geojson feature before setData, so one name is read + // everywhere. I nearly added a second name for that one fact, having read the RAW file instead of + // the data as loaded — the bridge was three lines above the filter. + // + // ★ THE WORLDVIEW HALF IS THE BUG, and it has no bridge. The TILESET repeats a country once per + // worldview, so without this clause the highlight draws two or three times over. The geojson has + // no such duplication and carries NO worldview property at all, so both sides of the `any` are + // false on every feature and the `all` excluded the entire layer. rega measured it by eye at + // b0cd3140: source 200, basemap and 2,107 pins drawn, 0 features in the fill layer, while Mapbox + // drew 156. Mapbox-only, not a thing to translate. + const byCode = ['in', ['get', 'iso_3166_1_alpha_3'], ['literal', props.countryCodes]] + if (isMaplibreProvider) return byCode + return ['all', byCode, ['any', ['==', ['get', 'worldview'], 'all'], ['in', 'US', ['get', 'worldview']]]] } diff --git a/public/dx-maps/doxa-maps-spa/manifest.json b/public/dx-maps/doxa-maps-spa/manifest.json index 2a7183634..3ea93583f 100644 --- a/public/dx-maps/doxa-maps-spa/manifest.json +++ b/public/dx-maps/doxa-maps-spa/manifest.json @@ -888,7 +888,7 @@ "bundle": "regions-dashboard", "scriptUrl": "./regions-dashboard/regions-dashboard.js", "output": "dx-maps/regions-dashboard/regions-dashboard.js", - "integrity": "sha384-lpzd66s+yTDop/akosXlKIXuiOCv3r2RMUOWBcj217m3HvxSQ2UtPHIHqx4xwVAK", + "integrity": "sha384-7KtEO1Ri7x+mY3JmOY+ZFWt1nH424T6sjIO2slg93jtxmoGmkzFY+0MjgQB46xyY", "elements": [ "regions-dashboard" ], @@ -908,7 +908,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } }, { @@ -922,7 +922,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" } }, { @@ -936,7 +936,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } } ] diff --git a/public/dx-maps/manifest.json b/public/dx-maps/manifest.json index 2a7183634..3ea93583f 100644 --- a/public/dx-maps/manifest.json +++ b/public/dx-maps/manifest.json @@ -888,7 +888,7 @@ "bundle": "regions-dashboard", "scriptUrl": "./regions-dashboard/regions-dashboard.js", "output": "dx-maps/regions-dashboard/regions-dashboard.js", - "integrity": "sha384-lpzd66s+yTDop/akosXlKIXuiOCv3r2RMUOWBcj217m3HvxSQ2UtPHIHqx4xwVAK", + "integrity": "sha384-7KtEO1Ri7x+mY3JmOY+ZFWt1nH424T6sjIO2slg93jtxmoGmkzFY+0MjgQB46xyY", "elements": [ "regions-dashboard" ], @@ -908,7 +908,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } }, { @@ -922,7 +922,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n" + "script": "\n\n" } }, { @@ -936,7 +936,7 @@ "scriptUrl": "./regions-dashboard/regions-dashboard.js", "embed": { "iframe": "", - "script": "\n\n\n\n" + "script": "\n\n\n\n" } } ] diff --git a/public/dx-maps/regions-dashboard/region-dashboards/index.html b/public/dx-maps/regions-dashboard/region-dashboards/index.html index f476ea78d..2399ba080 100644 --- a/public/dx-maps/regions-dashboard/region-dashboards/index.html +++ b/public/dx-maps/regions-dashboard/region-dashboards/index.html @@ -30,7 +30,7 @@ - + - + - +