diff --git a/frontend/src/pages/Watering/Watering.js b/frontend/src/pages/Watering/Watering.js index 3493709..75eb386 100644 --- a/frontend/src/pages/Watering/Watering.js +++ b/frontend/src/pages/Watering/Watering.js @@ -586,25 +586,25 @@ const Watering = () => {
-
{guiding && currentPos && points[guideIndex] ? (()=>{ - const tgt = {lat:Number(points[guideIndex].lat), lng:Number(points[guideIndex].lng)}; +
{guiding && currentPos && sortedPoints[guideIndex] ? (()=>{ + const tgt = {lat:Number(sortedPoints[guideIndex].lat), lng:Number(sortedPoints[guideIndex].lng)}; const dist = distanceFeet(currentPos, tgt); const brg = bearingDegrees(currentPos, tgt); if (dist <= 15) { - return Arrived at #{points[guideIndex].sequence} • {dist.toFixed(0)} ft; + return Arrived at #{guideIndex+1} • {dist.toFixed(0)} ft; } - return <>→ {brg}° • {dist.toFixed(0)} ft • Point #{points[guideIndex].sequence}; + return <>→ {brg}° • {dist.toFixed(0)} ft • Point #{guideIndex+1}; })() : 'Map'}
{!guiding ? ( - + ) : ( <> - + )} @@ -621,26 +621,26 @@ const Watering = () => { ))} {placing && } - {guiding && currentPos && points[guideIndex] && ( + {guiding && currentPos && sortedPoints[guideIndex] && ( <> {/* Current location marker */} {/* Line to target */} - + {/* Arrival ring */} - + )} {/* Legend overlay */} - {points.length > 0 && ( + {sortedPoints.length > 0 && (
Legend
    - {points.map(pt => ( + {sortedPoints.map((pt, idx) => (
  • - #{pt.sequence} + #{idx+1} {pt.equipment_name || (pt.sprinkler_head_type||'-').replace('_',' ')} {pt.sprinkler_gpm ? (• {Number(pt.sprinkler_gpm)} gpm) : null} {pt.duration_minutes ? (• {pt.duration_minutes} min) : null} @@ -650,7 +650,7 @@ const Watering = () => {
)} - {points.map(pt => { + {sortedPoints.map(pt => { const cov = computeCoverage({ type: pt.sprinkler_head_type, throwFeet: parseFloat(pt.sprinkler_throw_feet||0),