Country posters: "Export poster…" opens the dialog again

countries-map mounted <PosterDialog v-if="showPoster"> with :poster and :active-tab, props the
dialog does not declare, and without v-model or getMap. PosterDialog shows only while its
modelValue is true, so the button opened nothing, on both engines. It now passes v-model and a
getMap accessor, and unwraps the legend-rows ref. loadPoster() also called useMapPoster with an
options object; useMapPoster(getSourceMap) takes the map accessor. Headless: the bundle builds.
needs eyes: country-posters map > menu > Export poster… shows the dialog, and Render downloads.
This commit is contained in:
Doxa Maps 2026-09-25 23:59:07 +00:00
parent 295e6a7909
commit 0d2f83c9f8

View file

@ -101,11 +101,8 @@ function _syncHitboxFilter(m, filter) {
function loadPoster() {
if (!_posterPromise) {
_posterPromise = import('@map/composables/poster/useMapPoster.js')
.then(m => m.useMapPoster({
sourceMap: () => map.value,
mapboxToken: mapboxToken.value,
styleUrl: () => map.value?.getStyle()?.sprite?.replace(/\/sprite.*$/, '') || profileConfig?.value?.style
}))
// useMapPoster(getSourceMap) takes the map ACCESSOR, not an options object
.then(m => m.useMapPoster(() => map.value))
}
return _posterPromise
}
@ -2229,12 +2226,15 @@ onBeforeUnmount(() => {
/>
<!-- Poster export modal -->
<!-- PosterDialog's contract is v-model (visibility) + a getMap ACCESSOR. This passed :poster /
:active-tab (props it does not declare) and neither of those, so its own v-if="visible"
stayed false: "Export poster…" opened nothing, on both engines, since the dialog moved to
the library. legend.rows is a ref inside a plain object, so the template must unwrap it. -->
<PosterDialog
v-if="showPoster"
:poster="poster"
:legend-rows="legend.rows"
:active-tab="activeTab"
@close="showPoster = false"
v-model="showPoster"
:get-map="() => map"
:legend-rows="legend.rows.value || []"
/>
</div>
</div>