diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index 804b26f73..2af3e4286 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -8,18 +8,26 @@ ## Summary +Correctifs sur le layerSwitcher et le profil Altimétrique. Mise à jour de la bibliothèque d'accès aux services Géoportail. + ## Changelog * [Added] * [Changed] + - access-lib 3.3.3 (#369) + * [Deprecated] * [Removed] * [Fixed] + - ajout couche ol au LS avec userId (#369) + - fix méthode clean profil alti (8f393fa96491444d99fdd6fe0c3b354ea3dd21ef) + - fix gestion multiples profils alti (f71ffd85ddff26a82534d81a88033464ed6a8b17 +) * [Security] --- @@ -35,12 +43,17 @@ ## Summary +Mise à jour de la bibliothèque d'accès aux services Géoportail. + + ## Changelog * [Added] * [Changed] + - access-lib 3.3.3 (#369) + * [Deprecated] * [Removed] @@ -53,6 +66,7 @@ + # Extension Geoportail Itowns, version __VERSION__ **__DATE__** @@ -60,7 +74,8 @@ ## Summary -Mise à jour de la version de la bibliothèque d'accès 3.3.2 +Mise à jour de la bibliothèque d'accès aux services Géoportail. + ## Changelog @@ -68,7 +83,7 @@ Mise à jour de la version de la bibliothèque d'accès 3.3.2 * [Changed] - - MaJ bibliothèque d'accès 3.3.2 + - access-lib 3.3.3 (#369) * [Deprecated] diff --git a/build/scripts/release/geoportal-extensions-itowns-2.4.2.tgz b/build/scripts/release/geoportal-extensions-itowns-2.4.2.tgz index 908b45ed3..d7024f4ee 100644 Binary files a/build/scripts/release/geoportal-extensions-itowns-2.4.2.tgz and b/build/scripts/release/geoportal-extensions-itowns-2.4.2.tgz differ diff --git a/build/scripts/release/geoportal-extensions-leaflet-2.3.1.tgz b/build/scripts/release/geoportal-extensions-leaflet-2.3.1.tgz deleted file mode 100644 index 6ea7f8a79..000000000 Binary files a/build/scripts/release/geoportal-extensions-leaflet-2.3.1.tgz and /dev/null differ diff --git a/build/scripts/release/geoportal-extensions-leaflet-2.3.3.tgz b/build/scripts/release/geoportal-extensions-leaflet-2.3.3.tgz index 0fce82789..9496bf1b5 100644 Binary files a/build/scripts/release/geoportal-extensions-leaflet-2.3.3.tgz and b/build/scripts/release/geoportal-extensions-leaflet-2.3.3.tgz differ diff --git a/build/scripts/release/geoportal-extensions-openlayers-3.3.1.tgz b/build/scripts/release/geoportal-extensions-openlayers-3.3.1.tgz deleted file mode 100644 index 42d557005..000000000 Binary files a/build/scripts/release/geoportal-extensions-openlayers-3.3.1.tgz and /dev/null differ diff --git a/build/scripts/release/geoportal-extensions-openlayers-3.3.2.tgz b/build/scripts/release/geoportal-extensions-openlayers-3.3.2.tgz index e964ac813..67b0e3f15 100644 Binary files a/build/scripts/release/geoportal-extensions-openlayers-3.3.2.tgz and b/build/scripts/release/geoportal-extensions-openlayers-3.3.2.tgz differ diff --git a/build/scripts/release/geoportal-extensions-openlayers-3.3.3.tgz b/build/scripts/release/geoportal-extensions-openlayers-3.3.3.tgz new file mode 100644 index 000000000..62268b862 Binary files /dev/null and b/build/scripts/release/geoportal-extensions-openlayers-3.3.3.tgz differ diff --git a/build/scripts/release/package-itowns.json b/build/scripts/release/package-itowns.json index 50a65c646..41546d914 100644 --- a/build/scripts/release/package-itowns.json +++ b/build/scripts/release/package-itowns.json @@ -1,45 +1,45 @@ { - "peerDependencies" : {}, - "scripts" : {}, - "name" : "geoportal-extensions-itowns", + "author" : "IGNF", + "bugs" : {}, + "main" : "dist/GpPluginItowns-src.js", + "description" : "French Geoportal Extensions for iTowns", + "date" : "21/07/2023", + "bundleDependencies" : [], "repository" : { - "url" : "https://github.com/IGNF/geoportal-extensions.git", - "type" : "git" + "type" : "git", + "url" : "https://github.com/IGNF/geoportal-extensions.git" }, - "directories" : {}, - "author" : "IGNF", "homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/extension-itowns.html", - "files" : [ - "dist/", - "src/", - "LICENCE.md", - "README.md", - "package.json" - ], "devDependencies" : {}, - "description" : "French Geoportal Extensions for iTowns", + "name" : "geoportal-extensions-itowns", + "version" : "2.4.2", "keywords" : [ "geoportail", "plugin", "javascript", "Itowns" ], - "main" : "dist/GpPluginItowns-src.js", - "license" : "CECILL-B", - "date" : "21/07/2023", - "version" : "2.4.2", "module" : "src/Itowns/index.js", + "peerDependencies" : {}, "dependencies" : { "xmldom" : "^0.1.27", "three" : "0.137.5", + "loglevel" : "1.6.7", "node-fetch" : "^2.6.1", - "sortablejs" : "1.14.0", - "geoportal-access-lib" : "3.3.2", "itowns" : "2.38.2", - "loglevel" : "1.6.7", - "proj4" : "2.7.5" + "sortablejs" : "1.14.0", + "proj4" : "2.7.5", + "geoportal-access-lib" : "3.3.3" }, - "bundleDependencies" : [], + "license" : "CECILL-B", "types" : "src/Itowns/index.d.ts", - "bugs" : {} + "scripts" : {}, + "files" : [ + "dist/", + "src/", + "LICENCE.md", + "README.md", + "package.json" + ], + "directories" : {} } diff --git a/build/scripts/release/package-leaflet.json b/build/scripts/release/package-leaflet.json index da436d333..015167fb5 100644 --- a/build/scripts/release/package-leaflet.json +++ b/build/scripts/release/package-leaflet.json @@ -1,22 +1,16 @@ { - "version" : "2.3.3", - "main" : "dist/GpPluginLeaflet-src.js", - "repository" : { - "type" : "git", - "url" : "https://github.com/IGNF/geoportal-extensions.git" - }, - "name" : "geoportal-extensions-leaflet", - "devDependencies" : {}, + "bundleDependencies" : [], + "peerDependencies" : {}, "dependencies" : { - "geoportal-access-lib" : "3.3.2", - "leaflet" : "1.7.1", - "proj4" : "2.7.5", "sortablejs" : "1.8.4", "proj4leaflet" : "1.0.2", + "xmldom" : "^0.1.27", "leaflet-draw" : "1.0.4", "loglevel" : "1.6.6", - "xmldom" : "^0.1.27", - "node-fetch" : "^2.6.1" + "proj4" : "2.7.5", + "leaflet" : "1.7.1", + "node-fetch" : "^2.6.1", + "geoportal-access-lib" : "3.3.3" }, "files" : [ "dist/", @@ -25,22 +19,28 @@ "README.md", "package.json" ], + "license" : "CECILL-B", + "module" : "src/Leaflet/index.js", + "homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/extension-leaflet.html", + "date" : "21/07/2023", + "devDependencies" : {}, "directories" : {}, - "scripts" : {}, "types" : "src/Leaflet/index.d.ts", - "peerDependencies" : {}, - "date" : "21/07/2023", - "license" : "CECILL-B", - "bundleDependencies" : [], + "bugs" : {}, + "main" : "dist/GpPluginLeaflet-src.js", + "version" : "2.3.3", + "description" : "French Geoportal Extension for Leaflet", + "name" : "geoportal-extensions-leaflet", + "repository" : { + "type" : "git", + "url" : "https://github.com/IGNF/geoportal-extensions.git" + }, + "scripts" : {}, "keywords" : [ "geoportail", "plugin", "javascript", "leaflet", "publish" - ], - "homepage" : "https://geoservices.ign.fr/documentation/utilisation_web/extension-leaflet.html", - "description" : "French Geoportal Extension for Leaflet", - "bugs" : {}, - "module" : "src/Leaflet/index.js" + ] } diff --git a/build/scripts/release/package-openlayers.json b/build/scripts/release/package-openlayers.json index 2c29b6339..455e7c577 100644 --- a/build/scripts/release/package-openlayers.json +++ b/build/scripts/release/package-openlayers.json @@ -1,10 +1,23 @@ { - "directories" : {}, - "version" : "3.3.2", - "types" : "src/OpenLayers/index.d.ts", - "devDependencies" : {}, - "scripts" : {}, - "module" : "src/OpenLayers/index.js", + "dependencies" : { + "xmldom" : "^0.1.27", + "node-fetch" : "^2.6.1", + "ol" : "6.9.0", + "proj4" : "2.7.5", + "loglevel" : "1.6.6", + "eventbusjs" : "0.2.0", + "@mapbox/mapbox-gl-style-spec" : "13.20.1", + "sortablejs" : "1.14.0", + "geoportal-access-lib" : "3.3.3" + }, + "keywords" : [ + "geoportail", + "plugin", + "javascript", + "OpenLayers" + ], + "date" : "04/08/2023", + "name" : "geoportal-extensions-openlayers", "files" : [ "dist/", "src/", @@ -12,30 +25,17 @@ "README.md", "package.json" ], - "name" : "geoportal-extensions-openlayers", "peerDependencies" : {}, - "keywords" : [ - "geoportail", - "plugin", - "javascript", - "OpenLayers" - ], - "bugs" : {}, + "module" : "src/OpenLayers/index.js", + "types" : "src/OpenLayers/index.d.ts", "repository" : { "type" : "git", "url" : "https://github.com/IGNF/geoportal-extensions.git" }, - "dependencies" : { - "sortablejs" : "1.14.0", - "xmldom" : "^0.1.27", - "geoportal-access-lib" : "3.3.2", - "ol" : "6.9.0", - "eventbusjs" : "0.2.0", - "loglevel" : "1.6.6", - "node-fetch" : "^2.6.1", - "proj4" : "2.7.5", - "@mapbox/mapbox-gl-style-spec" : "13.20.1" - }, - "date" : "21/07/2023", - "license" : "CECILL-B" + "devDependencies" : {}, + "bugs" : {}, + "license" : "CECILL-B", + "directories" : {}, + "scripts" : {}, + "version" : "3.3.3" } diff --git a/doc/CHANGELOG-itowns.md b/doc/CHANGELOG-itowns.md index f937ec10b..69ebd8818 100644 --- a/doc/CHANGELOG-itowns.md +++ b/doc/CHANGELOG-itowns.md @@ -93,6 +93,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Extension Geoportail Itowns, version 2.4.1](#extension-geoportail-itowns-version-241) * [Summary](#summary-27) * [Changelog](#changelog-26) +- [Extension Geoportail Itowns, version 2.4.2](#extension-geoportail-itowns-version-242) + * [Summary](#summary-28) + * [Changelog](#changelog-27) @@ -854,3 +857,29 @@ globeView.addLayer(new Gp.itownsExtended.layer.GeoportalWMTS({ * [Security] --- +# Extension Geoportail Itowns, version 2.4.2 + +**21/07/2023** +> Release Extension Geoportail itowns + +## Summary + +Mise à jour de la version de la bibliothèque d'accès 3.3.2 + +## Changelog + +* [Added] + +* [Changed] + + - MaJ bibliothèque d'accès 3.3.2 + +* [Deprecated] + +* [Removed] + +* [Fixed] + +* [Security] + +--- diff --git a/package.json b/package.json index fd3f28e19..f75bbeec6 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "geoportal-extensions", "description": "French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries", - "version": "2.8.3", - "date": "21/07/2023", + "version": "2.8.4", + "date": "04/08/2023", "leafletExtName": "French Geoportal Extension for Leaflet", "leafletExtVersion": "2.3.3", "olExtName": "French Geoportal Extension for OpenLayers", - "olExtVersion": "3.3.2", + "olExtVersion": "3.3.3", "itownsExtName": "French Geoportal Extension for Itowns", "itownsExtVersion": "2.4.2", "main": "dist/leaflet/GpPluginLeaflet.js, dist/openlayers/GpPluginOpenLayers.js, dist/itowns/GpPluginItowns.js", @@ -73,7 +73,7 @@ "dependencies": { "@mapbox/mapbox-gl-style-spec": "13.20.1", "eventbusjs": "0.2.0", - "geoportal-access-lib": "3.3.2", + "geoportal-access-lib": "3.3.3", "itowns": "2.38.2", "leaflet": "1.7.1", "leaflet-draw": "1.0.4", diff --git a/src/OpenLayers/Controls/ElevationPath.js b/src/OpenLayers/Controls/ElevationPath.js index bf62584f0..9ccacd052 100644 --- a/src/OpenLayers/Controls/ElevationPath.js +++ b/src/OpenLayers/Controls/ElevationPath.js @@ -701,8 +701,9 @@ var ElevationPath = (function (Control) { /** * clean + * @param {Boolean} remove - remove layer */ - ElevationPath.prototype.clean = function () { + ElevationPath.prototype.clean = function (remove) { logger.trace("ElevationPath::clean"); var map = this.getMap(); @@ -716,7 +717,7 @@ var ElevationPath = (function (Control) { // this._removeMeasure(); this._removeProfile(); - this._removeMeasureInteraction(map); + this._removeMeasureInteraction(map, typeof remove !== "undefined" ? remove : false); this.setLayer(); }; @@ -1116,9 +1117,10 @@ var ElevationPath = (function (Control) { * And removes layer too... * * @param {ol.Map} map - Map + * @param {Boolean} remove - Remove layer * @private */ - ElevationPath.prototype._removeMeasureInteraction = function (map) { + ElevationPath.prototype._removeMeasureInteraction = function (map, remove) { logger.trace("ElevationPath::_removeMeasureInteraction()"); // var map = this.getMap(); @@ -1126,10 +1128,12 @@ var ElevationPath = (function (Control) { return; } - // if (this._measureVector) { - // map.removeLayer(this._measureVector); - // this._measureVector = null; - // } + if (remove) { + if (this._measureVector) { + map.removeLayer(this._measureVector); + this._measureVector = null; + } + } if (this._measureDraw) { map.removeInteraction(this._measureDraw); @@ -1661,9 +1665,10 @@ var ElevationPath = (function (Control) { * this method is called by event 'click' on '' picto * and enable or disable the entry of the path * + * @param {Object} e - event * @private */ - ElevationPath.prototype.onShowElevationPathClick = function () { + ElevationPath.prototype.onShowElevationPathClick = function (e) { var map = this.getMap(); Interactions.unset(map, { current : "ElevationPath" @@ -1680,10 +1685,28 @@ var ElevationPath = (function (Control) { this._addMeasureInteraction(map); } else { this._panelContainer.style.display = "none"; - // this._panelContainer.style.visibility = "hidden"; - this._removeMeasure(); + // HACK + // il est possible de faire passer une instruction via le DOM et les dataset : + // * data-remove-measure : true|false + // * data-remove-layer : true|false + if (e && e.target.dataset && e.target.dataset.removeMeasure) { + if (e.target.dataset.removeMeasure === "true") { + this._removeMeasure(); + } else { + // sketch + this._lastSketch = null; + this._currentSketch = null; + } + } else { + this._removeMeasure(); + } this._removeProfile(); - this._removeMeasureInteraction(map); + + if (e && e.target.dataset && e.target.dataset.removeLayer) { + this._removeMeasureInteraction(map, (e.target.dataset.removeLayer === "true")); + } else { + this._removeMeasureInteraction(map, true); + } } }; diff --git a/src/OpenLayers/Controls/LayerSwitcher.js b/src/OpenLayers/Controls/LayerSwitcher.js index 725265b96..448c77f2a 100644 --- a/src/OpenLayers/Controls/LayerSwitcher.js +++ b/src/OpenLayers/Controls/LayerSwitcher.js @@ -485,7 +485,7 @@ var LayerSwitcher = (function (Control) { id : id, opacity : opacity != null ? opacity : 1, visibility : visibility != null ? visibility : true, - title : conf.title != null ? conf.title : id, + title : conf.title != null ? conf.title : conf.id ? conf.id : id, description : conf.description || null, legends : conf.legends || [], metadata : conf.metadata || [], @@ -1060,10 +1060,11 @@ var LayerSwitcher = (function (Control) { */ LayerSwitcher.prototype.getLayerInfo = function (layer) { var layerInfo = {}; - if (layer.getSource !== undefined) { - var src = layer.getSource(); + if (layer.getProperties !== undefined && layer.getSource !== undefined) { + var layerProperties = layer.getProperties(); + var src = layerProperties.source; if (src) { - layerInfo._title = src._title || ""; + layerInfo._title = src._title || layerProperties.id || ""; layerInfo._description = src._description || ""; layerInfo._quicklookUrl = src._quicklookUrl || ""; layerInfo._metadata = src._metadata || []; diff --git a/test/spec/Common/Utils/test-common-utils-checkrightmanagement.js b/test/spec/Common/Utils/test-common-utils-checkrightmanagement.js deleted file mode 100644 index 23fc55b88..000000000 --- a/test/spec/Common/Utils/test-common-utils-checkrightmanagement.js +++ /dev/null @@ -1,195 +0,0 @@ -/* global describe, it */ - -import CheckRightManagement from "../../../../src/Common/Utils/CheckRightManagement"; - -import { assert, expect, should } from "chai"; -should(); - -describe("-- Test CheckRightManagement --", function () { - - var Gp; - var Config = { - generalOptions : { - apiKeys : { - "4545454545454545454" : {} - } - }, - layers : { - - "resource-1$OGC:OPENLS;service-1" : { - getServerUrl : function () {}, - getServiceParams : function () { - return { - version : "" - } - }, - getBBOX : function () {}, - getTitle : function () {}, - getDescription : function () {}, - - apiKeys : ["4545454545454545454"], - serviceParams : { - version : "1.0.0", - description: "", - title: "", - serverUrl : { - "4545454545454545454" : "http://localhost/service-1" - } - } - }, - "resource-2$OGC:OPENLS;service-1" : { - getServerUrl : function () {}, - getServiceParams : function () { - return { - version : "" - } - }, - getBBOX : function () {}, - getTitle : function () {}, - getDescription : function () {}, - apiKeys : ["4545454545454545454"], - serviceParams : { - version : "1.0.0", - description: "", - title: "", - serverUrl : { - "4545454545454545454" : "http://localhost/service-2" - } - } - } - } - }; - - before(function () { - - }); - after(function () { - window.Gp = null; - }); - - describe('#check (without autoconfiguration)', function () { - - window.Gp = null; - - it("with no parameter, return an undefined object", function () { - expect(CheckRightManagement.check()).to.be.undefined; - }); - - it("with no parameter resources, return an undefined object", function () { - expect(CheckRightManagement.check({ - resources : null - })).to.be.undefined; - }); - - it("with no parameter services, return an undefined object", function () { - expect(CheckRightManagement.check({ - resources : ['test'], - services : null - })).to.be.undefined; - }); - - it("neither parameter key, nor autoconfiguration, impossible to check it, return an undefined object !", function () { - expect(CheckRightManagement.check({ - resources : ['resource-1', 'resource-2'], - services : ['service'] - })).to.be.undefined; - }); - - it("with parameter key, but no autoconfiguration, impossible to check it but returns resources ! (1)", function () { - expect(CheckRightManagement.check({ - key : '4545454545454545454', - resources : ['resource-1', 'resource-2'], - services : ['service-1', 'service-2'] - })).to.eql({ - "key" : "4545454545454545454", - "service-1" : ['resource-1', 'resource-2'], - "service-2" : ['resource-1', 'resource-2'] - }); - }); - - it("with parameter key, but no autoconfiguration, impossible to check it but returns resources ! (2)", function () { - expect(CheckRightManagement.check({ - key : '4545454545454545454', - resources : ['resource-1', 'resource-2'], - services : ['service'] - })).to.eql({ - "key" : "4545454545454545454", - "service" : ['resource-1', 'resource-2'] - }); - }); - }); - - describe('#check (with autoconfiguration)', function () { - - window.Gp = {}; - - it("without parameter key, check it, and it's good !", function () { - window.Gp.Config = Config; - var right = CheckRightManagement.check({ - resources : ['resource-1', 'resource-2'], - services : ['service-1'] - }); - - expect(right).to.eql({ - "key" : '4545454545454545454', - "service-1" : ['resource-1', 'resource-2'] - }); - }); - - it("with parameter key, check it, and it's good !", function () { - window.Gp.Config = Config; - expect(CheckRightManagement.check({ - key : '4545454545454545454', - resources : ['resource-1', 'resource-2'], - services : ['service-1'] - })).to.eql({ - "key" : "4545454545454545454", - "service-1" : ['resource-1', 'resource-2'] - }); - }); - - it("without parameter key, check it, and it's not good because of one resource !", function () { - window.Gp.Config = Config; - var right = CheckRightManagement.check({ - resources : ['resource-1', 'resource-no-right'], - services : ['service-1'] - }); - - expect(right).to.eql({ - "key" : "4545454545454545454", - "service-1" : ['resource-1'] - }); - }); - - it("without parameter key, check it, and it's not good because of all resources !", function () { - window.Gp.Config = Config; - var right = CheckRightManagement.check({ - resources : ['resource--no-right', 'resource-no-right'], - services : ['service-1'] - }); - - expect(right).to.be.undefined; - }); - - it("without parameter key, check it, and it's not good because of one service !", function () { - window.Gp.Config = Config; - var right = CheckRightManagement.check({ - resources : ['resource-1', 'resource-2'], - services : ['service-no-right'] - }); - - expect(right).to.be.undefined; - }); - - it("with parameter key, check it, and it's not good because of key !", function () { - window.Gp.Config = Config; - var right = CheckRightManagement.check({ - key : '787878787878787878', - resources : ['resource-1', 'resource-2'], - services : ['service-1'] - }); - - expect(right).to.be.undefined; - }); - }); -});