From 1bcc6e4b205d34479596e378eae535123373e55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 11 Dec 2023 12:27:34 +0100 Subject: [PATCH] Be able to set the arcgisWMSInfoFormat per ogcServer --- src/datasource/Manager.js | 13 +++++++++++-- src/options.js | 6 ++++++ srcapi/store/config.ts | 8 ++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/datasource/Manager.js b/src/datasource/Manager.js index 15de923a5b3f..ec090b590226 100644 --- a/src/datasource/Manager.js +++ b/src/datasource/Manager.js @@ -747,8 +747,17 @@ export class DatasourceManager { if (wmtsUrl) { options.wmtsUrl = wmtsUrl; } - if (ogcServerType === ServerType.ARCGIS && this.gmfDatasourceOptions.arcgisWMSInfoFormat) { - options.wmsInfoFormat = this.gmfDatasourceOptions.arcgisWMSInfoFormat; + if (ogcServerType === ServerType.ARCGIS) { + if ( + this.gmfDatasourceOptions.ogcServersSpecific && + this.gmfDatasourceOptions.ogcServersSpecific[this.ogcServerName] && + this.gmfDatasourceOptions.ogcServersSpecific[this.ogcServerName].arcgisWMSInfoFormat + ) { + options.wmsInfoFormat = + this.gmfDatasourceOptions.ogcServersSpecific[this.ogcServerName].arcgisWMSInfoFormat; + } else if (this.gmfDatasourceOptions.arcgisWMSInfoFormat) { + options.wmsInfoFormat = this.gmfDatasourceOptions.arcgisWMSInfoFormat; + } } // Create the data source and add it to the cache this.dataSourcesCache_[id] = new GmfDatasourceOGC(options); diff --git a/src/options.js b/src/options.js index 93a6988eb8e5..a4d973ba6d5c 100644 --- a/src/options.js +++ b/src/options.js @@ -908,9 +908,15 @@ export function buildStyle(styleDescriptor) { * @typedef {string} gmfCustomStylesheetUrl */ +/** + * @typedef {Object} ogcServerDatasourceOptions + * @property {string} arcgisWMSInfoFormat The WMS info format to be used with Arcgis OGC server. + */ + /** * @typedef {Object} gmfDatasourceOptions * @property {string} arcgisWMSInfoFormat The WMS info format to be used with Arcgis OGC server. + * @property {Object} ogcServersSpecific The OGC server specific options. */ export default null; diff --git a/srcapi/store/config.ts b/srcapi/store/config.ts index e71df01ff115..99bcd8055777 100644 --- a/srcapi/store/config.ts +++ b/srcapi/store/config.ts @@ -1382,12 +1382,20 @@ export type gmfCustomCSS = { */ export type pytreeLidarprofileJsonUrl = string; +export type ogcServerDatasourceOptions = { + /** + * The WMS info format to be used with Arcgis OGC server. + */ + arcgisWMSInfoFormat: string; +}; export type gmfDatasourceOptions = { /** * The WMS info format to be used with Arcgis OGC server. */ arcgisWMSInfoFormat: string; + ogcServersSpecific: {[x: string]: ogcServerDatasourceOptions}; }; + /** * The full configuration */