From c16c5cc8ad2325bf28a75d9016ad6833e8aa6453 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 7 Jun 2023 18:14:42 +0000 Subject: [PATCH 1/5] update CHANGELOG for Leaflet --- DRAFT_CHANGELOG.md | 1 + doc/CHANGELOG-leaflet.md | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index 6c1b671a..eb23091d 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -29,6 +29,7 @@ + # Extension Geoportail Leaflet, version __VERSION__ **__DATE__** diff --git a/doc/CHANGELOG-leaflet.md b/doc/CHANGELOG-leaflet.md index 2bf57996..3c436593 100644 --- a/doc/CHANGELOG-leaflet.md +++ b/doc/CHANGELOG-leaflet.md @@ -90,6 +90,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [Extension Geoportail Leaflet, version 2.3.0](#extension-geoportail-leaflet-version-230) * [Summary](#summary-26) * [Changelog](#changelog-23) + * [Avant :](#avant-) + * [Maintenant :](#maintenant-) +- [Extension Geoportail Leaflet, version 2.3.1](#extension-geoportail-leaflet-version-231) + * [Summary](#summary-27) + * [Changelog](#changelog-24) @@ -905,3 +910,25 @@ var maCoucheGeoportail = L.geoportalLayer.WMTS({ * [Security] --- +# Extension Geoportail Leaflet, version 2.3.1 + +**07/06/2023** +> Release Extension Geoportail leaflet + +## Summary + +## Changelog + +* [Added] + +* [Changed] + +* [Deprecated] + +* [Removed] + +* [Fixed] + +* [Security] + +--- From b38d105c1c4bde30e938f5afbedac8ef3dd9c843 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 7 Jun 2023 18:32:21 +0000 Subject: [PATCH 2/5] update CHANGELOG for Itowns --- DRAFT_CHANGELOG.md | 1 + doc/CHANGELOG-itowns.md | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index eb23091d..b86d85a5 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -55,6 +55,7 @@ + # Extension Geoportail Itowns, version __VERSION__ **__DATE__** diff --git a/doc/CHANGELOG-itowns.md b/doc/CHANGELOG-itowns.md index 8306da84..f937ec10 100644 --- a/doc/CHANGELOG-itowns.md +++ b/doc/CHANGELOG-itowns.md @@ -90,6 +90,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [Changelog](#changelog-25) * [Avant :](#avant-) * [Maintenant :](#maintenant-) +- [Extension Geoportail Itowns, version 2.4.1](#extension-geoportail-itowns-version-241) + * [Summary](#summary-27) + * [Changelog](#changelog-26) @@ -829,3 +832,25 @@ globeView.addLayer(new Gp.itownsExtended.layer.GeoportalWMTS({ * [Security] --- +# Extension Geoportail Itowns, version 2.4.1 + +**07/06/2023** +> Release Extension Geoportail itowns + +## Summary + +## Changelog + +* [Added] + +* [Changed] + +* [Deprecated] + +* [Removed] + +* [Fixed] + +* [Security] + +--- From 6b8634e6d94d0576b8e63d01f832e53b253b43e4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 7 Jun 2023 18:39:17 +0000 Subject: [PATCH 3/5] update CHANGELOG for OpenLayers --- DRAFT_CHANGELOG.md | 1 + doc/CHANGELOG-openlayers.md | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index b86d85a5..e541abc3 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -4,6 +4,7 @@ + # Extension Geoportail OpenLayers, version __VERSION__ **__DATE__** diff --git a/doc/CHANGELOG-openlayers.md b/doc/CHANGELOG-openlayers.md index 3ee8841e..0b6aaca6 100644 --- a/doc/CHANGELOG-openlayers.md +++ b/doc/CHANGELOG-openlayers.md @@ -156,6 +156,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [Changelog](#changelog-43) * [Avant :](#avant-) * [Maintenant :](#maintenant-) +- [Extension Geoportail OpenLayers, version 3.3.1](#extension-geoportail-openlayers-version-331) + * [Summary](#summary-47) + * [Changelog](#changelog-44) @@ -1799,3 +1802,25 @@ new ol.layer.Tile({ * [Security] --- +# Extension Geoportail OpenLayers, version 3.3.1 + +**07/06/2023** +> Release Extension Geoportail openlayers + +## Summary + +## Changelog + +* [Added] + +* [Changed] + +* [Deprecated] + +* [Removed] + +* [Fixed] + +* [Security] + +--- From 59efde637b423f835f4d50175c2dd83849faf5d1 Mon Sep 17 00:00:00 2001 From: "jean-philippe.bazonnais" Date: Mon, 12 Jun 2023 13:56:15 +0200 Subject: [PATCH 4/5] Fix sur les exemples Leaflet avec un appel de Gp.Services.getConfig() --- DRAFT_CHANGELOG.md | 13 ++-- .../pages-leaflet-bundle-getconfig.html | 53 +++++++++++++ .../Default/pages-ol-bundle-getconfig.html | 78 +++++++++++++++++++ .../Default/pages-ol-bundle-multikeys.html | 9 +-- ...layout-leaflet-sample-bundle-getconfig.hbs | 45 +++++++++++ .../ol-sample-bundle-getconfig-layout.hbs | 41 ++++++++++ ...partials-leaflet-bundle-getconfig-head.hbs | 4 + .../partials-ol-bundle-getconfig-head.hbs | 5 ++ src/Common/Utils/Config.js | 4 + src/Leaflet/Layers/LayerConfig.js | 5 ++ src/Leaflet/index.js | 4 +- 11 files changed, 245 insertions(+), 16 deletions(-) create mode 100644 samples-src/pages/leaflet/Default/pages-leaflet-bundle-getconfig.html create mode 100644 samples-src/pages/openlayers/Default/pages-ol-bundle-getconfig.html create mode 100644 samples-src/templates/leaflet/layout-leaflet-sample-bundle-getconfig.hbs create mode 100644 samples-src/templates/openlayers/ol-sample-bundle-getconfig-layout.hbs create mode 100644 samples-src/templates/partials/leaflet/partials-leaflet-bundle-getconfig-head.hbs create mode 100644 samples-src/templates/partials/openlayers/partials-ol-bundle-getconfig-head.hbs diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index e541abc3..182da7b3 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -1,10 +1,5 @@ - - - - - # Extension Geoportail OpenLayers, version __VERSION__ **__DATE__** @@ -12,6 +7,8 @@ ## Summary +- Ajout d'exemples avec l'appel de *Gp.Services.getConfig()* + ## Changelog * [Added] @@ -30,7 +27,6 @@ - # Extension Geoportail Leaflet, version __VERSION__ **__DATE__** @@ -38,6 +34,8 @@ ## Summary +- Ajout d'exemples avec l'appel de *Gp.Services.getConfig()* + ## Changelog * [Added] @@ -50,13 +48,14 @@ * [Fixed] + - Fix sur les exemples avec un appel de *Gp.Services.getConfig()* + * [Security] --- - # Extension Geoportail Itowns, version __VERSION__ **__DATE__** diff --git a/samples-src/pages/leaflet/Default/pages-leaflet-bundle-getconfig.html b/samples-src/pages/leaflet/Default/pages-leaflet-bundle-getconfig.html new file mode 100644 index 00000000..3db049c2 --- /dev/null +++ b/samples-src/pages/leaflet/Default/pages-leaflet-bundle-getconfig.html @@ -0,0 +1,53 @@ +{{#extend "layout-leaflet-sample-bundle-getconfig"}} + +{{#content "head"}} + Sample Leaflet +{{/content}} + +{{#content "style"}} + +{{/content}} + +{{#content "body"}} +

