Skip to content

Commit

Permalink
feat: create field to store metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
MAudelGisaia committed Jan 27, 2025
1 parent ebb861b commit 1c2370d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
);

Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions src/app/services/main-form-manager/config-map-export-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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<string>): LayerMetadata {
const metadata: LayerMetadata = {
collection,
collectionDisplayName,
aggType: aggType ?? null
aggType: modeValues.geometryStep?.aggType ?? null
};

if (metadata && metadata.hasOwnProperty('hiddenProps')) {
Expand Down Expand Up @@ -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'];
Expand Down

0 comments on commit 1c2370d

Please sign in to comment.