auto-sync: 2026-05-06 00:20:01

This commit is contained in:
Stream
2026-05-06 00:20:01 +03:00
parent b9b8587da4
commit 435d1e0227

View File

@@ -552,6 +552,7 @@ function formatSegmentDist(m) {
// First waypoint snaps to geometry[0], last to geometry[n-1] — guarantees sum == full route length.
function getRouteSegmentDistances() {
const route = routeResults[activeRouteIdx];
console.log('[seg] route=', route ? 'ok' : 'null', 'geometry=', route?.geometry ? 'ok' : 'null', 'coords=', route?.geometry?.coordinates?.length);
if (!route || !route.geometry || !route.geometry.coordinates) return null;
const coords = route.geometry.coordinates; // [[lon, lat], ...]
@@ -612,6 +613,7 @@ async function renderWaypointsList() {
const segDists = (routeResults.length > 0 && activeRouteIdx >= 0)
? getRouteSegmentDistances()
: null;
console.log('[wl] routeResults.length=', routeResults.length, 'activeRouteIdx=', activeRouteIdx, 'segDists=', segDists);
let html = routeWaypoints.map((wp, i) => {
const isStart = i === 0;
@@ -619,8 +621,8 @@ async function renderWaypointsList() {
const label = isStart ? 'S' : isEnd ? 'F' : String(i);
const color = isStart ? '#2EA043' : isEnd ? '#FF3B1F' : '#0066ff';
const coordText = `${wp.lat.toFixed(3)}, ${wp.lon.toFixed(3)}`;
const distStr = i > 0 && segDists ? formatSegmentDist(segDists[i]) :
i > 0 ? formatSegmentDist(haversineM(routeWaypoints[i-1], wp)) : '';
const distStr = i > 0 && segDists ? formatSegmentDist(segDists[i]) + ' ✓' :
i > 0 ? formatSegmentDist(haversineM(routeWaypoints[i-1], wp)) + ' ~' : '';
return `<div class="wl-item" id="wl-item-${i}" data-idx="${i}">
<div class="wl-pin">${waypointPinSvg(label, color)}</div>
<div class="wl-info">