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.
This commit is contained in:
Doxa Maps 2026-09-26 12:14:42 +00:00
parent 64568ba685
commit ff99c2d27e
3 changed files with 15 additions and 0 deletions

View file

@ -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.

View file

@ -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

View file

@ -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.