Always retain KML lines and points

This commit is contained in:
livio committed 2026-09-28 20:29:21 +02:00
1 parent 0b5017739c
commit 83ea1696cd
3 files changed
+10 -5

No files matched your search

+4 -3
View File
@@ -1063,12 +1063,13 @@ function normalizeKmlFiles(files) {
const parcelSet = new Set(parcels);
const sheetParts = polygonParts.filter(feature => !parcelSet.has(feature));
const nonPolygonFeatures = features.filter(feature => geometryPolygons(feature.geometry).length === 0);
const optionalFeatures = [...sheetParts, ...nonPolygonFeatures];
if (!parcels.length && !(lmeState.includeKmlSheetLayer && optionalFeatures.length)) {
const importedFeatures = [...parcels, ...nonPolygonFeatures];
const optionalFeatures = sheetParts;
if (!importedFeatures.length && !(lmeState.includeKmlSheetLayer && optionalFeatures.length)) {
throw new Error("nessuna particella trovata; attiva 'includi layer del foglio' per importare gli altri elementi");
}
return {
geojson: { type: "FeatureCollection", features: parcels },
geojson: { type: "FeatureCollection", features: importedFeatures },
sheetGeojson: {
type: "FeatureCollection",
features: lmeState.includeKmlSheetLayer ? optionalFeatures : []