diff --git a/Utils/svgToPdf.ts b/Utils/svgToPdf.ts index 9ade36468..91b10df04 100644 --- a/Utils/svgToPdf.ts +++ b/Utils/svgToPdf.ts @@ -13,7 +13,6 @@ import {Utils} from "../Utils"; import Locale from "../UI/i18n/Locale"; import Constants from "../Models/Constants"; import Hash from "../Logic/Web/Hash"; -import {QueryParameters} from "../Logic/Web/QueryParameters"; class SvgToPdfInternals { private readonly doc: jsPDF; @@ -790,7 +789,7 @@ export class SvgToPdfPage { } - public drawPage(advancedApi: jsPDF, i: number, language: string): void { + public drawPage(advancedApi: jsPDF, i: number): void { if (!this._isPrepared) { throw "Run 'Prepare()' first!" } @@ -810,7 +809,8 @@ export class SvgToPdf { public static readonly templates : Record= { flyer_a4:{pages: ["/assets/templates/MapComplete-flyer.svg","/assets/templates/MapComplete-flyer.back.svg"], description: Translations.t.flyer.description}, - poster_a3: {pages: ["/assets/templates/MapComplete-poster-a3.svg"], description: "A basic A3 poster (similar to the flyer)"} + poster_a3: {pages: ["/assets/templates/MapComplete-poster-a3.svg"], description: "A basic A3 poster (similar to the flyer)"}, + poster_a2: {pages: ["/assets/templates/MapComplete-poster-a2.svg"], description: "A basic A2 poster (similar to the flyer); scaled up from the A3 poster"} } private readonly _title: string; @@ -856,7 +856,7 @@ export class SvgToPdf { const sy = mediabox.topRightY / targetHeight advancedApi.setCurrentTransformationMatrix(advancedApi.Matrix(sx, 0, 0, -sy, 0, mediabox.topRightY)) } - this._pages[i].drawPage(advancedApi, i, language) + this._pages[i].drawPage(advancedApi, i) } }) await doc.save(this._title+"."+language+".pdf"); diff --git a/all_themes_index.ts b/all_themes_index.ts index db22f83da..25a1707bf 100644 --- a/all_themes_index.ts +++ b/all_themes_index.ts @@ -1,4 +1,6 @@ -import { Utils } from "./Utils" +import MinimapImplementation from "./UI/Base/MinimapImplementation"; + +7import { Utils } from "./Utils" import AllThemesGui from "./UI/AllThemesGui" import { QueryParameters } from "./Logic/Web/QueryParameters" import StatisticsGUI from "./UI/StatisticsGUI" @@ -44,10 +46,11 @@ if (mode.data === "statistics") { new FixedUiElement("").AttachTo("centermessage") new StatisticsGUI().SetClass("w-full h-full pointer-events-auto").AttachTo("topleft-tools") } else if(mode.data === "pdf"){ + MinimapImplementation.initialize() new FixedUiElement("").AttachTo("centermessage") const div = document.createElement("div") div.id = "extra_div_for_maps" - new PdfExportGui(div.id).AttachTo("topleft-tools") + new PdfExportGui(div.id).SetClass("pointer-event-auto").AttachTo("topleft-tools") document.getElementById("topleft-tools").appendChild(div) } else { new AllThemesGui().setup() diff --git a/assets/templates/MapComplete-poster-a2.svg b/assets/templates/MapComplete-poster-a2.svg new file mode 100644 index 000000000..18fc30937 --- /dev/null +++ b/assets/templates/MapComplete-poster-a2.svg @@ -0,0 +1,2353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $flyer.frontParagraph + + + $flyer.title + + + + + + + + + + + + +$flyer.mapcomplete.customize + $fmc.intro $list(fmc.li) + + + + + + + + $flyer.callToAction + + $flyer.osm + $flyer.editing.title + + + + + $flyer.toerisme_vlaanderen + + + + + + + + + + + $flyer.examples + $version + + $flyer.whatIsOsm + + + + + + $map(theme:onwheels,z:19,lat:50.86622,lon:4.35012,layer-governments:false,layer-parking:false,layer-toilet:false,layer-cafe_pub:false,layer-food:false,scaling:1.5) + $flyer.onwheels + + + + + + + + + + $map(theme:cyclofix,z:14,lat:51.05016,lon:3.717842,layers:none,layer-bike_repair_station:true,layer-drinking_water:true,layer-bike_cafe:true,layer-bicycle_tube_vending_machine: true, +layer-charging_station_ebikes:false) + $flyer.cyclofix + + + + + + + + + + $map(theme:benches,z:14,lat:51.2098,lon:3.2284, layers:none, layer-bench:force) + $map(theme:cyclestreets,z:15,lat:51.02702,lon:4.48029, scaling:3) + + + + + + + + + + + $flyer.lines_too + $map(theme:aed,z:14,lat:51.2098,lon:3.2284, background:AGIV) + $flyer.aerial + + + + + + + + + + $flyer.tagline + $flyer.mapcomplete.title + $map(theme:cyclofix,lat:50.8552,lon:4.3156, z:10,layers:none, +layer-charging_station_ebikes:force) + + + + + + + $nr.title.render + $import layer.nature_reserve as nr +$import layer.nature_reserve.tagRenderings.Dogs? as nrd +$import layer.nature_reserve.tagRenderings.Access tag as nra +$import layer.nature_reserve.tagRenderings.Surface area as nrsa +$import flyer.fakeui as fui +$import flyer.mapcomplete as fmc +$import general as g +$set(_surface:ha, 13.2) + + + + + $image.addPicture + + Pieter Vander Vennet + $fui.add_images + + + + + + + + + + $fui.see_images + + + + $fui.wikipedia + CC0 + $nra.mappings.0.then + + + $nrsa.render + $fui.attributes + $fui.edit + + www.example.org/nature + + + + + + + + $g.wikipedia.fromWikipedia + + + + + + + + + + + + + + + + $fui.question + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $general.save + + $nrd.question + $nrd.mappings.0.then +$nrd.mappings.1.then +$nrd.mappings.2.then + Skip + + + + diff --git a/scripts/build.sh b/scripts/build.sh index 32ecb7d2f..522a6919e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -25,10 +25,12 @@ fi cp -r assets/layers/ dist/assets/layers/ cp -r assets/themes/ dist/assets/themes/ cp -r assets/svg/ dist/assets/svg/ +cp -r assets/templates/ dist/assets/templates/ cp -r assets/tagRenderings/ dist/assets/tagRenderings/ cp assets/*.png dist/assets/ cp assets/*.svg dist/assets/ + SRC_MAPS="--no-source-maps" BRANCH=`git rev-parse --abbrev-ref HEAD` echo "The branch name is $BRANCH"