From 65225d791ec8dc03cbf171181f4d5d2a77879732 Mon Sep 17 00:00:00 2001 From: azarz Date: Thu, 14 Dec 2023 19:13:31 +0100 Subject: [PATCH] feat(route-draw): enhancements --- deploiement-appli-mobile.md | 82 ++++++++++++++++++++ src/html/img/layers/PLAN.IGN.INTERACTIF.jpg | Bin 5083 -> 20032 bytes src/js/data-layer/base-layer-config.json | 7 +- src/js/data-layer/layers-config.json | 9 ++- src/js/elevation-line-control.js | 9 ++- src/js/globals.js | 2 +- src/js/index.js | 3 - src/js/interactivity.js | 36 +++++++-- src/js/layer-catalogue.js | 1 + src/js/layer-switcher.js | 1 - src/js/map-listeners.js | 2 +- src/js/nav.js | 14 ++-- src/js/route-draw/route-draw-dom.js | 15 ++-- src/js/route-draw/route-draw-styles.js | 4 +- src/js/route-draw/route-draw.js | 72 ++++++++++++++--- www/data/poi-osm-style.json | 4 +- 16 files changed, 213 insertions(+), 48 deletions(-) create mode 100644 deploiement-appli-mobile.md diff --git a/deploiement-appli-mobile.md b/deploiement-appli-mobile.md new file mode 100644 index 00000000..6f951ecd --- /dev/null +++ b/deploiement-appli-mobile.md @@ -0,0 +1,82 @@ +# Application mobile Géoportail - procédure de déploiement + +## Prérequis + +- [node](https://nodejs.org/en/) +- [Cordova](https://cordova.apache.org/#getstarted) + +## Capacitor +- `npm run build` +- `npx cap sync` +- `cd android && ./gradlew assembleRelease` +- `zipalign 4 ./android/app/build/outputs/apk/release/app-release-signed.apk ./android/app/build/outputs/apk/release/app-release-aligned.apk` +- `apksigner sign --ks //ign.keystore --v1-signing-enabled true --v2-signing-enabled true ./android/app/build/outputs/apk/release/app-release-aligned.apk` + +- Génération des assets : https://github.com/ionic-team/capacitor-assets + +## Android + +### Prérequis spécifiques +- Avoir le keystore ign.keystore sur la machine +- `zipalign` (`apt install zipalign`) +- [Installer les dépendances de Cordova pour Android (JDK, Android SDK, etc)](https://cordova.apache.org/docs/en/latest/guide/platforms/android/#installing-the-requirements) + +### Étapes + +Voici les étapes à réaliser pour déployer la dernière version du code de l'application Android du dépôt de l'UL : + +#### Construction du binaire +- `git clone https://gitlab.ul.geoportail.rie.gouv.fr/ign/appli-mobile-geoportail` +- `cd appli-mobile-geoportail` +- `git checkout android` +- `cordova platform add android` +- `npm install` +- `cordova build android --release --prod -- --packageType apk` +- `jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore //ign.keystore ./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk geoportail_mobile` (passphrase : G3oportail) +- `zipalign 4 ./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk ./platforms/android/app/build/outputs/apk/release/app-release.apk` +- `apksigner sign --ks //ign.keystore --v1-signing-enabled true --v2-signing-enabled true ./platforms/android/app/build/outputs/apk/release/app-release.apk` + +Le fichier `app-release.apk` ainsi créé est signé et est prête à être déposé sur la Google Play Console. + +#### Déploiement en bêta + +- Accéder à la [Google Play Console](https://play.google.com/console/developers/4728683733784898454/app-list) et sélectionner l'application Géoportail (le nom varie, mais a toujours en sous-titre fr.ign.geoportail) + +- Sur le panneau situé à gauche, dans la section `Publier`, dans la sous-section `Tests`, sélectionner (par exemple) `Test ouvert`. + +- Cliquer sur `Créer une release` en haut à droite. + +- Dans la section `Apps bundles et APK`, cliquer sur `Importer` et sélectionner le fichier créé précédemment : `app-release.apk`. + +- Remplir les informations, enregistrer puis examiner la release. + +- Pour promouvoir la release, dans l'écran récapitulatif des tests ouverts, sous la section `Releases`, cliquer sur `Promouvoir la release` + +## iOS + +### Prérequis spécifiques +- N'est possible que sur Mac +- [Installer les dépendances de Cordova pour iOS](https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#installing-the-requirements) +- Avoir dans le trouseau d'accès un certificat de publication App Store + +### Étapes + +#### Construction et téléversement du binaire +- `git clone https://gitlab.ul.geoportail.rie.gouv.fr/ign/appli-mobile-geoportail` +- `cd appli-mobile-geoportail` +- `git checkout ios` +- `cordova platform add ios` +- `cordova build ios ` + +- Un fichier `Géoportail.xcodeproj` a été créé dans le dossier `./platforms/ios`. L'ouvrir avec XCode. +- Dans XCode, dans l'onglet Certificats et signatures, entrer le certificat de publication App Store. +- Dans le menu général (barre tout en haut de l'écran) : `Product > Destination > Any iOS device (arm64)` +- Dans le menu général (barre tout en haut de l'écran) : `Product > Archive` + +- Une nouvelle fenêtre s'ouvre après la construction du binaire (quelques minutes). Cliquer sur `Distribute App`. +- Appuyer sur Next et OK 6 fois, jusqu'à ce que l'application soit téléversée. + +#### Déploiement en bêta +- Accéder à [App Store Connect](https://appstoreconnect.apple.com/apps/748345888/testflight/ios) et sélectionner l'application mobile Géoportail. +- Dans la section `TestFlight`, le dernier binaire doit appparaître. Sinon, attendre quelques minutes. +- Cliquer sur la version du build à tester, entrer les informations et les groupes de testeurs, puis lancer la vérification manuelle. diff --git a/src/html/img/layers/PLAN.IGN.INTERACTIF.jpg b/src/html/img/layers/PLAN.IGN.INTERACTIF.jpg index 04ea820d64240be2e47a14ce44eb22861e4dff42..285d3c6e73d927d27eee2205c833b4809e0434fc 100644 GIT binary patch literal 20032 zcmaI6WmH|wvNpPKhakaSgS&fhcb5PQcU!nyaCdiicXxMp4epRYfXlnTz4y7_80X&l zF=uzrdb+B*s(W4j~hSf zzdGmnEdSHYNJ{)K7H2DdQsIB35^KsS5{uY5nh>)yaL@yp*;t46w^$m^gS?xrzTxq@U6pjZJx!MaBOu>$ApB`fsCLU0oSmSsCmc%@~=v zxw#pcSQuGY=s!8=o!o7m4c+K%oyh*vgQ$rU(9y!)*}~42_@5pPjqE_q{G^|n{vQ); z?B(SC+wuQ8S~fQS*!3@NCue1o|54+A<#tkaw>M!_HgU28IRZ^S*~$I`{v5mie?k8+ zerm%bY6k?_nAkc?iSm{+XXEA+ z=V1L0R?61N+0Yhf@*k|l|6tkvf3Z9wjwXiAc8;occGmy#o}#&(vz?Q!At0e3{~;)7sDBYOGz<(Z3=A|J z96UT69OC~?U=R=xP>@h?(9m#52yh5UD9E3Lg7Pn>f4>m_PwoH4{kQhf3qXYh*a9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L3+QVLR zDvso|FVUKuGm>^#NxayzR8{+XNlKl8IDEUMzR{%pxd!&vW2rG>FT#bE)bP&7t}tJ)ZmF_{>t~F>xId@{&<6aWRgE) z0}{I<`NP+IzZx>GjNPq#8!kA;&imSw_LIMp{OMlr^tOgqV#tgF56>q!N)L|{-aVPc z|1In{%~gnYhfj}I%-mh+uYqR23Yze!*Sr&FI&G1mr>3iPEo|WAt*&CbhS;8_s*^jH zojnQnR@bu*RaSLYu7NlMyh}ghk(3*cK3tP;_&kZUJ_3hSP{HF_#H#y|>mfr14^m&rM_JDEpZ2hX8nsX&%etDL7U@|Ie`rLQmL8*X^{kE!RN z0a9~vsFXN{Vc})6P))(vyy`^f)V#e20+!@2$Rs0A|hwD;e$wGH8s^ zZF=>46kN7efl>$zFIR}Z3Y6nryE6@Tw+s{8?!^-Q>@w~f*p;`; z6_cXQY{h~b!BqP`a`w~J-O=)Lj~{BcJDXheyUXwkW>L1&IeoDxU^p{RKVK?3%O=FqO4KQmmkcAbq^1_?tJJ zH-u5KlP-v^G8Kws8sp)twPu~pCqqz=Z2LlFA5F+uZ-XBB@2%Rd0;rmF zFC8rOLfv!H5^1H)U?so+SrfTCtL4a5_NlObJGyT@HSc8ls_p*#)fGG@ zwg`J1735v^1M{c0=c@3xCKlXw#TV 14 actif pour la couche PII + * - si zooms > piiMinZoom actif pour la couche PII * - la couche au dessus est elle un baseLayer ? */ #listen() { @@ -47,7 +50,10 @@ class Interactivity { Globals.manager.addEventListener("movelayer", this.onGetLastLayer); this.map.on("zoom", (e) => { - if (this.pii && this.position && Math.round(e.target.getZoom()) > 10) { + if (this.hardDisabled) { + return; + } + if (this.pii && this.position && Math.round(e.target.getZoom()) > this.piiMinZoom) { this.active(); } else { (this.thematic && this.position) ? this.active() : this.disable(); @@ -69,7 +75,7 @@ class Interactivity { if (layer[0] === this.id) { this.pii = true; this.position = true; - if (Math.round(this.map.getZoom())>14) { + if (Math.round(this.map.getZoom()) > this.piiMinZoom) { this.active(); } else { this.disable(); @@ -89,18 +95,36 @@ class Interactivity { * Active l'indicateur d'activité */ active () { - this.activated = true; + this.hardDisabled = false; + this.shown = true; DOM.$interactivityBtn.style.removeProperty("display"); } /** * Desactive l'indicateur d'activité + * @param {boolean} hard l'interactivité reste désactivée tant qu'active() n'est pas appelée */ disable () { - this.activated = false; + this.shown = false; DOM.$interactivityBtn.style.display = "none"; } + /** + * Desactive l'indicateur d'activité jusqu'à nouvel ordre + */ + hardDisable() { + this.hardDisabled = true; + this.disable(); + } + + /** + * Réactive l'indicateur après désactivation forcée + */ + enable() { + this.hardDisabled = false; + this.map.fire("zoom"); + } + /** * affiche la popup explicative * @public diff --git a/src/js/layer-catalogue.js b/src/js/layer-catalogue.js index 90a8cd1e..6421da48 100644 --- a/src/js/layer-catalogue.js +++ b/src/js/layer-catalogue.js @@ -191,6 +191,7 @@ class LayerCatalogue extends EventTarget { document.querySelectorAll(".baseLayer").forEach((el) => { el.addEventListener('click', (e) => { if (el.classList.contains("selectedLayer") || el.classList.contains("comparedLayer")) { + this.removeLayer(el.id); } else { this.addLayer(el.id); } diff --git a/src/js/layer-switcher.js b/src/js/layer-switcher.js index 52f9ea97..32a12dcc 100644 --- a/src/js/layer-switcher.js +++ b/src/js/layer-switcher.js @@ -612,7 +612,6 @@ class LayerSwitcher extends EventTarget { * @public */ addLayer(id) { - console.log("addLayer") var props = LayersConfig.getLayerProps(id); this.index++; this.layers[id] = { diff --git a/src/js/map-listeners.js b/src/js/map-listeners.js index 8e0ed9c8..a26d79e7 100644 --- a/src/js/map-listeners.js +++ b/src/js/map-listeners.js @@ -68,7 +68,7 @@ const addListeners = () => { // FIXME le mecanisme de GFI est à revoir afin de pouvoir requêter toutes les couches // ou la plus au dessus de la pile. map.on("click", (ev) => { - if (!Globals.interactivity.activated) { + if (!Globals.interactivity.shown) { return; } let features = map.queryRenderedFeatures(ev.point); diff --git a/src/js/nav.js b/src/js/nav.js index cfee602b..87aadc67 100644 --- a/src/js/nav.js +++ b/src/js/nav.js @@ -126,7 +126,7 @@ class MenuNavigation { DOM.$tabContainer.style.backgroundColor = "white"; DOM.$sideBySideBtn.classList.add('d-none'); - Globals.interactivity.disable(); + Globals.interactivity.hardDisable(); Globals.routeDraw.activate(); Globals.currentScrollIndex = 1; break; @@ -168,7 +168,7 @@ class MenuNavigation { DOM.$sideBySideBtn.classList.add('d-none'); DOM.$backTopLeftBtn.classList.remove('d-none'); Globals.isochrone.interactive(true); - Globals.interactivity.disable(); + Globals.interactivity.hardDisable(); Globals.currentScrollIndex = 1; break; case "parameterScreen": @@ -183,6 +183,7 @@ class MenuNavigation { break; case "directionsResults": DOM.$tabContainer.style.backgroundColor = "white"; + Globals.interactivity.enable(); DOM.$tabContainer.style.removeProperty("height"); Globals.currentScrollIndex = 2; break; @@ -212,7 +213,7 @@ class MenuNavigation { DOM.$backTopLeftBtn.classList.remove('d-none'); DOM.$sideBySideBtn.classList.add('d-none'); Globals.directions.interactive(true); - Globals.interactivity.disable(); + Globals.interactivity.hardDisable(); Globals.currentScrollIndex = 2; break; default: @@ -265,7 +266,7 @@ class MenuNavigation { DOM.$sideBySideBtn.classList.remove('d-none'); DOM.$tabContainer.style.removeProperty("background-color"); Globals.routeDraw.clear(); - Globals.interactivity.active(); + Globals.interactivity.enable(); break; case "poi": DOM.$search.style.display = "flex"; @@ -302,7 +303,7 @@ class MenuNavigation { DOM.$sideBySideBtn.classList.remove('d-none'); Globals.isochrone.clear(); Globals.isochrone.interactive(false); - Globals.interactivity.active(); + Globals.interactivity.enable(); break; case "search": DOM.$rech.blur(); @@ -339,6 +340,7 @@ class MenuNavigation { Globals.currentScrollIndex = 1; case "directionsResults": DOM.$tabContainer.style.removeProperty("background-color"); + Globals.interactivity.hardDisable(); isSpecific = true; isFinished = true; break; @@ -359,7 +361,7 @@ class MenuNavigation { DOM.$sideBySideBtn.classList.remove('d-none'); Globals.directions.clear(); Globals.directions.interactive(false); - Globals.interactivity.active(); + Globals.interactivity.enable(); break; default: break; diff --git a/src/js/route-draw/route-draw-dom.js b/src/js/route-draw/route-draw-dom.js index 80fc2c45..6e03af23 100644 --- a/src/js/route-draw/route-draw-dom.js +++ b/src/js/route-draw/route-draw-dom.js @@ -226,7 +226,9 @@ let RouteDrawDOM = { let totalSeconds = 0; this.dom.detailsList.innerHTML = ""; if (data.steps.length > 0) { - for (let i = 0; i < data.points.length; i++) { + // Code facilement adaptable si on veut afficher toutes les étapes (ADDSTEPS) + // ADDSTEPS: i += data.points.length - 1 --> i++ + for (let i = 0; i < data.points.length; i += data.points.length - 1) { const waypoint = data.points[i]; var waypointDiv = document.createElement("div"); waypointDiv.classList.add("routeDrawWaypointDiv"); @@ -254,18 +256,15 @@ let RouteDrawDOM = { waypointLabelDurationTextSpan.innerText = waypointLabelDurationText; if (i > 0) { - const step = data.steps[i - 1]; - + // ADDSTEPS: const step = data.steps[i - 1]; // Ajout de la div du step var stepDiv = document.createElement("div"); stepDiv.classList.add("routeDrawStepDiv"); - stepDiv.innerText = utils.convertDistance(step.properties.distance) + + stepDiv.innerText = utils.convertDistance(data.distance) + // ADDSTEPS: data.distance -> step.porperties.distance " / " + - utils.convertSecondsToTime(step.properties.duration); + utils.convertSecondsToTime(data.duration); // ADDSTEPS: data.duration -> step.porperties.duration this.dom.detailsList.appendChild(stepDiv); - - totalSeconds += step.properties.duration; - + totalSeconds += data.duration; // ADDSTEPS: data.duration -> step.porperties.duration waypointLabelDurationTextSpan.innerText = utils.convertSecondsToTime(totalSeconds); } waypointLabel.appendChild(waypointLabelDurationTextSpan); diff --git a/src/js/route-draw/route-draw-styles.js b/src/js/route-draw/route-draw-styles.js index 6ecf50b1..186cf442 100644 --- a/src/js/route-draw/route-draw-styles.js +++ b/src/js/route-draw/route-draw-styles.js @@ -10,7 +10,7 @@ const layers = { }, paint: { "line-color": "#26a581", - "line-opacity": 0.55, + "line-opacity": ["case", ["boolean", ["get", "invisible"], false], 0, 0.55], "line-width": [ "interpolate", ["exponential", 1.5], @@ -34,7 +34,7 @@ const layers = { }, paint: { "line-color": "#26a581", - "line-opacity": 0.85, + "line-opacity": ["case", ["boolean", ["get", "invisible"], false], 0, 0.85], "line-width": [ "interpolate", ["exponential", 1.5], diff --git a/src/js/route-draw/route-draw.js b/src/js/route-draw/route-draw.js index 4c736df1..1a7b11ac 100644 --- a/src/js/route-draw/route-draw.js +++ b/src/js/route-draw/route-draw.js @@ -7,6 +7,7 @@ import Reverse from "../services/reverse"; import MapLibreGL from "maplibre-gl"; + /** * Interface sur le tracé d'itinéraire * @module RouteDraw @@ -73,7 +74,8 @@ class RouteDraw { // fonction d'event avec bind this.handleAddWayPoint = this.#onAddWayPoint.bind(this); - this.handleTouchStart = this.#onTouchStart.bind(this); + this.handleTouchStartPoint = this.#onTouchStartPoint.bind(this); + this.handleTouchStartLine = this.#onTouchStartLine.bind(this); this.handleTouchMove = this.#onTouchMove.bind(this); this.handleTouchEnd = this.#onTouchEnd.bind(this); this.handleDeletePoint = this.#onDeleteWayPoint.bind(this); @@ -152,7 +154,8 @@ class RouteDraw { */ #listeners() { this.map.on("click", this.handleAddWayPoint); - this.map.on("touchstart", "route-draw-point", this.handleTouchStart); + this.map.on("touchstart", "route-draw-point", this.handleTouchStartPoint); + this.map.on("touchstart", "route-draw-line", this.handleTouchStartLine); DOM.$routeDrawCancel.addEventListener("click", this.handleCancelChange); DOM.$routeDrawRestore.addEventListener("click", this.handleRestoreChange); } @@ -162,17 +165,68 @@ class RouteDraw { */ #deactivate() { this.map.off("click", this.handleAddWayPoint); - this.map.off("touchstart", "route-draw-point", this.handleTouchStart); + this.map.off("touchstart", "route-draw-point", this.handleTouchStartPoint); + this.map.off("touchstart", "route-draw-line", this.handleTouchStartLine); DOM.$routeDrawCancel.removeEventListener("click", this.handleCancelChange); DOM.$routeDrawRestore.removeEventListener("click", this.handleRestoreChange); } + /** + * ecouteur lors du déplacement d'un nouveau waypoint depuis une ligne sur la carte - début + * @param {*} e + * @returns + */ + #onTouchStartLine(e) { + // TODO gestion d'erreurs + // TODO patience + e.preventDefault(); + if (this.map.queryRenderedFeatures(e.point, { + layers: ["route-draw-point"], + })[0]) { + return; + } + const feature = this.map.queryRenderedFeatures(e.point, { + layers: ["route-draw-line"], + })[0]; + console.warn(feature); + this.movedPointIndex = this.data.steps.findIndex((step) => { + return step.properties?.id === feature?.properties?.id; + }) + 1; + var coordinates = e.lngLat; + const newPoint = { + type: "Feature", + geometry: { + type: "Point", + coordinates: [coordinates.lng, coordinates.lat] + }, + properties: { + name: "", + id: this.nextPointId, + } + } + this.nextPointId++; + if (this.movedPointIndex < this.data.steps.length) { + const newStep = JSON.parse(JSON.stringify(this.data.steps[this.movedPointIndex])); + newStep.properties.id = this.nextStepId; + newStep.properties.invisible = true; + this.nextStepId++; + this.data.steps.splice(this.movedPointIndex, 0, newStep); + } + this.data.points.splice(this.movedPointIndex, 0, newPoint); + this.movedPoint = this.data.points[this.movedPointIndex]; + this.movedPoint.properties.highlight = true; + this.#updateSources(); + + this.map.on('touchmove', this.handleTouchMove); + this.map.once('touchend', this.handleTouchEnd); + } + /** * ecouteur lors du déplacement d'un waypoint sur la carte - début * @param {*} e * @returns */ - #onTouchStart(e) { + #onTouchStartPoint(e) { // TODO gestion d'erreurs // TODO patience e.preventDefault(); @@ -220,7 +274,7 @@ class RouteDraw { if (index > 0) { promises.push(this.#computeStep(index - 1)); } - if (index < this.data.steps.length) { + if (index < this.data.points.length - 1) { promises.push(this.#computeStep(index)); } Promise.all(promises).then( () => { @@ -349,7 +403,6 @@ class RouteDraw { * @param {MapLibreGL.LngLat} */ async #computePointName(coordinates){ - let bResponse = false; try { await Reverse.compute({ lon : coordinates.lng, @@ -456,9 +509,6 @@ class RouteDraw { try { await this.#updateElevation(); } catch(err) { - // TODO "Erreur lors de l'ajout du point" - this.map.on("click", this.handleAddWayPoint); - return; } this.data.steps[index].properties.dplus = this.elevation.dplus - lastDPlus; this.data.steps[index].properties.dminus = this.elevation.dminus - lastDMinus; @@ -581,12 +631,12 @@ class RouteDraw { this.delete = false; DOM.$routeDrawDelete.classList.add("inactive"); this.map.off("click", "route-draw-point", this.handleDeletePoint); - this.map.on("touchstart", "route-draw-point", this.handleTouchStart); + this.map.on("touchstart", "route-draw-point", this.handleTouchStartPoint); this.map.on("click", this.handleAddWayPoint); return; } this.delete = true; - this.map.off("touchstart", "route-draw-point", this.handleTouchStart); + this.map.off("touchstart", "route-draw-point", this.handleTouchStartPoint); this.map.off("click", this.handleAddWayPoint); this.map.on("click", "route-draw-point", this.handleDeletePoint); DOM.$routeDrawDelete.classList.remove("inactive"); diff --git a/www/data/poi-osm-style.json b/www/data/poi-osm-style.json index 8515c6c8..ca999deb 100644 --- a/www/data/poi-osm-style.json +++ b/www/data/poi-osm-style.json @@ -23,8 +23,8 @@ "type": "symbol", "source": "poi_osm", "source-layer": "point_interet", - "minzoom": 15, - "maxzoom": 17, + "minzoom": 16, + "maxzoom": 18, "layout": { "visibility": "visible", "icon-image": "{symbo}_17"