forked from MapComplete/MapComplete
Fix some errors
This commit is contained in:
parent
e001576d9f
commit
518999c401
1 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
||||||
import jsPDF, { Matrix } from "jspdf"
|
import jsPDF, { Matrix } from "jspdf"
|
||||||
import { Translation, TypedTranslation } from "../UI/i18n/Translation"
|
import { Translation, TypedTranslation } from "../UI/i18n/Translation"
|
||||||
import FeaturePipelineState from "../Logic/State/FeaturePipelineState"
|
|
||||||
import { PngMapCreator } from "./pngMapCreator"
|
import { PngMapCreator } from "./pngMapCreator"
|
||||||
import { AllKnownLayouts } from "../Customizations/AllKnownLayouts"
|
import { AllKnownLayouts } from "../Customizations/AllKnownLayouts"
|
||||||
import { Store } from "../Logic/UIEventSource"
|
import { Store } from "../Logic/UIEventSource"
|
||||||
|
@ -12,6 +11,7 @@ import Translations from "../UI/i18n/Translations"
|
||||||
import { Utils } from "../Utils"
|
import { Utils } from "../Utils"
|
||||||
import Constants from "../Models/Constants"
|
import Constants from "../Models/Constants"
|
||||||
import Hash from "../Logic/Web/Hash"
|
import Hash from "../Logic/Web/Hash"
|
||||||
|
import ThemeViewState from "../Models/ThemeViewState"
|
||||||
|
|
||||||
class SvgToPdfInternals {
|
class SvgToPdfInternals {
|
||||||
private readonly doc: jsPDF
|
private readonly doc: jsPDF
|
||||||
|
@ -711,16 +711,16 @@ export class SvgToPdfPage {
|
||||||
Hash.hash.setData(undefined)
|
Hash.hash.setData(undefined)
|
||||||
// QueryParameters.ClearAll()
|
// QueryParameters.ClearAll()
|
||||||
|
|
||||||
const state = new FeaturePipelineState(layout)
|
const state = new ThemeViewState(layout)
|
||||||
state.locationControl.setData({
|
state.mapProperties.location.setData({
|
||||||
zoom,
|
|
||||||
lat: this.options?.overrideLocation?.lat ?? Number(params["lat"] ?? 51.05016),
|
lat: this.options?.overrideLocation?.lat ?? Number(params["lat"] ?? 51.05016),
|
||||||
lon: this.options?.overrideLocation?.lon ?? Number(params["lon"] ?? 3.717842),
|
lon: this.options?.overrideLocation?.lon ?? Number(params["lon"] ?? 3.717842),
|
||||||
})
|
})
|
||||||
|
state.mapProperties.zoom.setData(zoom)
|
||||||
|
|
||||||
console.log("Params are", params, params["layers"] === "none")
|
console.log("Params are", params, params["layers"] === "none")
|
||||||
|
|
||||||
const fl = state.filteredLayers.data
|
const fl = Array.from(state.layerState.filteredLayers.values())
|
||||||
for (const filteredLayer of fl) {
|
for (const filteredLayer of fl) {
|
||||||
if (params["layer-" + filteredLayer.layerDef.id] !== undefined) {
|
if (params["layer-" + filteredLayer.layerDef.id] !== undefined) {
|
||||||
filteredLayer.isDisplayed.setData(
|
filteredLayer.isDisplayed.setData(
|
||||||
|
@ -738,7 +738,7 @@ export class SvgToPdfPage {
|
||||||
const layerName = paramsKey.substring("layer-".length)
|
const layerName = paramsKey.substring("layer-".length)
|
||||||
const key = params[paramsKey].toLowerCase().trim()
|
const key = params[paramsKey].toLowerCase().trim()
|
||||||
const isDisplayed = key === "true" || key === "force"
|
const isDisplayed = key === "true" || key === "force"
|
||||||
const layer = state.filteredLayers.data.find((l) => l.layerDef.id === layerName)
|
const layer = fl.find((l) => l.layerDef.id === layerName)
|
||||||
console.log(
|
console.log(
|
||||||
"Setting ",
|
"Setting ",
|
||||||
layer?.layerDef?.id,
|
layer?.layerDef?.id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue