diff --git a/src/app/modules/map-config/components/layers/layers.component.ts b/src/app/modules/map-config/components/layers/layers.component.ts index 95cf50e6..08ec23f1 100644 --- a/src/app/modules/map-config/components/layers/layers.component.ts +++ b/src/app/modules/map-config/components/layers/layers.component.ts @@ -112,7 +112,6 @@ export class LayersComponent implements OnInit, OnDestroy { layer: exportedLayer, colorLegend: this.getColorLegend(paint), strokeColorLegend: this.getStrokeColorLegend(paint, exportedLayer.metadata), lineDashArray: this.getLineDashArray(paint), - iconType: layer?.clusterFg?.geometryStep?.aggType ? layer?.clusterFg?.geometryStep?.aggType : null } ); @@ -186,7 +185,6 @@ export class LayersComponent implements OnInit, OnDestroy { paint, filter: modeValues.styleStep.filter, metadata: ConfigMapExportHelper.getLayerMetadata(collection, collectionDisplayName, - layerFg.value.clusterFg?.geometryStep?.aggType, layerFg.mode, modeValues, colorService, taggableFields) }; return layer; diff --git a/src/app/services/main-form-manager/config-map-export-helper.ts b/src/app/services/main-form-manager/config-map-export-helper.ts index a3372a38..0a119970 100644 --- a/src/app/services/main-form-manager/config-map-export-helper.ts +++ b/src/app/services/main-form-manager/config-map-export-helper.ts @@ -88,7 +88,7 @@ export class ConfigMapExportHelper { collection: layer.metadata.collection, collectionDisplayName: layer.metadata.collectionDisplayName, isScrollableLayer: false, - aggType: layerFg.value?.clusterFg?.geometryStep?.aggType ? layerFg.value?.clusterFg?.geometryStep?.aggType : null + aggType:layer.metadata?.aggType }, filter: layer.filter, layout: { @@ -164,13 +164,13 @@ export class ConfigMapExportHelper { return mapConfig; } - public static getLayerMetadata(collection: string, collectionDisplayName: string, aggType:string, + public static getLayerMetadata(collection: string, collectionDisplayName: string, mode: LAYER_MODE, modeValues, colorService: ArlasColorService, taggableFields?: Set): LayerMetadata { const metadata: LayerMetadata = { collection, collectionDisplayName, - aggType: aggType ?? null + aggType: modeValues.geometryStep?.aggType ?? null }; if (metadata && metadata.hasOwnProperty('hiddenProps')) { @@ -211,9 +211,9 @@ export class ConfigMapExportHelper { maxzoom: modeValues.visibilityStep.zoomMax, layout, paint, - metadata: this.getLayerMetadata(layerFg.customControls.collection.value, layerFg.customControls.collectionDisplayName.value, - layerFg.value.clusterFg?.geometryStep?.aggType, - mode, modeValues, colorService, taggableFields) + metadata: this.getLayerMetadata(layerFg.customControls.collection.value, + layerFg.customControls.collectionDisplayName.value, + mode, modeValues, colorService, taggableFields) }; /** 'all' is the operator that allows to apply an "AND" operator */ layer.filter = ['all'];