From 170bce79d5f6fe1c411b517654909af93621dcf7 Mon Sep 17 00:00:00 2001 From: Suren Date: Mon, 27 Nov 2023 22:00:20 +0530 Subject: [PATCH] #9589: Save layer sourceMetadata info (#9736) --- web/client/utils/LayersUtils.js | 3 ++- web/client/utils/__tests__/LayersUtils-test.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/web/client/utils/LayersUtils.js b/web/client/utils/LayersUtils.js index 4df8de47a8..b2c3ab438e 100644 --- a/web/client/utils/LayersUtils.js +++ b/web/client/utils/LayersUtils.js @@ -658,7 +658,8 @@ export const saveLayer = (layer) => { isString(layer.rowViewer) ? { rowViewer: layer.rowViewer } : {}, !isNil(layer.forceProxy) ? { forceProxy: layer.forceProxy } : {}, !isNil(layer.disableFeaturesEditing) ? { disableFeaturesEditing: layer.disableFeaturesEditing } : {}, - layer.pointCloudShading ? { pointCloudShading: layer.pointCloudShading } : {}); + layer.pointCloudShading ? { pointCloudShading: layer.pointCloudShading } : {}, + !isNil(layer.sourceMetadata) ? { sourceMetadata: layer.sourceMetadata } : {}); }; /** diff --git a/web/client/utils/__tests__/LayersUtils-test.js b/web/client/utils/__tests__/LayersUtils-test.js index 4354ed5394..bba3662a68 100644 --- a/web/client/utils/__tests__/LayersUtils-test.js +++ b/web/client/utils/__tests__/LayersUtils-test.js @@ -1260,6 +1260,17 @@ describe('LayersUtils', () => { l => { expect(l.pointCloudShading).toBeTruthy(); } + ], + // Save sourceMetadata + [ + { + sourceMetadata: { + crs: "EPSG:3946" + } + }, + l => { + expect(l.sourceMetadata).toBeTruthy(); + } ] ]; layers.map(([layer, test]) => test(LayersUtils.saveLayer(layer)) );