Skip to content

Commit

Permalink
Merge branch 'release-3.4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
lowzonenose committed Nov 17, 2024
2 parents 56dd3ef + a3012fe commit ae160db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions DRAFT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
22 changes: 12 additions & 10 deletions src/Services/Config/ConfigInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae160db

Please sign in to comment.