diff --git a/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/MainController.js b/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/MainController.js index 4084b8ff2..7456c9528 100644 --- a/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/MainController.js +++ b/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/MainController.js @@ -844,7 +844,11 @@ const MainController = function( // Super hack because we do not have access to the offline button controller this.map_.superHackIsItOKToSaveOffline = () => { const isIOS = document.location.search.includes("localforage=ios") || document.location.search.includes("fakeios"); - return !isIOS || !this.backgroundLayerMgr_.get(this.map).getMapBoxMap + if (isIOS) { + const layer = this.backgroundLayerMgr_.get(this.map); + return layer && !layer.getMapBoxMap; + } + return true; }; /** diff --git a/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/main.html.ejs b/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/main.html.ejs index ff3115e70..62a445624 100644 --- a/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/main.html.ejs +++ b/geoportal/geoportailv3_geoportal/static-ngeo/js/apps/main.html.ejs @@ -22,11 +22,22 @@ diff --git a/geoportal/geoportailv3_geoportal/static-ngeo/js/mvtstyling/MvtStylingService.js b/geoportal/geoportailv3_geoportal/static-ngeo/js/mvtstyling/MvtStylingService.js index 63f551565..7beacb961 100644 --- a/geoportal/geoportailv3_geoportal/static-ngeo/js/mvtstyling/MvtStylingService.js +++ b/geoportal/geoportailv3_geoportal/static-ngeo/js/mvtstyling/MvtStylingService.js @@ -11,7 +11,14 @@ const ls_ = window.localStorage; const LS_KEY_EXPERT = 'expertStyling'; const LS_KEY_MEDIUM = 'mediumStyling'; const LS_KEY_HILLSHADE = 'hillshadeStyling'; -export const defaultMapBoxStyle = 'https://vectortiles.geoportail.lu/styles/roadmap/style.json'; + +function getDefaultMapBoxStyleUrl() { + const searchParams = new URLSearchParams(document.location.search); + const embeddedServer = searchParams.get('embeddedserver'); + const url = (embeddedServer ? 'http://' + embeddedServer : 'https://vectortiles.geoportail.lu') + '/styles/roadmap/style.json'; + return url; +} +export const defaultMapBoxStyle = getDefaultMapBoxStyleUrl(); export const defaultMapBoxStyleXYZ = 'https://vectortiles.geoportail.lu/styles/roadmap/{z}/{x}/{y}.png'; diff --git a/geoportal/geoportailv3_geoportal/static-ngeo/js/offline/Configuration.js b/geoportal/geoportailv3_geoportal/static-ngeo/js/offline/Configuration.js index f0a303682..0bf800689 100644 --- a/geoportal/geoportailv3_geoportal/static-ngeo/js/offline/Configuration.js +++ b/geoportal/geoportailv3_geoportal/static-ngeo/js/offline/Configuration.js @@ -42,7 +42,7 @@ const exports = class extends NgeoConfiguration { */ this.appMymaps_ = appMymaps; - const isMobile = location.search.includes('localforage=android') || location.search.includes('localforage=ios'); + const isMobile = location.search.includes('localforage=android') || location.search.includes('localforage=ios') || location.search.includes('fakeios'); /** * @type {number} diff --git a/prepare_ios_mvt_bundle.sh b/prepare_ios_mvt_bundle.sh new file mode 100755 index 000000000..876fcb597 --- /dev/null +++ b/prepare_ios_mvt_bundle.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/data/hillshade-lu.json + +rm -rf ios_bundle; mkdir ios_bundle; cd ios_bundle +wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/data/omt-geoportail-lu.json +wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/fonts/Noto%20Sans%20Regular/0-255.pbf +wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/fonts/Noto%20Sans%20Regular/256-511.pbf +wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/fonts/Noto%20Sans%20Bold/0-255.pbf +wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/fonts/Noto%20Sans%20Bold/256-511.pbf +wget --no-host-directories --force-directories https://vectortiles.geoportail.lu/styles/roadmap/style.json +sed 'sYhttps://vectortiles.geoportail.lu/data/omt-geoportail-lu.jsonYhttp://localhost:8765/data/omt-geoportail-lu.jsonYg' -i styles/roadmap/style.json +sed 'sYhttps://vectortiles.geoportail.lu/fonts/Yhttp://localhost:8765/fonts/Yg' -i styles/roadmap/style.json +wget http://download.geoportail.lu/index.php/s/o7ZmTx7ySpgZgF7/download -O omt-geoportail-lu.mbtiles