auto-sync: 2026-05-06 11:40:01
This commit is contained in:
46
tasks/enduro-trails/prototype/static/app.js
vendored
46
tasks/enduro-trails/prototype/static/app.js
vendored
@@ -456,10 +456,37 @@ function addWaypointMode() {
|
||||
window._map.getCanvas().style.cursor = 'crosshair';
|
||||
// Hide main sheet so the map is visible for tapping
|
||||
closeSheet('sheet-route');
|
||||
// Show hint in mini-bar
|
||||
const statsEl = document.getElementById('mini-stats');
|
||||
if (statsEl) statsEl.textContent = 'Тапни на карте для добавления точки';
|
||||
// Show onboarding mini-bar for "add waypoint" mode
|
||||
_showMiniOnboardWaypoint();
|
||||
}
|
||||
|
||||
function _showMiniOnboardWaypoint() {
|
||||
// Reuse mini-onboard UI with "add waypoint" hint
|
||||
const idx = routeWaypoints.length; // next waypoint index
|
||||
const label = String(idx);
|
||||
const color = '#0066ff';
|
||||
const hint = 'Тапни на карте — добавить точку';
|
||||
|
||||
document.getElementById('mini-onboard').style.display = 'flex';
|
||||
document.getElementById('mini-dot').style.display = 'none';
|
||||
document.getElementById('mini-label').style.display = 'none';
|
||||
document.getElementById('mini-stats').style.display = 'none';
|
||||
document.getElementById('mini-wheel').style.display = 'none';
|
||||
const arrows = document.querySelector('.mini-route-arrows');
|
||||
if (arrows) arrows.style.display = 'none';
|
||||
const addBtn = document.getElementById('mini-add-btn');
|
||||
if (addBtn) addBtn.style.display = 'none';
|
||||
|
||||
document.getElementById('mini-onboard-pin').innerHTML = waypointPinSvg(label, color);
|
||||
document.getElementById('mini-onboard-hint').textContent = hint;
|
||||
|
||||
document.getElementById('sheet-route-mini').classList.add('visible');
|
||||
const ctrl = document.getElementById('map-controls-r');
|
||||
if (ctrl) ctrl.style.bottom = '148px';
|
||||
|
||||
// Search button
|
||||
const searchBtn = document.getElementById('mini-onboard-search-btn');
|
||||
searchBtn.onclick = () => toggleMiniOnboardSearch('waypoint');
|
||||
}
|
||||
|
||||
// ─── Маркеры точек ─────────────────────────────────────────────────
|
||||
@@ -1478,6 +1505,7 @@ function initRouteClicks(map) {
|
||||
} else {
|
||||
routeWaypoints.push({ lon: lng, lat: lat });
|
||||
}
|
||||
hideMiniOnboard();
|
||||
rebuildWaypointMarkers(); renderWaypointsList();
|
||||
if (routeWaypoints.length >= 2) debounceBuildRoute();
|
||||
updateMiniRouteCard();
|
||||
@@ -2425,8 +2453,16 @@ function _selectMiniOnboardResult(type, lat, lon, name) {
|
||||
const wp = { lat: parseFloat(lat), lon: parseFloat(lon) };
|
||||
if (type === 'start') {
|
||||
routeWaypoints.unshift(wp);
|
||||
} else {
|
||||
} else if (type === 'finish') {
|
||||
routeWaypoints.push(wp);
|
||||
} else if (type === 'waypoint') {
|
||||
// Insert before last waypoint (same as addingWaypoint tap logic)
|
||||
if (routeWaypoints.length >= 2) {
|
||||
routeWaypoints.splice(routeWaypoints.length - 1, 0, wp);
|
||||
} else {
|
||||
routeWaypoints.push(wp);
|
||||
}
|
||||
addingWaypoint = false;
|
||||
}
|
||||
document.getElementById('mini-onboard-search-panel').style.display = 'none';
|
||||
rebuildWaypointMarkers();
|
||||
@@ -2436,7 +2472,7 @@ function _selectMiniOnboardResult(type, lat, lon, name) {
|
||||
hideMiniOnboard();
|
||||
debounceBuildRoute();
|
||||
} else {
|
||||
showRouteOnboardingMini(); // update to finish prompt
|
||||
showRouteOnboardingMini(); // switch to finish
|
||||
}
|
||||
updateMiniRouteCard();
|
||||
}
|
||||
|
||||
@@ -68,9 +68,11 @@
|
||||
<path d="M3 6h18M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>
|
||||
</svg>
|
||||
</button>
|
||||
<!-- Крестик -->
|
||||
<button class="sheet-close" onclick="toggleRouteMode()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
|
||||
<!-- Свернуть -->
|
||||
<button class="sheet-close" onclick="minimizeSheet('sheet-route')" title="Свернуть">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="6 9 12 15 18 9"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class="sheet-body">
|
||||
|
||||
Reference in New Issue
Block a user