p.id === selected.id) ?? selected) : null;
+
return (
@@ -111,8 +147,10 @@ export default function GoogleJobMap({ points, fitBounds = true, heightPx = 480
defaultZoom={points[0] ? 18 : DEFAULT_ZOOM}
mapTypeId="hybrid"
gestureHandling="greedy"
+ onClick={() => setSelected(null)}
>
-
+
+ {selectedCurrent && setSelected(null)} />}
diff --git a/web/components/map/types.ts b/web/components/map/types.ts
index 16822f0..f678799 100644
--- a/web/components/map/types.ts
+++ b/web/components/map/types.ts
@@ -6,10 +6,16 @@ export interface MapPoint {
id: string;
lat: number;
lng: number;
+ altitude: number | null;
utilityType: string;
fixType: string;
sequence: number | null;
recordedAt: string;
+ // GPS quality
+ hAccuracy: number | null;
+ vAccuracy: number | null;
+ satellites: number | null;
+ hdop: number | null;
// Locator receiver telemetry (all optional — depends on the instrument)
depth: number | null;
frequencyHz: number | null;
@@ -17,6 +23,7 @@ export interface MapPoint {
signalDb: number | null;
gainDb: number | null;
locateMode: string | null;
+ phaseDeg: number | null;
compassDeg: number | null;
distortionPct: number | null;
}
@@ -31,6 +38,35 @@ export function pointSummary(p: MapPoint): string {
return parts.join(' · ');
}
+// Ordered [label, value] pairs for a full detail readout — only fields the
+// point actually has are included, since instruments vary in what they report.
+export function pointDetailRows(p: MapPoint): Array<[string, string]> {
+ const rows: Array<[string, string]> = [
+ ['Utility', p.utilityType],
+ ['GPS fix', p.fixType],
+ ['Recorded', new Date(p.recordedAt).toLocaleString()],
+ ];
+ if (p.sequence != null) rows.push(['Sequence', String(p.sequence)]);
+ if (p.depth != null) rows.push(['Depth', `${p.depth} m`]);
+ if (p.frequencyHz != null) {
+ rows.push(['Frequency', p.frequencyHz >= 1000 ? `${p.frequencyHz / 1000} kHz` : `${p.frequencyHz} Hz`]);
+ }
+ if (p.currentMa != null) rows.push(['Current', `${p.currentMa} mA`]);
+ if (p.signalDb != null) rows.push(['Signal', `${p.signalDb} dB`]);
+ if (p.gainDb != null) rows.push(['Gain', `${p.gainDb} dB`]);
+ if (p.locateMode) rows.push(['Locate mode', p.locateMode]);
+ if (p.phaseDeg != null) rows.push(['Phase', `${p.phaseDeg}°`]);
+ if (p.compassDeg != null) rows.push(['Compass', `${p.compassDeg}°`]);
+ if (p.distortionPct != null) rows.push(['Distortion', `${p.distortionPct}%`]);
+ if (p.altitude != null) rows.push(['Altitude', `${p.altitude} m`]);
+ if (p.hAccuracy != null) rows.push(['Horiz. accuracy', `±${p.hAccuracy} m`]);
+ if (p.vAccuracy != null) rows.push(['Vert. accuracy', `±${p.vAccuracy} m`]);
+ if (p.satellites != null) rows.push(['Satellites', String(p.satellites)]);
+ if (p.hdop != null) rows.push(['HDOP', String(p.hdop)]);
+ rows.push(['Coordinates', `${p.lat.toFixed(7)}, ${p.lng.toFixed(7)}`]);
+ return rows;
+}
+
export interface JobMapProps {
points: MapPoint[];
// Pan/zoom to fit all points whenever their count changes