From b3a4614c5987718ea83317147b31a9d7caacc18e Mon Sep 17 00:00:00 2001 From: "fefe.clochette" Date: Sat, 20 Jun 2026 19:08:54 +0200 Subject: [PATCH] itineraire waze / G / Apple --- modules/holidays/holidays.js | 38 +++++++++++++++++++++++++++++++ modules/holidays/views/detail.php | 37 +++++++++++++++++++++++++----- 2 files changed, 69 insertions(+), 6 deletions(-) diff --git a/modules/holidays/holidays.js b/modules/holidays/holidays.js index 51f2d37..ba7c3f1 100644 --- a/modules/holidays/holidays.js +++ b/modules/holidays/holidays.js @@ -1123,3 +1123,41 @@ function closeTransitModal() { document.getElementById("transitModal").style.display = "none"; document.body.classList.remove("no-scroll"); } + +// ============================================================================ +// CHOIX DE L'APPLICATION GPS (Google Maps, Waze, Apple Maps) +// ============================================================================ +window.currentGpsTarget = { lat: 0, lng: 0 }; + +function openGpsModal(lat, lng) { + window.currentGpsTarget = { lat: lat, lng: lng }; + document.getElementById("gpsModal").style.display = "flex"; + document.body.classList.add("no-scroll"); +} + +function closeGpsModal() { + document.getElementById("gpsModal").style.display = "none"; + document.body.classList.remove("no-scroll"); +} + +function launchGpsApp(app) { + const lat = window.currentGpsTarget.lat; + const lng = window.currentGpsTarget.lng; + let url = ""; + + if (app === "waze") { + // Force l'ouverture de Waze en mode navigation + url = `https://waze.com/ul?ll=${lat},${lng}&navigate=yes`; + } else if (app === "gmaps") { + // Force l'ouverture de Google Maps en mode itinéraire + url = `https://www.google.com/maps/dir/?api=1&destination=${lat},${lng}`; + } else if (app === "amaps") { + // Force l'ouverture d'Apple Maps + url = `http://maps.apple.com/?daddr=${lat},${lng}`; + } + + if (url !== "") { + window.open(url, "_blank"); + closeGpsModal(); + } +} diff --git a/modules/holidays/views/detail.php b/modules/holidays/views/detail.php index 3343214..fda3132 100644 --- a/modules/holidays/views/detail.php +++ b/modules/holidays/views/detail.php @@ -297,13 +297,12 @@ $pctSaved = $cost > 0 ? min(100 - $pctPaid, ($saved / $cost) * 100) : 0;
- - 🗺️ - + title="Y aller avec le GPS" + style="width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;"> + 🧭 + @@ -472,6 +471,32 @@ $pctSaved = $cost > 0 ? min(100 - $pctPaid, ($saved / $cost) * 100) : 0;
+
+
+
+

🧭 Y aller avec...

+ +
+ +
+ + + + + +
+
+
+