itineraire waze / G / Apple
Deploy HouseHub / deploy (push) Successful in 1s

This commit is contained in:
2026-06-20 19:08:54 +02:00
parent 18740c5e1b
commit b3a4614c59
2 changed files with 69 additions and 6 deletions
+38
View File
@@ -1123,3 +1123,41 @@ function closeTransitModal() {
document.getElementById("transitModal").style.display = "none"; document.getElementById("transitModal").style.display = "none";
document.body.classList.remove("no-scroll"); 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();
}
}
+31 -6
View File
@@ -297,13 +297,12 @@ $pctSaved = $cost > 0 ? min(100 - $pctPaid, ($saved / $cost) * 100) : 0;
<div class="hol-step-actions"> <div class="hol-step-actions">
<span class="hol-step-price"><?= number_format($step['total_amount'], 2, ',', ' ') ?> €</span> <span class="hol-step-price"><?= number_format($step['total_amount'], 2, ',', ' ') ?> €</span>
<a href="https://www.google.com/maps/dir/?api=1&destination=<?= $step['lat'] ?>,<?= $step['lng'] ?>" <button onclick="openGpsModal(<?= $step['lat'] ?>, <?= $step['lng'] ?>)"
target="_blank"
class="btn-icon-small" class="btn-icon-small"
title="Y aller avec le GPS (Maps/Waze)" title="Y aller avec le GPS"
style="text-decoration:none; display:inline-flex; align-items:center; justify-content:center; width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;"> style="width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;">
🗺️ 🧭
</a> </button>
<button onclick='openPlanningModal(<?= htmlspecialchars(json_encode($step), ENT_QUOTES, "UTF-8") ?>)' class="btn-icon-small" title="<?= tr('hdl_view_planning') ?>" style="width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;">📅</button> <button onclick='openPlanningModal(<?= htmlspecialchars(json_encode($step), ENT_QUOTES, "UTF-8") ?>)' class="btn-icon-small" title="<?= tr('hdl_view_planning') ?>" style="width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;">📅</button>
<button onclick='openCheckpointModal("edit", <?= htmlspecialchars(json_encode($step), ENT_QUOTES, "UTF-8") ?>)' class="btn-icon-small" title="<?= tr('btn_edit') ?>" style="width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;">✏️</button> <button onclick='openCheckpointModal("edit", <?= htmlspecialchars(json_encode($step), ENT_QUOTES, "UTF-8") ?>)' class="btn-icon-small" title="<?= tr('btn_edit') ?>" style="width:26px!important; height:26px!important; font-size:0.8rem; min-width:26px!important; min-height:26px!important;">✏️</button>
@@ -472,6 +471,32 @@ $pctSaved = $cost > 0 ? min(100 - $pctPaid, ($saved / $cost) * 100) : 0;
</div> </div>
</div> </div>
<div id="gpsModal" class="pf-modal">
<div class="pf-modal-content" style="max-width: 320px; text-align: center; padding: 20px;">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:20px;">
<h3 style="margin:0; font-size: 1.2rem; color: var(--text-main);">🧭 Y aller avec...</h3>
<button type="button" onclick="closeGpsModal()" class="pf-modal-close">×</button>
</div>
<div style="display: flex; flex-direction: column; gap: 12px;">
<button onclick="launchGpsApp('waze')" class="pf-btn btn-secondary" style="font-size: 1.1rem; padding: 12px; display:flex; align-items:center; justify-content:center; gap:10px;">
<img src="https://cdn.simpleicons.org/waze/05C8F0" alt="Waze" style="width: 24px; height: 24px;">
Waze
</button>
<button onclick="launchGpsApp('gmaps')" class="pf-btn btn-secondary" style="font-size: 1.1rem; padding: 12px; display:flex; align-items:center; justify-content:center; gap:10px;">
<img src="https://cdn.simpleicons.org/googlemaps" alt="Google Maps" style="width: 24px; height: 24px;">
Google Maps
</button>
<button onclick="launchGpsApp('amaps')" class="pf-btn btn-secondary" style="font-size: 1.1rem; padding: 12px; display:flex; align-items:center; justify-content:center; gap:10px;">
<img src="https://cdn.simpleicons.org/apple/000000" alt="Apple Maps" style="width: 24px; height: 24px;">
Apple Maps
</button>
</div>
</div>
</div>
<?php include __DIR__ . '/modal.php'; ?> <?php include __DIR__ . '/modal.php'; ?>
<script> <script>