From 1d2d098167ba428d9bbaaa6583250075dda68d21 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 28 Jul 2021 12:36:39 +0200 Subject: [PATCH] Small fixes --- Logic/FeatureSource/FeatureSource.ts | 5 +++-- UI/ExportPDF.ts | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Logic/FeatureSource/FeatureSource.ts b/Logic/FeatureSource/FeatureSource.ts index 171db39f6..5b66e1650 100644 --- a/Logic/FeatureSource/FeatureSource.ts +++ b/Logic/FeatureSource/FeatureSource.ts @@ -24,13 +24,14 @@ export class FeatureSourceUtils { options = Utils.setDefaults(options, defaults); // Select all features, ignore the freshness and other data - let featureList: any[] = featurePipeline.features.data.map((feature) => feature.feature); + let featureList: any[] = featurePipeline.features.data.map((feature) => + JSON.parse(JSON.stringify((feature.feature)))); // Make a deep copy! if (!options.metadata) { for (let i = 0; i < featureList.length; i++) { let feature = featureList[i]; for (let property in feature.properties) { - if (property[0] == "_") { + if (property[0] == "_" && property !== "_lat" && property !== "_lon") { delete featureList[i]["properties"][property]; } } diff --git a/UI/ExportPDF.ts b/UI/ExportPDF.ts index 5422f38de..6fc475bd8 100644 --- a/UI/ExportPDF.ts +++ b/UI/ExportPDF.ts @@ -46,16 +46,17 @@ export default class ExportPDF { // We create a minimap at the given location and attach it to the given 'hidden' element - + const l = options.location.data; + const loc = { + lat : l.lat, + lon: l.lon, + zoom: l.zoom + 1 + } const minimap = new Minimap({ - location: options.location.map(l => ({ - lat : l.lat, - lon: l.lon, - zoom: l.zoom + 1 - })), + location: new UIEventSource(loc), // We remove the link between the old and the new UI-event source as moving the map while the export is running fucks up the screenshot background: options.background, - allowMoving: true, + allowMoving: false, onFullyLoaded: leaflet => window.setTimeout(() => { try{ self.CreatePdf(leaflet)