With the site's Mapbox token, the home, pray, adopt and research maps and the static embed pages use Mapbox again, so they look as they did; the two hidden apps keep the keyless MapLibre. NUXT_PUBLIC_MAP_PROVIDER (mapbox or maplibre) puts every map on one engine, and without a token every map starts on MapLibre.
4.3 KiB
Deep Research and Posterverse: the dx-maps output folder dropped into the site
This branch drops the dx-maps output folder into public/dx-maps/ and adds two hidden pages that
show it as full-page apps. Every map on the site loads from that folder, on the site's own origin.
What changes
public/dx-maps/ |
The dx-maps output folder, dropped in unchanged (doxa-maps 53fcf6d09). Every map on the site loads from it. |
app/pages/deep-research/index.vue |
Deep Research (/deep-research): every research map, dashboard and list in one app (<doxa-maps-spa>). A full-page app on every screen: no site header or footer, and the page itself never scrolls. The way back to the site is the app's own Back to homepage button, above Collapse in its menu. |
app/pages/posterverse/index.vue |
Posterverse (/posterverse): the poster plugins in one app (<posterverse-app>), the same full-page way. |
app/pages/research/index.vue |
The Research page keeps its research map. Under it, one new line, "Want Deeper Research? Deep Research app →", links to /deep-research in the reader's language. |
app/composables/useDoxaMap.ts, app/components/DoxaMapSlot.vue, app/utils/mapProvider.ts |
The home (engagement), pray (prayer), adopt and research maps load their bundles from /dx-maps/: the same maps and presets as before. They keep Mapbox with the existing token (see Map engine). |
public/embed/map/index.html, public/research/doxa-research-map.html |
The same: bundles from /dx-maps/. |
nuxt.config.ts |
Old /js/doxa-maps/… addresses redirect to /dx-maps/, and the map settings below. |
i18n/locales/*/common.json |
The new strings, in all 11 languages. |
Unchanged: the regions index, the region and country pages and their maps, the header, the footer and the layout.
public/js/doxa-simple-map.js and public/js/doxa-research-map.js stay in place, unused.
Hidden pages. /deep-research and /posterverse are in no menu, and robots are told not to index them.
/deep-research is reached by the link under the Research page's map; /posterverse by its address.
Language. Both apps follow the site's language (all 11 locales; Arabic lays out right to left). Each app
also has its own language menu (in the phone bar, and at the bottom of the menu on larger screens). A pick
there fires a cancelable doxa-language-request event (event.detail.language). Both pages cancel it and
switch the site's language (the language is in the address, /ar/…), so the site stays the one owner of the
language, and the tab that was open carries over.
Map engine. The site's maps keep Mapbox, with the existing NUXT_PUBLIC_MAPBOX_TOKEN, so they look as
before; the static embed pages ask for Mapbox with the token they fetch, as before. The two hidden apps use
the keyless MapLibre engine. NUXT_PUBLIC_MAP_PROVIDER (mapbox or maplibre) puts every map on one
engine. Without a token every map starts on MapLibre.
Settings (all optional):
NUXT_PUBLIC_DX_MAPS_BASE: load the maps from another copy of the folder (a URL; that host must send CORS headers). Unset = this site's own/dx-maps/.NUXT_PUBLIC_MAP_PROVIDER,NUXT_PUBLIC_MAPBOX_TOKEN: the map engine, as above.NUXT_PUBLIC_PRAY_BASE_URL: the prayer API the maps read people-group data from (defaulthttps://pray.doxa.life).
What comes from elsewhere. The map code and its data folder are this site's own (/dx-maps/). The
MapLibre engine comes from jsDelivr, the base-map tiles from OpenFreeMap and VersaTiles, one dashboard's
country figures from the World Bank API, the people-group data from the prayer API, and the Bible Posters'
Bible text from bible.helloao.org (public-domain translations, credited to ebible.org).
Run it
bun install
bun run dev
Then open /deep-research and /posterverse (Nuxt prints the address). No database or .env is needed for
these pages; without DATABASE_URL the dev server only logs "skipping migrations".
- Arabic:
/ar/deep-research,/ar/posterverse - A specific view:
/deep-research?tab=prayer-map(alsoresearch-map-plus-grid,regions-dashboard,upg-100, …),/posterverse?tab=country-posters
Updating the maps
Replace public/dx-maps/ with the public/dx-maps/ folder of a newer doxa-maps build. No page needs to change.