From c44220da118d002f5883c24ea1be8c7d3cfdb43b 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 e540166244fc..f49fba0005a6 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; }