diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index ea52e364732e..68e631048a93 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -108,6 +108,27 @@ jobs: - run: npm run build-storybook - run: make check-examples if: github.event_name != 'pull_request_target' + - uses: actions/upload-artifact@v3 + with: + name: Examples + path: examples + if-no-files-found: ignore + retention-days: 5 + if: always() + - uses: actions/upload-artifact@v3 + with: + name: GMF Examples + path: contribs/gmf/examples + if-no-files-found: ignore + retention-days: 5 + if: always() + - uses: actions/upload-artifact@v3 + with: + name: Apps + path: contribs/gmf/apps + if-no-files-found: ignore + retention-days: 5 + if: always() - uses: actions/upload-artifact@v3 with: name: Examples hosted diff --git a/buildtools/check-example b/buildtools/check-example index 1412763c6e7e..1cb192adf523 100755 --- a/buildtools/check-example +++ b/buildtools/check-example @@ -22,6 +22,7 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os +import shutil import subprocess import sys import tempfile @@ -45,17 +46,23 @@ def main(): ref = sys.argv[2] mask = ref.replace("-ref", "-mask") diff = current.replace(".html.png", "-diff.png") + old_ref = ref if os.path.exists(mask): print("Apply mask: " + mask) old_current = current - old_ref = ref current = tempfile.NamedTemporaryFile(suffix="-current.png").name ref = tempfile.NamedTemporaryFile(suffix="-ref.png").name - subprocess.check_call(["gm", "composite", "-compose", "Multiply", old_current, mask, current]) - subprocess.check_call(["gm", "composite", "-compose", "Multiply", old_ref, mask, ref]) + subprocess.run(["gm", "composite", "-compose", "Multiply", old_current, mask, current], check=True) + subprocess.run(["gm", "composite", "-compose", "Multiply", old_ref, mask, ref], check=True) - result = subprocess.check_output( + # Set to True to regenerate ref images + if True: + if "/error-" not in ref: + shutil.copyfile(current, old_ref) + shutil.copyfile(current, ref) + sys.exit(0) + result = subprocess.run( [ "gm", "compare", @@ -67,7 +74,8 @@ def main(): ref, "-file", diff, - ] + ], + check=True, ) result = float(result.decode().split("\n")[-2].split()[1]) if result > 0.01: diff --git a/contribs/gmf/apps/desktop_alt-ref.png b/contribs/gmf/apps/desktop_alt-ref.png index 6d6624fcf7f0..df4f4d1ed513 100644 Binary files a/contribs/gmf/apps/desktop_alt-ref.png and b/contribs/gmf/apps/desktop_alt-ref.png differ diff --git a/contribs/gmf/examples/backgroundlayerselector-ref.png b/contribs/gmf/examples/backgroundlayerselector-ref.png index fca5b10631ad..8cefeb74cf8a 100644 Binary files a/contribs/gmf/examples/backgroundlayerselector-ref.png and b/contribs/gmf/examples/backgroundlayerselector-ref.png differ diff --git a/contribs/gmf/examples/contextualdata-ref.png b/contribs/gmf/examples/contextualdata-ref.png index 573d115cb731..5104bdf8e13f 100644 Binary files a/contribs/gmf/examples/contextualdata-ref.png and b/contribs/gmf/examples/contextualdata-ref.png differ diff --git a/contribs/gmf/examples/displayquerygrid-ref.png b/contribs/gmf/examples/displayquerygrid-ref.png index 43a2ef8eafb5..7a205de043b2 100644 Binary files a/contribs/gmf/examples/displayquerygrid-ref.png and b/contribs/gmf/examples/displayquerygrid-ref.png differ diff --git a/contribs/gmf/examples/displayquerywindow-ref.png b/contribs/gmf/examples/displayquerywindow-ref.png index ef8a615fda13..0f5f7f307429 100644 Binary files a/contribs/gmf/examples/displayquerywindow-ref.png and b/contribs/gmf/examples/displayquerywindow-ref.png differ diff --git a/contribs/gmf/examples/drawfeature-ref.png b/contribs/gmf/examples/drawfeature-ref.png index 3c8325c75123..5c6420b26faf 100644 Binary files a/contribs/gmf/examples/drawfeature-ref.png and b/contribs/gmf/examples/drawfeature-ref.png differ diff --git a/contribs/gmf/examples/elevation-ref.png b/contribs/gmf/examples/elevation-ref.png index f98787c88a99..ac4e7cd8eb63 100644 Binary files a/contribs/gmf/examples/elevation-ref.png and b/contribs/gmf/examples/elevation-ref.png differ diff --git a/contribs/gmf/examples/featurestyle-ref.png b/contribs/gmf/examples/featurestyle-ref.png index 08ce9b6369d6..321b9f82de3d 100644 Binary files a/contribs/gmf/examples/featurestyle-ref.png and b/contribs/gmf/examples/featurestyle-ref.png differ diff --git a/contribs/gmf/examples/importdatasource-ref.png b/contribs/gmf/examples/importdatasource-ref.png index 6c9c91c86adb..19048bf755d3 100644 Binary files a/contribs/gmf/examples/importdatasource-ref.png and b/contribs/gmf/examples/importdatasource-ref.png differ diff --git a/contribs/gmf/examples/layertree-ref.png b/contribs/gmf/examples/layertree-ref.png index 656a4902aaf6..b7ce46b3d187 100644 Binary files a/contribs/gmf/examples/layertree-ref.png and b/contribs/gmf/examples/layertree-ref.png differ diff --git a/contribs/gmf/examples/layertreeadd-ref.png b/contribs/gmf/examples/layertreeadd-ref.png index 656a4902aaf6..b7ce46b3d187 100644 Binary files a/contribs/gmf/examples/layertreeadd-ref.png and b/contribs/gmf/examples/layertreeadd-ref.png differ diff --git a/contribs/gmf/examples/mobilemeasure-ref.png b/contribs/gmf/examples/mobilemeasure-ref.png index a69a1c3853cd..0277de8f1ebb 100644 Binary files a/contribs/gmf/examples/mobilemeasure-ref.png and b/contribs/gmf/examples/mobilemeasure-ref.png differ diff --git a/contribs/gmf/examples/mouseposition-ref.png b/contribs/gmf/examples/mouseposition-ref.png index b4d9e940e916..411d2d283a42 100644 Binary files a/contribs/gmf/examples/mouseposition-ref.png and b/contribs/gmf/examples/mouseposition-ref.png differ diff --git a/contribs/gmf/examples/objectediting-ref.png b/contribs/gmf/examples/objectediting-ref.png index a02982899020..9ccbd9da5d31 100644 Binary files a/contribs/gmf/examples/objectediting-ref.png and b/contribs/gmf/examples/objectediting-ref.png differ diff --git a/contribs/gmf/examples/permalink-ref.png b/contribs/gmf/examples/permalink-ref.png index 7548687a17e4..6bf91f7e52cf 100644 Binary files a/contribs/gmf/examples/permalink-ref.png and b/contribs/gmf/examples/permalink-ref.png differ diff --git a/contribs/gmf/examples/print-ref.png b/contribs/gmf/examples/print-ref.png index d5db2062991e..8fabda3871a1 100644 Binary files a/contribs/gmf/examples/print-ref.png and b/contribs/gmf/examples/print-ref.png differ diff --git a/contribs/gmf/examples/profile-ref.png b/contribs/gmf/examples/profile-ref.png index 186131e23a7a..280da7f79505 100644 Binary files a/contribs/gmf/examples/profile-ref.png and b/contribs/gmf/examples/profile-ref.png differ diff --git a/contribs/gmf/examples/search-ref.png b/contribs/gmf/examples/search-ref.png index fecf793362e1..9210b80a29d6 100644 Binary files a/contribs/gmf/examples/search-ref.png and b/contribs/gmf/examples/search-ref.png differ diff --git a/contribs/gmf/examples/simple-ref.png b/contribs/gmf/examples/simple-ref.png index 82f8853e653d..8c76c8984053 100644 Binary files a/contribs/gmf/examples/simple-ref.png and b/contribs/gmf/examples/simple-ref.png differ diff --git a/contribs/gmf/examples/timeslider-ref.png b/contribs/gmf/examples/timeslider-ref.png index 60c51541dad7..c958e3ecbd1d 100644 Binary files a/contribs/gmf/examples/timeslider-ref.png and b/contribs/gmf/examples/timeslider-ref.png differ diff --git a/contribs/gmf/examples/wfspermalink-ref.png b/contribs/gmf/examples/wfspermalink-ref.png index 769ccb880247..ed2fa90abc22 100644 Binary files a/contribs/gmf/examples/wfspermalink-ref.png and b/contribs/gmf/examples/wfspermalink-ref.png differ diff --git a/examples/animation-ref.png b/examples/animation-ref.png index cef7f63b6fca..41934802a2c3 100644 Binary files a/examples/animation-ref.png and b/examples/animation-ref.png differ diff --git a/examples/asitvd-ref.png b/examples/asitvd-ref.png index 29df8afed870..5c4774926cfe 100644 Binary files a/examples/asitvd-ref.png and b/examples/asitvd-ref.png differ diff --git a/examples/backgroundlayer-mask.png b/examples/backgroundlayer-mask.png index 55397c2acf6c..094c8bed83aa 100644 Binary files a/examples/backgroundlayer-mask.png and b/examples/backgroundlayer-mask.png differ diff --git a/examples/backgroundlayer-ref.png b/examples/backgroundlayer-ref.png index c6f074c9bd92..570827bb9eb4 100644 Binary files a/examples/backgroundlayer-ref.png and b/examples/backgroundlayer-ref.png differ diff --git a/examples/backgroundlayerdropdown-mask.png b/examples/backgroundlayerdropdown-mask.png index 55397c2acf6c..ad317fdf259d 100644 Binary files a/examples/backgroundlayerdropdown-mask.png and b/examples/backgroundlayerdropdown-mask.png differ diff --git a/examples/backgroundlayerdropdown-ref.png b/examples/backgroundlayerdropdown-ref.png index d266118ba372..d566f6419c01 100644 Binary files a/examples/backgroundlayerdropdown-ref.png and b/examples/backgroundlayerdropdown-ref.png differ diff --git a/examples/control-ref.png b/examples/control-ref.png index cc4fd506a271..b9e6ae1ea00b 100644 Binary files a/examples/control-ref.png and b/examples/control-ref.png differ diff --git a/examples/createfeature-ref.png b/examples/createfeature-ref.png index 7bc6c99e5001..c3a8dbf7f187 100644 Binary files a/examples/createfeature-ref.png and b/examples/createfeature-ref.png differ diff --git a/examples/disclaimer-ref.png b/examples/disclaimer-ref.png index 8e17c780ad23..55e2c08e7384 100644 Binary files a/examples/disclaimer-ref.png and b/examples/disclaimer-ref.png differ diff --git a/examples/drawfeature-ref.png b/examples/drawfeature-ref.png index 60c59fa20417..616932709047 100644 Binary files a/examples/drawfeature-ref.png and b/examples/drawfeature-ref.png differ diff --git a/examples/elevationProfile-ref.png b/examples/elevationProfile-ref.png index 51eea5dc2905..87dd331552eb 100644 Binary files a/examples/elevationProfile-ref.png and b/examples/elevationProfile-ref.png differ diff --git a/examples/googlestreetview-ref.png b/examples/googlestreetview-ref.png index 19f971190d87..478f374518db 100644 Binary files a/examples/googlestreetview-ref.png and b/examples/googlestreetview-ref.png differ diff --git a/examples/importfeatures-ref.png b/examples/importfeatures-ref.png index d460bec6b169..7cc3803b5425 100644 Binary files a/examples/importfeatures-ref.png and b/examples/importfeatures-ref.png differ diff --git a/examples/interactionbtngroup-ref.png b/examples/interactionbtngroup-ref.png index e5632281e0eb..6daf6c8891af 100644 Binary files a/examples/interactionbtngroup-ref.png and b/examples/interactionbtngroup-ref.png differ diff --git a/examples/layerorder-ref.png b/examples/layerorder-ref.png index 5ff1ded6557f..18f76bc0f177 100644 Binary files a/examples/layerorder-ref.png and b/examples/layerorder-ref.png differ diff --git a/examples/locationsearch-ref.png b/examples/locationsearch-ref.png index e981bc55bac2..55470881b3f5 100644 Binary files a/examples/locationsearch-ref.png and b/examples/locationsearch-ref.png differ diff --git a/examples/mapfishprint-ref.png b/examples/mapfishprint-ref.png index 45dccc25adf3..38f4f77703b2 100644 Binary files a/examples/mapfishprint-ref.png and b/examples/mapfishprint-ref.png differ diff --git a/examples/mapillarystreetview-ref.png b/examples/mapillarystreetview-ref.png index ccab20d66b11..5f7b1a0f900f 100644 Binary files a/examples/mapillarystreetview-ref.png and b/examples/mapillarystreetview-ref.png differ diff --git a/examples/mapswipe-ref.png b/examples/mapswipe-ref.png index e767951d3c9d..b9173930cbe2 100644 Binary files a/examples/mapswipe-ref.png and b/examples/mapswipe-ref.png differ diff --git a/examples/mask-mask.png b/examples/mask-mask.png index 25e177b280e3..3fb149fcf18f 100644 Binary files a/examples/mask-mask.png and b/examples/mask-mask.png differ diff --git a/examples/mask-ref.png b/examples/mask-ref.png index 342d9fcec50e..aafce0492587 100644 Binary files a/examples/mask-ref.png and b/examples/mask-ref.png differ diff --git a/examples/measure-ref.png b/examples/measure-ref.png index 566d4f1ab9a4..870ea48348d2 100644 Binary files a/examples/measure-ref.png and b/examples/measure-ref.png differ diff --git a/examples/mobilegeolocation-ref.png b/examples/mobilegeolocation-ref.png index aa69e6a0f1ef..67c9cae41a11 100644 Binary files a/examples/mobilegeolocation-ref.png and b/examples/mobilegeolocation-ref.png differ diff --git a/examples/modifycircle-ref.png b/examples/modifycircle-ref.png index 19c2195f09ef..78587318c791 100644 Binary files a/examples/modifycircle-ref.png and b/examples/modifycircle-ref.png differ diff --git a/examples/modifyrectangle-ref.png b/examples/modifyrectangle-ref.png index 1aa683b88047..a6b5788a31c8 100644 Binary files a/examples/modifyrectangle-ref.png and b/examples/modifyrectangle-ref.png differ diff --git a/examples/offline-ref.png b/examples/offline-ref.png deleted file mode 100644 index ae851bf106d3..000000000000 Binary files a/examples/offline-ref.png and /dev/null differ diff --git a/examples/offline.css b/examples/offline.css deleted file mode 100644 index 5dad95cadb23..000000000000 --- a/examples/offline.css +++ /dev/null @@ -1,57 +0,0 @@ -#map { - position: relative; -} -ngeo-offline div { - z-index: 1; -} -ngeo-offline .main-button { - position: absolute; - right: 10px; - bottom: 50px; - cursor: pointer; -} -ngeo-offline .main-button .no-data { - color: black; -} -ngeo-offline .main-button .with-data { - color: red; -} -ngeo-offline .main-button .no-data, -ngeo-offline .main-button .with-data { - background-color: white; - text-align: center; - font-size: 30px; - line-height: 20px; - border-radius: 20px; -} - -ngeo-offline .validate-extent { - position: absolute; - bottom: 5px; - width: 100px; - left: calc(50% - 50px); -} -ngeo-offline .in-progress { - position: absolute; - left: calc(50% - 33px); - top: calc(50% - 33px); - color: white; - font-weight: bold; - background-color: #337ab7; - padding: 20px 20px; - border-radius: 10px; -} -ngeo-offline .modal-content { - width: 300px; -} -ngeo-offline .modal-body button { - display: block; - margin: 5px auto; - width: 250px; -} -.offline-msg { - display: none; -} -.offline .offline-msg { - display: block; -} diff --git a/examples/offline.html b/examples/offline.html deleted file mode 100644 index aa0a7bb76241..000000000000 --- a/examples/offline.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - Offline example - - - - - -
You are currently offline.
- - - - -

- This example shows how to use the - ngeo-offline - component. -

- - - diff --git a/examples/offline.js b/examples/offline.js deleted file mode 100644 index 28af2ba81be6..000000000000 --- a/examples/offline.js +++ /dev/null @@ -1,101 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2018-2022 Camptocamp SA -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of -// this software and associated documentation files (the "Software"), to deal in -// the Software without restriction, including without limitation the rights to -// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -// the Software, and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -import '@fortawesome/fontawesome-free/css/fontawesome.min.css'; -import './offline.css'; -import './common_dependencies'; -import olMap from 'ol/Map'; - -import olView from 'ol/View'; -import olLayerTile from 'ol/layer/Tile'; -import olSourceOSM from 'ol/source/OSM'; -import gmfMapComponent from 'gmf/map/component'; -import options from './options'; -import ngeoOfflineModule from 'ngeo/offline/module'; -import ngeoOfflineConfiguration from 'ngeo/offline/Configuration'; -import ngeoMapFeatureOverlayMgr from 'ngeo/map/FeatureOverlayMgr'; -import NgeoOfflineServiceManager from 'ngeo/offline/ServiceManager'; -import angular from 'angular'; - -class MainController { - /** - * @param {import('ngeo/offline/NetworkStatus').default} ngeoNetworkStatus ngeo network status service. - * @param {NgeoOfflineServiceManager} ngeoOfflineServiceManager ngeo offline service. - * @ngInject - */ - constructor(ngeoNetworkStatus, ngeoOfflineServiceManager) { - /** - * Save a square of 10 km sideways (Map's unit is the meter). - * - * @type {number} - * @export - */ - this.offlineExtentSize = 10000; - - /** - * @type {ngeoNetworkStatus} - * @export - */ - this.ngeoNetworkStatus = ngeoNetworkStatus; - - /** - * @type {olMap} - * @export - */ - this.map = new olMap({ - layers: [ - new olLayerTile({ - source: new olSourceOSM(), - }), - ], - view: new olView({ - center: [352379, 5172733], - zoom: 4, - }), - }); - - ngeoMapFeatureOverlayMgr.init(this.map); - - ngeoOfflineServiceManager.setSaveService('offlineDownloader'); - ngeoOfflineServiceManager.setRestoreService('ngeoOfflineRestorer'); - } -} - -/** @type {!angular.IModule} **/ -const myModule = angular.module('app', [ - 'gettext', - gmfMapComponent.name, - ngeoOfflineModule.name, - NgeoOfflineServiceManager.module.name, -]); - -myModule.value('ngeoOfflineTestUrl', '../../src/offline/component.html'); - -// Define the offline download configuration service -myModule.service('ngeoOfflineConfiguration', ngeoOfflineConfiguration); - -myModule.controller('MainController', MainController); - -myModule.constant('ngeoTilesPreloadingLimit', 0); - -options(myModule); - -export default MainController; diff --git a/examples/permalink-ref.png b/examples/permalink-ref.png index 6c437565d0d8..cb55cb8689fe 100644 Binary files a/examples/permalink-ref.png and b/examples/permalink-ref.png differ diff --git a/examples/query-ref.png b/examples/query-ref.png index 6e7a8321dfb5..7c49e90ea18d 100644 Binary files a/examples/query-ref.png and b/examples/query-ref.png differ diff --git a/examples/recenter-ref.png b/examples/recenter-ref.png index 6a58648ac400..0eae60f286c6 100644 Binary files a/examples/recenter-ref.png and b/examples/recenter-ref.png differ diff --git a/examples/rotate-ref.png b/examples/rotate-ref.png index 7196e9f8752b..d2b9caa4db6f 100644 Binary files a/examples/rotate-ref.png and b/examples/rotate-ref.png differ diff --git a/examples/routing-ref.png b/examples/routing-ref.png index acc8d862758e..a096ff3bb11a 100644 Binary files a/examples/routing-ref.png and b/examples/routing-ref.png differ diff --git a/examples/scaleselector-ref.png b/examples/scaleselector-ref.png index 9832285b43ec..0f2d163f7147 100644 Binary files a/examples/scaleselector-ref.png and b/examples/scaleselector-ref.png differ diff --git a/examples/search-ref.png b/examples/search-ref.png index 8ba3290c1204..73e9705786e0 100644 Binary files a/examples/search-ref.png and b/examples/search-ref.png differ diff --git a/examples/simple-ref.png b/examples/simple-ref.png index 342d9fcec50e..ab4eebccdf4a 100644 Binary files a/examples/simple-ref.png and b/examples/simple-ref.png differ diff --git a/examples/svg-ref.png b/examples/svg-ref.png index 5b2139403dfd..ec0cb58ffbf0 100644 Binary files a/examples/svg-ref.png and b/examples/svg-ref.png differ diff --git a/examples/toolActivate-ref.png b/examples/toolActivate-ref.png index 5f84c5d6c4a9..285deadf68b8 100644 Binary files a/examples/toolActivate-ref.png and b/examples/toolActivate-ref.png differ