Ajout de tous les widgets

+ +
+{{/content}} + +{{#content "js"}} + // on cache l'image de chargement du Géoportail. + document.getElementById("map").style.backgroundImage = "none"; + + // Création de la map + var layer = L.geoportalLayer.WMTS({ + layer : "ORTHOIMAGERY.ORTHOPHOTOS" + }); + + var map = L.map('map', { + zoom : 2, + center : L.latLng(48, 2) + }); + + layer.addTo(map); + + var iso = L.geoportalControl.Isocurve(); + map.addControl(iso); + var layerSwitcher = L.geoportalControl.LayerSwitcher(); + map.addControl(layerSwitcher); + var mp = L.geoportalControl.MousePosition(); + map.addControl(mp); + var route = L.geoportalControl.Route(); + map.addControl(route); + var reverse = L.geoportalControl.ReverseGeocode(); + map.addControl(reverse); + var search = L.geoportalControl.SearchEngine(); + map.addControl(search); + var measureProfil = L.geoportalControl.ElevationPath(); + map.addControl(measureProfil); +{{/content}} +{{/extend}} diff --git a/samples-src/pages/openlayers/Default/pages-ol-bundle-getconfig.html b/samples-src/pages/openlayers/Default/pages-ol-bundle-getconfig.html new file mode 100644 index 00000000..8940dcd4 --- /dev/null +++ b/samples-src/pages/openlayers/Default/pages-ol-bundle-getconfig.html @@ -0,0 +1,78 @@ +{{#extend "ol-sample-bundle-getconfig-layout"}} + +{{#content "head"}} + Sample openlayers - multikeys +{{/content}} + +{{#content "style"}} + +{{/content}} + +{{#content "body"}} +

Ajout de tous les widgets

+ +
+
+{{/content}} + +{{#content "js"}} + // on cache l'image de chargement du Géoportail. + document.getElementById("map").style.backgroundImage = "none"; + + // Création de la map + var map = new ol.Map({ + target : "map", + layers : [ + new ol.layer.GeoportalWMTS({ + layer : "GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2" + }), + new ol.layer.GeoportalWMTS({ + layer : "GEOGRAPHICALGRIDSYSTEMS.ETATMAJOR40" + }), + new ol.layer.GeoportalWMTS({ + layer : "LIMITES_ADMINISTRATIVES_EXPRESS.LATEST" + }) + ], + view : new ol.View({ + center : [288074.8449901076, 6247982.515792289], + zoom : 13 + }) + }); + + var drawing = new ol.control.Drawing(); + map.addControl(drawing); + var iso = new ol.control.Isocurve(); + map.addControl(iso); + var layerImport = new ol.control.LayerImport(); + map.addControl(layerImport); + var layerSwitcher = new ol.control.LayerSwitcher(); + map.addControl(layerSwitcher); + var mp = new ol.control.GeoportalMousePosition(); + map.addControl(mp); + var route = new ol.control.Route(); + map.addControl(route); + var reverse = new ol.control.ReverseGeocode({}); + map.addControl(reverse); + var search = new ol.control.SearchEngine({}); + map.addControl(search); + var feature = new ol.control.GetFeatureInfo({}); + map.addControl(feature); + + var measureLength = new ol.control.MeasureLength(); + map.addControl(measureLength); + var measureArea = new ol.control.MeasureArea(); + map.addControl(measureArea); + var measureAzimuth = new ol.control.MeasureAzimuth(); + map.addControl(measureAzimuth); + var measureProfil = new ol.control.ElevationPath(); + map.addControl(measureProfil); + + var attributions = new ol.control.GeoportalAttribution(); + map.addControl(attributions); +{{/content}} +{{/extend}} diff --git a/samples-src/pages/openlayers/Default/pages-ol-bundle-multikeys.html b/samples-src/pages/openlayers/Default/pages-ol-bundle-multikeys.html index a6eb836b..29065728 100644 --- a/samples-src/pages/openlayers/Default/pages-ol-bundle-multikeys.html +++ b/samples-src/pages/openlayers/Default/pages-ol-bundle-multikeys.html @@ -23,7 +23,7 @@

Ajout de tous les widgets

{{#content "js"}} {{/content}} {{/extend}} diff --git a/samples-src/templates/leaflet/layout-leaflet-sample-bundle-getconfig.hbs b/samples-src/templates/leaflet/layout-leaflet-sample-bundle-getconfig.hbs new file mode 100644 index 00000000..911bbedf --- /dev/null +++ b/samples-src/templates/leaflet/layout-leaflet-sample-bundle-getconfig.hbs @@ -0,0 +1,45 @@ + + + + {{#extend "partials-common-head"}} + {{/extend}} + {{#extend "partials-leaflet-common-head"}} + {{/extend}} + {{#block "vendor"}} + {{/block}} + + {{#extend "partials-leaflet-bundle-getconfig-head"}} + {{/extend}} + + {{#block "head"}} + {{/block}} + {{#block "style"}} + {{/block}} + + + +

Extension Géoportail pour Leaflet (mode bundle)

+ + {{#block "body"}} + {{/block}} + + + + diff --git a/samples-src/templates/openlayers/ol-sample-bundle-getconfig-layout.hbs b/samples-src/templates/openlayers/ol-sample-bundle-getconfig-layout.hbs new file mode 100644 index 00000000..1594a21d --- /dev/null +++ b/samples-src/templates/openlayers/ol-sample-bundle-getconfig-layout.hbs @@ -0,0 +1,41 @@ + + + + {{#extend "partials-common-head"}} + {{/extend}} + {{#extend "partials-ol-common-head"}} + {{/extend}} + {{#block "vendor"}} + {{/block}} + {{#extend "partials-ol-bundle-getconfig-head"}} + {{/extend}} + + {{#block "head"}} + {{/block}} + {{#block "style"}} + {{/block}} + + + +

Extension Géoportail pour OpenLayers

+ + {{#block "body"}} + {{/block}} + + + + diff --git a/samples-src/templates/partials/leaflet/partials-leaflet-bundle-getconfig-head.hbs b/samples-src/templates/partials/leaflet/partials-leaflet-bundle-getconfig-head.hbs new file mode 100644 index 00000000..9726d211 --- /dev/null +++ b/samples-src/templates/partials/leaflet/partials-leaflet-bundle-getconfig-head.hbs @@ -0,0 +1,4 @@ + + + + diff --git a/samples-src/templates/partials/openlayers/partials-ol-bundle-getconfig-head.hbs b/samples-src/templates/partials/openlayers/partials-ol-bundle-getconfig-head.hbs new file mode 100644 index 00000000..188c3df0 --- /dev/null +++ b/samples-src/templates/partials/openlayers/partials-ol-bundle-getconfig-head.hbs @@ -0,0 +1,5 @@ + + + + + diff --git a/src/Common/Utils/Config.js b/src/Common/Utils/Config.js index 55c40319..09e3032b 100644 --- a/src/Common/Utils/Config.js +++ b/src/Common/Utils/Config.js @@ -23,6 +23,10 @@ var Config = { * @returns {Boolean} True if Config is loaded, false otherwise */ isConfigLoaded : function () { + // config already loaded ! + if (this.configuration && Object.keys(this.configuration).length !== 0) { + return true; + } var scope = typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : {}; if (scope.Gp && scope.Gp.Config && scope.Gp.Config.layers && Object.keys(scope.Gp.Config.layers).length !== 0) { /** ts-syntax */ (this.configuration) = scope.Gp.Config; diff --git a/src/Leaflet/Layers/LayerConfig.js b/src/Leaflet/Layers/LayerConfig.js index b63794b5..4fadde98 100644 --- a/src/Leaflet/Layers/LayerConfig.js +++ b/src/Leaflet/Layers/LayerConfig.js @@ -21,6 +21,11 @@ var LayerConfig = { get : function (options) { var params = {}; + if (!Config.isConfigLoaded()) { + logger.warn("WARNING CONFIG_FAILED : config not loaded ?!"); + return; + } + // gestion des parametres params = Config.configuration.getLayerParams(options.layer, options.service); diff --git a/src/Leaflet/index.js b/src/Leaflet/index.js index 7c6ef13f..84551471 100644 --- a/src/Leaflet/index.js +++ b/src/Leaflet/index.js @@ -102,7 +102,9 @@ export { default as ProxyUtils } from "../Common/Utils/ProxyUtils"; export { default as ColorUtils } from "../Common/Utils/ColorUtils"; export { default as MathUtils } from "../Common/Utils/MathUtils"; export { default as Logger } from "../Common/Utils/LoggerByDefault"; -export { default as Config } from "../Common/Utils/Config"; + +// HACK !? +export const Config = (window.Gp) ? window.Gp.Config : {}; // creation du namespace pour les extensions leaflet L.geoportalLayer = Layers; // WMS et WMTS From c8c989b969e886de4e8f89f67d7ebaea40694a46 Mon Sep 17 00:00:00 2001 From: elias couppe Date: Mon, 12 Jun 2023 15:26:35 +0200 Subject: [PATCH 5/5] release leaflet 2.3.2 --- DRAFT_CHANGELOG.md | 2 +- package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DRAFT_CHANGELOG.md b/DRAFT_CHANGELOG.md index 182da7b3..47c67148 100644 --- a/DRAFT_CHANGELOG.md +++ b/DRAFT_CHANGELOG.md @@ -48,7 +48,7 @@ * [Fixed] - - Fix sur les exemples avec un appel de *Gp.Services.getConfig()* + - Fix sur les exemples avec un appel de *Gp.Services.getConfig()* (59efde637b423f835f4d50175c2dd83849faf5d1) * [Security] diff --git a/package.json b/package.json index af9f769d..ca74d0f1 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "geoportal-extensions", "description": "French Geoportal Extensions for OpenLayers, Leaflet and iTowns libraries", - "version": "2.8.1", - "date": "07/06/2023", + "version": "2.8.2", + "date": "12/06/2023", "leafletExtName": "French Geoportal Extension for Leaflet", - "leafletExtVersion": "2.3.1", + "leafletExtVersion": "2.3.2", "olExtName": "French Geoportal Extension for OpenLayers", "olExtVersion": "3.3.1", "itownsExtName": "French Geoportal Extension for Itowns",