asdfasdf
This commit is contained in:
@@ -588,6 +588,8 @@ const PropertyDetail = () => {
|
||||
setGpsTracePoints([]);
|
||||
setGpsDistance(0);
|
||||
setGpsAccuracy(null);
|
||||
// Stop passive watch if running (used for Points mode warmup)
|
||||
if (gpsWatchId) { navigator.geolocation.clearWatch(gpsWatchId); setGpsWatchId(null); }
|
||||
};
|
||||
|
||||
const completeTracing = () => {
|
||||
@@ -1142,6 +1144,18 @@ const PropertyDetail = () => {
|
||||
if (gpsWatchId) { navigator.geolocation.clearWatch(gpsWatchId); setGpsWatchId(null); }
|
||||
clearGpsPoints();
|
||||
setIsGPSPointsMode(true);
|
||||
// Start passive GPS watch to warm up accuracy for Points mode
|
||||
if (navigator.geolocation) {
|
||||
const id = navigator.geolocation.watchPosition((pos)=>{
|
||||
const { latitude, longitude, accuracy } = pos.coords;
|
||||
setGpsAccuracy(accuracy || null);
|
||||
// Populate smoothing buffer without adding a point yet
|
||||
try { addSampleAndSmooth(latitude, longitude, accuracy); } catch {}
|
||||
}, (err)=>{
|
||||
console.warn('GPS warmup error', err?.message);
|
||||
}, { enableHighAccuracy: true, maximumAge: 1000, timeout: 15000 });
|
||||
setGpsWatchId(id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="font-medium">GPS Points (walk and mark)</div>
|
||||
|
||||
Reference in New Issue
Block a user