auto-sync: 2026-05-06 00:30:01
This commit is contained in:
6
tasks/enduro-trails/prototype/static/app.js
vendored
6
tasks/enduro-trails/prototype/static/app.js
vendored
@@ -552,7 +552,6 @@ 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], ...]
|
||||
@@ -613,7 +612,6 @@ 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;
|
||||
@@ -621,8 +619,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">
|
||||
|
||||
Reference in New Issue
Block a user