From 17540e86f3d8ccf79f44ec1c7d830328131c2645 Mon Sep 17 00:00:00 2001 From: Suren Date: Wed, 29 Nov 2023 14:50:41 +0530 Subject: [PATCH] #9589: Save layer sourceMetadata info (#9736) (#9769) (cherry picked from commit 170bce79d5f6fe1c411b517654909af93621dcf7) --- 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 8cfca18d72..1cd8dd6917 100644 --- a/web/client/utils/LayersUtils.js +++ b/web/client/utils/LayersUtils.js @@ -656,7 +656,8 @@ export const saveLayer = (layer) => { layer.tileGridCacheSupport ? { tileGridCacheSupport: layer.tileGridCacheSupport } : {}, !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)) );