From e54d1c8f6bc4d7e0e8083526d7d6e4b2172000cf Mon Sep 17 00:00:00 2001 From: "jean-philippe.bazonnais" Date: Sun, 17 Nov 2024 00:52:17 +0100 Subject: [PATCH 1/2] Prise en compte du service WFS --- DRAFT_CHANGELOG.md | 1 + src/Services/Config/ConfigInterface.js | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index ba3c6ac..e45379b 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -13,6 +13,7 @@ Mise à jour de la JSdoc sur le service de configuration * [Added] * Ajout de la jsdoc sur le service de configuration + * Ajout de la conf technique pour le WFS * [Changed] diff --git a/src/Services/Config/ConfigInterface.js b/src/Services/Config/ConfigInterface.js index da0b5dd..070fa4d 100644 --- a/src/Services/Config/ConfigInterface.js +++ b/src/Services/Config/ConfigInterface.js @@ -149,12 +149,12 @@ ConfigInterface.prototype = { }, /** - * Get all parameters needed to display a WMS or WMTS layer given its name, its service and its key + * Get all parameters needed to display a WFS, WMS or WMTS layer given its name, its service and its key * * @param {String} layerName - name of the layer (ex. "ORTHOIMAGERY.ORTHOPHOTOS") * @param {String} service - name of the service (ex. "WMS" ou "WMTS") * @param {String} [apiKey] - Contract API key - * @returns {Object} params - params of the service (WMS or WMTS) for the given layer + * @returns {Object} params - params of the service (WFS, WMS or WMTS) for the given layer * @returns {String} params.url - Url of the service to reach to display the layer * @returns {String} params.version - Version of the service * @returns {String} params.styles - Default style of the layer @@ -195,17 +195,19 @@ ConfigInterface.prototype = { } } - const wmsTypeRegex = /\/v\//; - // WMS vector style always empty (not in getCap) - if (wmsTypeRegex.test(params.url)) { - params.styles = " "; - } else { - // WMS raster style is defined in getCap - params.styles = layerConf.styles[0].name; + if (service !== "WFS") { + const wmsTypeRegex = /\/v\//; + // WMS vector style always empty (not in getCap) + if (wmsTypeRegex.test(params.url)) { + params.styles = " "; + } else { + // WMS raster style is defined in getCap + params.styles = layerConf.styles[0].name; + } } params.version = layerConf.serviceParams.version; - params.format = layerConf.formats[0].name; + params.format = (layerConf.formats && layerConf.formats.length) ? layerConf.formats[0].name : ""; params.projection = layerConf.defaultProjection; // get layer info and constraints From a3012fe310d3280f673f75482c3f87935ddc1268 Mon Sep 17 00:00:00 2001 From: "jean-philippe.bazonnais" Date: Sun, 17 Nov 2024 01:08:51 +0100 Subject: [PATCH 2/2] maj version --- package.json | 4 ++-- src/Services/Config/ConfigInterface.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 69707d6..c43fef8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "geoportal-access-lib", - "version": "3.4.3", - "date": "21/08/2024", + "version": "3.4.4", + "date": "17/11/2024", "description": "French Geoportal resources access library", "module": "src/Gp.js", "main": "dist/GpServices-src.js", diff --git a/src/Services/Config/ConfigInterface.js b/src/Services/Config/ConfigInterface.js index 070fa4d..38465ab 100644 --- a/src/Services/Config/ConfigInterface.js +++ b/src/Services/Config/ConfigInterface.js @@ -207,7 +207,7 @@ ConfigInterface.prototype = { } params.version = layerConf.serviceParams.version; - params.format = (layerConf.formats && layerConf.formats.length) ? layerConf.formats[0].name : ""; + params.format = (layerConf.formats && layerConf.formats.length) ? layerConf.formats[0].name : ""; params.projection = layerConf.defaultProjection; // get layer info and constraints