From 3646d0b99452247b0784f296fc9093fa18d4ec45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 13 Dec 2023 13:27:06 +0100 Subject: [PATCH] Fix used ogcServerName --- src/datasource/Manager.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/datasource/Manager.js b/src/datasource/Manager.js index 18898c24f0cd..9f67432e80fe 100644 --- a/src/datasource/Manager.js +++ b/src/datasource/Manager.js @@ -516,6 +516,8 @@ export class DatasourceManager { let timeProperty; /** @type {import('gmf/themes').GmfOgcServer} */ let ogcServer; + /** @type {string} */ + let ogcServerName; if (ogcType === ThemeNodeType.WMTS || ogcType === ThemeNodeType.VECTOR_TILES) { // Manage WMTS / Vector tiles @@ -543,6 +545,7 @@ export class DatasourceManager { // OGC Server if (meta.ogcServer && ogcServers[meta.ogcServer]) { + ogcServerName = meta.ogcServer; ogcServer = ogcServers[meta.ogcServer]; } } @@ -612,7 +615,7 @@ export class DatasourceManager { }); // OGC Server - const ogcServerName = + ogcServerName = !firstLevelGroup || firstLevelGroup.mixed ? gmfLayerWMS.ogcServer : firstLevelGroup.ogcServer; ogcServer = ogcServers[ogcServerName]; ogcImageType = ogcServer.imageType; @@ -750,11 +753,11 @@ export class DatasourceManager { if (ogcServerType === ServerType.ARCGIS) { if ( this.gmfDatasourceOptions.ogcServersSpecific && - this.gmfDatasourceOptions.ogcServersSpecific[this.ogcServerName] && - this.gmfDatasourceOptions.ogcServersSpecific[this.ogcServerName].arcgisWMSInfoFormat + this.gmfDatasourceOptions.ogcServersSpecific[ogcServerName] && + this.gmfDatasourceOptions.ogcServersSpecific[ogcServerName].arcgisWMSInfoFormat ) { options.wmsInfoFormat = - this.gmfDatasourceOptions.ogcServersSpecific[this.ogcServerName].arcgisWMSInfoFormat; + this.gmfDatasourceOptions.ogcServersSpecific[ogcServerName].arcgisWMSInfoFormat; } else if (this.gmfDatasourceOptions.arcgisWMSInfoFormat) { options.wmsInfoFormat = this.gmfDatasourceOptions.arcgisWMSInfoFormat; }