diff --git a/static/index.html b/static/index.html index 7bdfdd1..b627e32 100644 --- a/static/index.html +++ b/static/index.html @@ -2738,69 +2738,6 @@ setTimeout(() => map.invalidateSize(), 300); } - // ▶ Called when "📍 Extract GPS" button is clicked in photo preview toolbar - async function extractGpsFromPicked() { - if (!pickedPhotoFile) { - showToast('No photo picked', true); - return; - } - await tryExtractGpsFromPicked(); - } - - // ▶ Fill the manual form fields with extracted GPS coordinates - function fillManualFromGps() { - if (!pickedPhotoGps) { - showToast('No GPS data to fill', true); - return; - } - const coords = pickedPhotoGps.lat.toFixed(6) + ', ' + pickedPhotoGps.lng.toFixed(6); - - // Switch to manual mode - setAddAssetMode('manual'); - - const parkingEl = document.getElementById('manParkingLocation'); - if (parkingEl && !parkingEl.value.trim()) { - parkingEl.value = coords; - } - const mapLinkEl = document.getElementById('manMapLink'); - if (mapLinkEl && !mapLinkEl.value.trim()) { - mapLinkEl.value = `https://www.openstreetmap.org/?mlat=${pickedPhotoGps.lat}&mlon=${pickedPhotoGps.lng}&zoom=17`; - } - showToast('📍 GPS coordinates filled! Edit if needed.'); - } - - // ▶ Open coordinates in Google Maps - function openInMaps() { - if (!pickedPhotoGps) return; - window.open(`https://www.google.com/maps?q=${pickedPhotoGps.lat},${pickedPhotoGps.lng}`, '_blank'); - } - - function createAssetFromPicked() { - if (!pickedPhotoFile) return; - // Switch to Manual mode and pre-load the photo - setAddAssetMode('manual'); - const reader = new FileReader(); - reader.onload = function(e) { - // Convert data URL to blob for manualPhotoBlob - const arr = e.target.result.split(','); - const mime = arr[0].match(/:(.*?);/)[1]; - const bstr = atob(arr[1]); - let n = bstr.length; - const u8arr = new Uint8Array(n); - while (n--) { u8arr[n] = bstr.charCodeAt(n); } - manualPhotoBlob = new Blob([u8arr], { type: mime }); - // Show the photo in the manual preview - const img = document.getElementById('manPhotoPreview'); - img.src = e.target.result; - img.style.display = 'block'; - const ph = document.getElementById('manPhotoPlaceholder'); - if (ph) ph.style.display = 'none'; - const retake = document.getElementById('manPhotoRetake'); - if (retake) retake.style.display = 'block'; - }; - reader.readAsDataURL(pickedPhotoFile); - showToast('Photo loaded into Manual mode'); - } // ── Shared: Load settings dropdowns ───────────────────────────────────── async function loadSettingsCache() {