From ff99c2d27eef58a219c1efe2736a7261be63f8ef Mon Sep 17 00:00:00 2001 From: Doxa Maps Date: Sat, 26 Sep 2026 12:14:42 +0000 Subject: [PATCH] PPLR data maps: the map boots in the projection its button says The three map views ask for projection:'mercator' at construction, but on Mapbox the style's own projection (globe) wins, so the map booted as a globe while the view's state and button said Mercator, and the first "Switch to Globe" click did nothing (rega, C2 at 0f136d25: pre/post-mapbox logs, "proj globe -> globe"). The existing setProjectionFor ran only after a basemap switch, never at boot. Each view's 'load' handler (religion, rop-tree, language-families) now applies the state's projection first; the style is ready there on both engines. Headless, against a map whose style projection is globe: before, the map is globe while the state is mercator; after, both are mercator. --- .../pplr-data-maps/src/views/pplr-language-families.vue | 5 +++++ plugin-designs/pplr-data-maps/src/views/pplr-religion.vue | 5 +++++ plugin-designs/pplr-data-maps/src/views/pplr-rop-tree.vue | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/plugin-designs/pplr-data-maps/src/views/pplr-language-families.vue b/plugin-designs/pplr-data-maps/src/views/pplr-language-families.vue index c6d8ed176..b18151d78 100644 --- a/plugin-designs/pplr-data-maps/src/views/pplr-language-families.vue +++ b/plugin-designs/pplr-data-maps/src/views/pplr-language-families.vue @@ -434,6 +434,11 @@ onMounted(async () => { map.value.addControl(new FullscreenToggleControl(profileRoot.value), 'bottom-right') } map.value.on('load', async () => { + // The constructor's projection:'mercator' is only a request: on Mapbox the style's own projection + // (globe) wins, so the map booted as a globe while this view's state and button said Mercator, and + // the first "Switch to Globe" click did nothing (rega, C2). The style is ready here, on both + // engines, so apply the state to the map. + setProjectionFor(map.value, projection.value) try { // Shift logical center right of the 380px legend so the globe / pin // density isn't hidden behind the column. diff --git a/plugin-designs/pplr-data-maps/src/views/pplr-religion.vue b/plugin-designs/pplr-data-maps/src/views/pplr-religion.vue index 715d611c0..98a81432b 100644 --- a/plugin-designs/pplr-data-maps/src/views/pplr-religion.vue +++ b/plugin-designs/pplr-data-maps/src/views/pplr-religion.vue @@ -252,6 +252,11 @@ onMounted(async () => { map.value.addControl(new FullscreenToggleControl(profileRoot.value), 'bottom-right') } map.value.on('load', async () => { + // The constructor's projection:'mercator' is only a request: on Mapbox the style's own projection + // (globe) wins, so the map booted as a globe while this view's state and button said Mercator, and + // the first "Switch to Globe" click did nothing (rega, C2). The style is ready here, on both + // engines, so apply the state to the map. + setProjectionFor(map.value, projection.value) try { // Legend now sits top-left under the search bar (~320px wide). Shift the // logical center right of that column so the world / globe isn't drawn diff --git a/plugin-designs/pplr-data-maps/src/views/pplr-rop-tree.vue b/plugin-designs/pplr-data-maps/src/views/pplr-rop-tree.vue index b20473208..47a0e2c2e 100644 --- a/plugin-designs/pplr-data-maps/src/views/pplr-rop-tree.vue +++ b/plugin-designs/pplr-data-maps/src/views/pplr-rop-tree.vue @@ -410,6 +410,11 @@ onMounted(async () => { treeData.value = await treeResp.json() map.value.on('load', async () => { + // The constructor's projection:'mercator' is only a request: on Mapbox the style's own projection + // (globe) wins, so the map booted as a globe while this view's state and button said Mercator, and + // the first "Switch to Globe" click did nothing (rega, C2). The style is ready here, on both + // engines, so apply the state to the map. + setProjectionFor(map.value, projection.value) try { // Globe centering: shift the map's logical center right of the legend // so the globe doesn't render beneath the 380px legend column.