From cfff6c1f270c9004461072fa17c94bb1501d3e09 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 12 Nov 2024 08:17:23 +0100 Subject: [PATCH 1/3] save getcap --- src/getCapabilities.js | 3 ++- src/viewer.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/getCapabilities.js b/src/getCapabilities.js index 7c15a9638..25d4184db 100644 --- a/src/getCapabilities.js +++ b/src/getCapabilities.js @@ -21,7 +21,8 @@ const getCapabilities = function getCapabilities(name, getCapabilitiesURL) { if (xmlHttp.readyState === 4 && xmlHttp.status === 200) { resolve({ name, - capabilites: responseParser(xmlHttp.responseText) + capabilites: responseParser(xmlHttp.responseText), + capabilitesDoc: xmlHttp.responseText }); } }; diff --git a/src/viewer.js b/src/viewer.js index 0414a9986..c82b2890f 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -83,6 +83,9 @@ const Viewer = function Viewer(targetOption, options = {}) { const layers = {}; capabilitiesResults.forEach(result => { layers[result.name] = result.capabilites; + if(source[result.name].saveCapabilitiesDoc !== false){ + source[result.name].capabilitiesDoc = result.capabilitesDoc; + } }); return layers; }).catch(error => console.log(error)); From d01cb75621f392f749a362325797983e0410ae39 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 12 Nov 2024 08:25:51 +0100 Subject: [PATCH 2/3] Update viewer.js --- src/viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewer.js b/src/viewer.js index c82b2890f..70a0c3813 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -83,7 +83,7 @@ const Viewer = function Viewer(targetOption, options = {}) { const layers = {}; capabilitiesResults.forEach(result => { layers[result.name] = result.capabilites; - if(source[result.name].saveCapabilitiesDoc !== false){ + if(source[result.name]?.saveCapabilitiesDoc !== false){ source[result.name].capabilitiesDoc = result.capabilitesDoc; } }); From 5a1ba9ca8e383646c7ad6327bb4f28dfe5a2126b Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 12 Nov 2024 08:29:25 +0100 Subject: [PATCH 3/3] Update viewer.js --- src/viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viewer.js b/src/viewer.js index 70a0c3813..b400268d8 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -83,7 +83,7 @@ const Viewer = function Viewer(targetOption, options = {}) { const layers = {}; capabilitiesResults.forEach(result => { layers[result.name] = result.capabilites; - if(source[result.name]?.saveCapabilitiesDoc !== false){ + if (source[result.name]?.saveCapabilitiesDoc !== false) { source[result.name].capabilitiesDoc = result.capabilitesDoc; } });