forked from MapComplete/MapComplete
Small fixes
This commit is contained in:
parent
06ce2ebe8c
commit
1d2d098167
2 changed files with 11 additions and 9 deletions
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>(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)
|
||||
|
|
Loading…
Reference in a new issue