map system updates

This commit is contained in:
2025-07-09 20:06:23 -06:00
parent afc813753c
commit 9f12538248
17 changed files with 69 additions and 33 deletions

View File

@@ -330,4 +330,10 @@ export function openAddModal(lat, lng) {
// Show modal
modal.classList.remove('hidden');
// Trigger custom event for auto address lookup
const autoLookupEvent = new CustomEvent('autoAddressLookup', {
detail: { mode: 'add', lat, lng }
});
document.dispatchEvent(autoLookupEvent);
}

View File

@@ -284,6 +284,7 @@ export function setupGeoLocationSync() {
}
}
// ...existing code...
export function setupEventListeners() {
// Desktop controls
document.getElementById('refresh-btn')?.addEventListener('click', () => {
@@ -345,6 +346,17 @@ export function setupEventListeners() {
lookupAddress('edit');
});
// Auto address lookup event listener
document.addEventListener('autoAddressLookup', (e) => {
const { mode } = e.detail;
if (mode === 'add') {
// Add a small delay to ensure the form is fully rendered
setTimeout(() => {
lookupAddress('add');
}, 200);
}
});
// Geo-location field sync
setupGeoLocationSync();
@@ -361,4 +373,4 @@ export function setupEventListeners() {
}
}
});
}
}