diff --git a/internal/generate-tree.mjs b/internal/generate-tree.mjs index ba81419fa..e5f37c57a 100644 --- a/internal/generate-tree.mjs +++ b/internal/generate-tree.mjs @@ -1519,6 +1519,12 @@ function main() { // for maps that colour every state. The curated file above is UPG-100's 34-unit partition. [resolve(__dirname, '..', 'data', 'boundaries', 'gb-IND-ADM1-full.geojson'), 'gb-IND-ADM1-full.geojson'], [resolve(__dirname, '..', 'data', 'boundaries', 'gb-IND-ADM1-full.meta.json'), 'gb-IND-ADM1-full.meta.json'], + // WEB copies (library/scripts/boundaries/build-web-boundaries.mjs): every feature and island kept, about + // a fifth of the bytes. The interactive maps fetch these; posters, print and build-time point-in-polygon + // keep the full files above (REPORT-WEB-BOUNDARIES.md). + [join(dataDir, 'adm0', 'world-adm0-web.geojson'), 'world-adm0-web.geojson'], + [join(dataDir, 'gb-IND-ADM1-web.geojson'), 'gb-IND-ADM1-web.geojson'], + [resolve(__dirname, '..', 'data', 'boundaries', 'gb-IND-ADM1-full-web.geojson'), 'gb-IND-ADM1-full-web.geojson'], ]) if (existsSync(from)) cpSync(from, join(bDir, to)) console.log('[generate-tree] gathered boundary geojson') @@ -1579,6 +1585,9 @@ function main() { 'boundaries/gb-CHN-ADM1.geojson', 'boundaries/gb-IND-ADM1-full.geojson', // all 36 states (Cities with Internet's NFHS layer) 'boundaries/gb-IND-ADM1-full.meta.json', // its source and licence, served beside it + 'boundaries/world-adm0-web.geojson', // the web copies the interactive maps fetch + 'boundaries/gb-IND-ADM1-web.geojson', + 'boundaries/gb-IND-ADM1-full-web.geojson', // people-groups — all-people-groups.vue (the slim JSON only; NOT the 16 MB CSV, // which no element fetches and which dropin.exclude already withholds). 'people-groups/people-groups-slim.json', diff --git a/library/composables/useCountryOutline.js b/library/composables/useCountryOutline.js index 6f514ebad..f3095e22f 100644 --- a/library/composables/useCountryOutline.js +++ b/library/composables/useCountryOutline.js @@ -161,7 +161,7 @@ export function useCountryOutline(getMap, opts = {}) { // Add EMPTY first, then setData after the fetch, so addLayer below stays SYNCHRONOUS and // the outline keeps its place in the layer order. m.addSource(SOURCE_ID, { type: 'geojson', data: { type: 'FeatureCollection', features: [] } }) - fetch(`${resolveAssetsBase(null)}/boundaries/world-adm0.geojson`) + fetch(`${resolveAssetsBase(null)}/boundaries/world-adm0-web.geojson`) .then((r) => r.json()) .then((gj) => { // The tileset names the ISO field iso_3166_1_alpha_3; the geojson names it iso3. diff --git a/library/composables/useMapLayers.js b/library/composables/useMapLayers.js index d5000f7e2..ab1af0f7e 100644 --- a/library/composables/useMapLayers.js +++ b/library/composables/useMapLayers.js @@ -434,7 +434,7 @@ export function useMapLayers(options = {}) { // EMPTY first so the addLayer below stays synchronous and keeps its z-order slot // (regions → shadow → pins → hitbox); setData once the fetch lands. map.addSource('regions', { type: 'geojson', data: { type: 'FeatureCollection', features: [] } }); - fetch(`${resolveAssetsBase(null)}/boundaries/world-adm0.geojson`) + fetch(`${resolveAssetsBase(null)}/boundaries/world-adm0-web.geojson`) .then((r) => r.json()) .then((gj) => { // Tileset field is iso_3166_1_alpha_3; the geojson's is iso3. Normalise ONCE diff --git a/plugin-designs/cities-internet/connectivity-map.vue b/plugin-designs/cities-internet/connectivity-map.vue index d4e0f6874..c4ac0d2e4 100644 --- a/plugin-designs/cities-internet/connectivity-map.vue +++ b/plugin-designs/cities-internet/connectivity-map.vue @@ -239,7 +239,7 @@ async function load() { // review caught it as "India seems to have no internet coverage". The fix was a // second file, world-adm0-plus.geojson; that file is gone and India is fetched // at ADM0 like every other country (data/source-boundaries.mjs). - fetch(`${assetsBase.value}/boundaries/world-adm0.geojson`).then((r) => r.json()), + fetch(`${assetsBase.value}/boundaries/world-adm0-web.geojson`).then((r) => r.json()), ]) rows.value = data.countries || [] return adm0 @@ -304,7 +304,7 @@ async function loadAdm1() { fetch(`${assetsBase.value}/tables/internet-by-adm1.json`).then((r) => { if (!r.ok) throw new Error('internet-by-adm1 ' + r.status); return r.json() }), // All 36 states (data/boundaries/gb-IND-ADM1-full.geojson). NOT gb-IND-ADM1.geojson: that one is // UPG-100's partition, curated to 34 units, and it left Mizoram and Nagaland with no geometry. - fetch(`${assetsBase.value}/boundaries/gb-IND-ADM1-full.geojson`).then((r) => { if (!r.ok) throw new Error('gb-IND-ADM1-full ' + r.status); return r.json() }), + fetch(`${assetsBase.value}/boundaries/gb-IND-ADM1-full-web.geojson`).then((r) => { if (!r.ok) throw new Error('gb-IND-ADM1-full ' + r.status); return r.json() }), ]) const byArea = {} for (const r of table.rows || []) { diff --git a/plugin-designs/gospel-resources/resources-map.vue b/plugin-designs/gospel-resources/resources-map.vue index 09f39a8f8..e2d3793f3 100644 --- a/plugin-designs/gospel-resources/resources-map.vue +++ b/plugin-designs/gospel-resources/resources-map.vue @@ -1114,7 +1114,7 @@ async function load() { // review caught it as "India seems to have no internet coverage". The fix was a // second file, world-adm0-plus.geojson; that file is gone and India is fetched // at ADM0 like every other country (data/source-boundaries.mjs). - fetch(`${assetsBase.value}/boundaries/world-adm0.geojson`).then((r) => r.json()), + fetch(`${assetsBase.value}/boundaries/world-adm0-web.geojson`).then((r) => r.json()), // 650KB and it is the point of the map, so it loads with the boundaries rather // than behind a tap. URLs are normalised into `codes` by ISO 639-3, so the 12,379 // pins carry a code rather than 12,379 copies of the same jesusfilm.org link. @@ -1270,7 +1270,7 @@ async function ensureProvinceTable() { return provinceRows.value } -const PROVINCE_FILE = { IND: 'gb-IND-ADM1-full.geojson', CHN: 'gb-CHN-ADM1.geojson' } +const PROVINCE_FILE = { IND: 'gb-IND-ADM1-full-web.geojson', CHN: 'gb-CHN-ADM1.geojson' } async function ensureProvinces(iso3) { const map = mapRef.value diff --git a/plugin-designs/my-upg-100-list/upg-100-list.vue b/plugin-designs/my-upg-100-list/upg-100-list.vue index 21472cddf..631ab14eb 100644 --- a/plugin-designs/my-upg-100-list/upg-100-list.vue +++ b/plugin-designs/my-upg-100-list/upg-100-list.vue @@ -2210,10 +2210,10 @@ onMounted(async () => { // and it overlapped nothing: a promise created after an await starts only once that await // resolves, so the code read as parallel and behaved strictly serially. const boundaryPromises = { - adm0: getJSON('world-adm0.geojson'), + adm0: getJSON('world-adm0-web.geojson'), adm1Chn: getJSON('gb-CHN-ADM1.geojson'), // 1,628 KB, and only the India pg_slugs zones need it. - adm1Ind: getJSON('gb-IND-ADM1.geojson'), + adm1Ind: getJSON('gb-IND-ADM1-web.geojson'), } // ── live records WITH rop1 + population (full record; LESSON L3 / slice 04u) ── diff --git a/plugin-designs/regions-dashboard/src/RegionCountryMap.vue b/plugin-designs/regions-dashboard/src/RegionCountryMap.vue index be0289c45..18cbe726f 100644 --- a/plugin-designs/regions-dashboard/src/RegionCountryMap.vue +++ b/plugin-designs/regions-dashboard/src/RegionCountryMap.vue @@ -274,7 +274,7 @@ function addLayers() { // Add EMPTY first, then setData after the fetch: the addLayer calls below must run // SYNCHRONOUSLY to keep these fills beneath the pins (layer order is insertion order). m.addSource(SRC_COUNTRIES, { type: 'geojson', data: { type: 'FeatureCollection', features: [] } }) - fetch(`${resolveAssetsBase(profileConfig?.value)}/boundaries/world-adm0.geojson`) + fetch(`${resolveAssetsBase(profileConfig?.value)}/boundaries/world-adm0-web.geojson`) .then((r) => r.json()) .then((gj) => { for (const f of gj.features || []) { diff --git a/plugin-designs/research-dashboard/src/components/dashboards/DashboardMapPanel.vue b/plugin-designs/research-dashboard/src/components/dashboards/DashboardMapPanel.vue index ec35de367..8bca847d5 100644 --- a/plugin-designs/research-dashboard/src/components/dashboards/DashboardMapPanel.vue +++ b/plugin-designs/research-dashboard/src/components/dashboards/DashboardMapPanel.vue @@ -834,7 +834,7 @@ function addLayers() { // keep this layer underneath the pins (layer order is insertion order). An awaited fetch // here would put the choropleth on TOP of every bubble. m.addSource('rd-countries', { type: 'geojson', data: { type: 'FeatureCollection', features: [] } }) - fetch(`${resolveAssetsBase(profileConfig.value)}/boundaries/world-adm0.geojson`) + fetch(`${resolveAssetsBase(profileConfig.value)}/boundaries/world-adm0-web.geojson`) .then((r) => r.json()) .then((gj) => { for (const f of gj.features || []) {