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);
|
options = Utils.setDefaults(options, defaults);
|
||||||
|
|
||||||
// Select all features, ignore the freshness and other data
|
// 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) {
|
if (!options.metadata) {
|
||||||
for (let i = 0; i < featureList.length; i++) {
|
for (let i = 0; i < featureList.length; i++) {
|
||||||
let feature = featureList[i];
|
let feature = featureList[i];
|
||||||
for (let property in feature.properties) {
|
for (let property in feature.properties) {
|
||||||
if (property[0] == "_") {
|
if (property[0] == "_" && property !== "_lat" && property !== "_lon") {
|
||||||
delete featureList[i]["properties"][property];
|
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
|
// 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({
|
const minimap = new Minimap({
|
||||||
location: options.location.map(l => ({
|
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
|
||||||
lat : l.lat,
|
|
||||||
lon: l.lon,
|
|
||||||
zoom: l.zoom + 1
|
|
||||||
})),
|
|
||||||
background: options.background,
|
background: options.background,
|
||||||
allowMoving: true,
|
allowMoving: false,
|
||||||
onFullyLoaded: leaflet => window.setTimeout(() => {
|
onFullyLoaded: leaflet => window.setTimeout(() => {
|
||||||
try{
|
try{
|
||||||
self.CreatePdf(leaflet)
|
self.CreatePdf(leaflet)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue