A public preview plugin for the whole-India poster: every India people group on one printable sheet, generated live from the current data (nothing stored) and shown as its printable sheets with the glue strips. Each poster carries the blessing — header "Bless India in Jesus' name" and the Aaronic blessing (Numbers 6:24-26), switchable. Generates with the plugin's own copy of the renderer; shows the sheets via the shared PanelSheets and prints as a document at true size. Public and experimental; a phone sees the preview but Print is blocked (desktop only) until a design is proven phone-safe. Registers the blessIndia poster type for the catalogue; label translated in 11 locales. Replaces the earlier India Posters review draft (not landed). Element <bless-india-posters>.
22 lines
1,009 B
JavaScript
22 lines
1,009 B
JavaScript
/**
|
|
* boundaries.js — fetch the India boundary geojson the generator draws on, from the served tree.
|
|
* Cached per base, so re-generating (a size switch, a re-render) costs one fetch. The generator only
|
|
* needs India's own ADM0 feature + its ADM1 states + place labels; we fetch the tree files and the
|
|
* generator filters India out of ADM0 itself.
|
|
*/
|
|
const cache = new Map()
|
|
|
|
export function loadBoundaries(assetsBase) {
|
|
const base = String((typeof assetsBase === 'function' ? assetsBase() : assetsBase) || './assets').replace(/\/$/, '')
|
|
if (cache.has(base)) return cache.get(base)
|
|
const b = `${base}/boundaries`
|
|
const p = Promise.all([
|
|
fetch(`${b}/world-adm0.geojson`).then((r) => r.json()),
|
|
fetch(`${b}/gb-IND-ADM1.geojson`).then((r) => r.json()),
|
|
fetch(`${b}/ne-places.json`).then((r) => r.json()).catch(() => ({ places: [] })),
|
|
]).then(([adm0, adm1Ind, ne]) => ({
|
|
adm0, adm1Ind, nePlaces: Array.isArray(ne) ? ne : (ne.places || []),
|
|
}))
|
|
cache.set(base, p)
|
|
return p
|
|
}
|