The paper turns to match the map, because a map is wider than it is tall
Follow-up on DRV1650-SR-POSTER-EXPORT: the print came out vertical, where a horizontal map fits the shape better.
The export asked for 8.5x11 portrait unconditionally, so a landscape map was letterboxed
onto a tall sheet -- white above and below, the map small in the middle. That was the
other half of the wrong vertical aspect; the first half was the tile slicing, fixed in
859bb268.
Orientation now follows the map: landscape when the map's own container is wider than it
is tall, portrait otherwise. The PAPER is unchanged -- still 8.5x11 stock, only turned --
so the sheet stays a size printers have rather than becoming a custom one.
Measured from map.getContainer() rather than from the window, because the map may be one
pane of a composite and it is the MAP's shape being exported, not the browser's.
This commit is contained in:
parent
84e1e0cf42
commit
b9d78e8926
1 changed files with 14 additions and 1 deletions
|
|
@ -1407,7 +1407,20 @@ async function openPoster() {
|
|||
import('@map/composables/printInPlace.js'),
|
||||
])
|
||||
const exporter = useMapPoster(() => map.value)
|
||||
const spec = defaultPosterSpec({ widthIn: 8.5, heightIn: 11, dpi: 200, orientation: 'portrait' })
|
||||
// ★ THE PAPER FOLLOWS THE MAP, because a map is usually wider than it is tall and a portrait sheet
|
||||
// letterboxes it (Driver, 2026-09-28: the print came out vertical and it should "probably [be] a
|
||||
// horizontal map"). Same 8.5x11 stock either way — only the ORIENTATION turns, so the sheet is
|
||||
// still a standard page and not a custom size no printer has.
|
||||
// Measured from the map's own container rather than from the window: the map may be one pane of a
|
||||
// composite, and it is the MAP's shape being exported, not the browser's.
|
||||
const mapEl = map.value?.getContainer?.() || null
|
||||
const landscape = !!mapEl && mapEl.clientWidth > mapEl.clientHeight
|
||||
const spec = defaultPosterSpec({
|
||||
widthIn: landscape ? 11 : 8.5,
|
||||
heightIn: landscape ? 8.5 : 11,
|
||||
dpi: 200,
|
||||
orientation: landscape ? 'landscape' : 'portrait',
|
||||
})
|
||||
// The poster is titled by the VIEW on screen ("Prayer", "Religion"…), in the reader's language.
|
||||
// The legend's title bar is the fallback only: on a flat tab it is the generic word "Legend".
|
||||
const title = tabLabel(activeTab.value) || legendTitle.value || 'Doxa Map'
|
||||
|
|
|
|||
Loading…
Reference in a new issue