Download button: take advantage of MVT server, download button will now attempt to download everything

This commit is contained in:
Pieter Vander Vennet 2024-02-21 16:35:49 +01:00
parent bccda67e1c
commit e4eb8d6b52
21 changed files with 453 additions and 353 deletions

View file

@ -553,7 +553,7 @@ class SvgToPdfInternals {
export interface SvgToPdfOptions {
freeComponentId: string
disableMaps?: false | true
textSubstitutions?: Record<string, string>
textSubstitutions?: Record<string, string | Translation>
beforePage?: (i: number) => void
overrideLocation?: { lat: number; lon: number }
disableDataLoading?: boolean | false
@ -711,9 +711,13 @@ class SvgToPdfPage {
this.options.beforePage(i)
}
const self = this
const internal = new SvgToPdfInternals(advancedApi, this, (key) =>
self.extractTranslation(key, language)
)
const internal = new SvgToPdfInternals(advancedApi, this, (key) => {
const tr = self.extractTranslation(key, language)
if (typeof tr === "string") {
return tr
}
return tr.txt
})
for (const child of Array.from(this._svgRoot.children)) {
internal.handleElement(<any>child)
}