some udpates to stuff, getting started on influence, map udpates for workflow ease of use, updates to map z-idexes for visibility
This commit is contained in:
@@ -196,3 +196,12 @@ path.leaflet-interactive.cut-polygon {
|
||||
.crosshair {
|
||||
z-index: 1100;
|
||||
}
|
||||
|
||||
/*
|
||||
* Z-Index Hierarchy for Map Markers:
|
||||
* - Start Location Marker: zIndexOffset 1000 (highest - always on top)
|
||||
* - Temporary Location Markers: zIndexOffset 150 (during move operations)
|
||||
* - NocoDB Location Markers: zIndexOffset 100 (main database locations)
|
||||
* - Default: zIndexOffset 0 (cuts, other overlays)
|
||||
* - City Data Markers: zIndexOffset -100 (background - behind main locations)
|
||||
*/
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="button" class="btn btn-danger" id="delete-location-btn">Delete</button>
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
<button type="submit" class="btn btn-primary" id="save-edit-location-btn">Save Changes</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -398,7 +398,7 @@
|
||||
<button type="button" class="btn btn-secondary" id="cancel-modal-btn">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" id="save-location-btn" disabled>
|
||||
<button type="submit" class="btn btn-primary" id="save-location-btn">
|
||||
Save Location
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -119,7 +119,8 @@ class CutLocationManager {
|
||||
locations.forEach(location => {
|
||||
if (location.latitude && location.longitude) {
|
||||
const marker = L.marker([location.latitude, location.longitude], {
|
||||
icon: this.createLocationIcon(location)
|
||||
icon: this.createLocationIcon(location),
|
||||
zIndexOffset: 100 // Above City Data markers
|
||||
});
|
||||
|
||||
const popupContent = this.createLocationPopup(location);
|
||||
|
||||
@@ -144,7 +144,10 @@ async function loadEdmontonData(force = false) {
|
||||
iconAnchor: [size/2, size/2],
|
||||
popupAnchor: [0, -size/2]
|
||||
});
|
||||
return L.marker(latlng, { icon: icon });
|
||||
return L.marker(latlng, {
|
||||
icon: icon,
|
||||
zIndexOffset: -100 // Behind NocoDB locations
|
||||
});
|
||||
} else {
|
||||
// Use circle marker for single units (round, red)
|
||||
return L.circleMarker(latlng, {
|
||||
@@ -153,7 +156,8 @@ async function loadEdmontonData(force = false) {
|
||||
color: "#ffffff",
|
||||
weight: 1,
|
||||
opacity: 0.9,
|
||||
fillOpacity: 0.7
|
||||
fillOpacity: 0.7,
|
||||
zIndexOffset: -100 // Behind NocoDB locations
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -176,7 +176,8 @@ function createLocationMarker(location) {
|
||||
weight: 2,
|
||||
opacity: 1,
|
||||
fillOpacity: 0.8,
|
||||
className: 'location-marker'
|
||||
className: 'location-marker',
|
||||
zIndexOffset: 100 // Above City Data markers
|
||||
});
|
||||
|
||||
// Add to map
|
||||
@@ -325,14 +326,6 @@ function createPopupContent(location) {
|
||||
export async function handleAddLocation(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Check if address is confirmed
|
||||
const { getAddressConfirmationState } = await import('./ui-controls.js');
|
||||
const { isAddressConfirmed } = getAddressConfirmationState();
|
||||
if (!isAddressConfirmed) {
|
||||
showStatus('Please confirm the address before saving the location', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
const formData = new FormData(e.target);
|
||||
const data = {};
|
||||
|
||||
@@ -450,14 +443,6 @@ export async function handleEditLocation(e) {
|
||||
|
||||
if (!currentEditingLocation) return;
|
||||
|
||||
// Check if address is confirmed
|
||||
const { getAddressConfirmationState } = await import('./ui-controls.js');
|
||||
const { isEditAddressConfirmed } = getAddressConfirmationState();
|
||||
if (!isEditAddressConfirmed) {
|
||||
showStatus('Please confirm the address before saving changes', 'warning');
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the stored location ID
|
||||
const locationIdElement = document.getElementById('edit-location-id');
|
||||
const locationId = locationIdElement.getAttribute('data-location-id') || locationIdElement.value;
|
||||
@@ -716,7 +701,8 @@ function showMoveConfirmation(lat, lng) {
|
||||
color: '#fff',
|
||||
weight: 3,
|
||||
opacity: 1,
|
||||
fillOpacity: 0.5
|
||||
fillOpacity: 0.5,
|
||||
zIndexOffset: 150 // Above all other location markers
|
||||
}).addTo(map);
|
||||
|
||||
// Create confirmation popup
|
||||
@@ -897,7 +883,8 @@ function createMultiUnitMarker(group) {
|
||||
});
|
||||
|
||||
const marker = L.marker([lat, lng], {
|
||||
icon: icon
|
||||
icon: icon,
|
||||
zIndexOffset: 100 // Above City Data markers
|
||||
});
|
||||
|
||||
// Add to map
|
||||
|
||||
@@ -47,20 +47,18 @@ export function setAddressConfirmed(mode, confirmed) {
|
||||
button.classList.add('btn-success');
|
||||
button.disabled = false;
|
||||
}
|
||||
if (saveButton) {
|
||||
saveButton.disabled = false;
|
||||
}
|
||||
} else {
|
||||
// This is essentially what resetAddressConfirmation does
|
||||
if (button) {
|
||||
button.textContent = '📍 Confirm Address';
|
||||
button.classList.remove('btn-success');
|
||||
button.classList.add('btn-secondary');
|
||||
button.disabled = false;
|
||||
}
|
||||
if (saveButton) {
|
||||
saveButton.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Always enable save button - confirmation is now optional
|
||||
if (saveButton) {
|
||||
saveButton.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,7 +289,7 @@ export async function confirmAddress(mode) {
|
||||
// Check if already confirmed
|
||||
const currentlyConfirmed = mode === 'add' ? isAddressConfirmed : isEditAddressConfirmed;
|
||||
|
||||
// If already confirmed, just enable save
|
||||
// If already confirmed, toggle back to unconfirmed state
|
||||
if (currentlyConfirmed) {
|
||||
if (mode === 'add') {
|
||||
isAddressConfirmed = false;
|
||||
@@ -299,16 +297,14 @@ export async function confirmAddress(mode) {
|
||||
isEditAddressConfirmed = false;
|
||||
}
|
||||
|
||||
// Reset button and disable save
|
||||
// Reset button but keep save enabled
|
||||
if (button) {
|
||||
button.textContent = '📍 Confirm Address';
|
||||
button.classList.remove('btn-success');
|
||||
button.classList.add('btn-secondary');
|
||||
}
|
||||
if (saveButton) {
|
||||
saveButton.disabled = true;
|
||||
}
|
||||
showStatus('Please confirm address again to enable saving', 'info');
|
||||
// Save button remains enabled - confirmation is optional
|
||||
showStatus('Address confirmation removed - you can still save the location', 'info');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -348,12 +344,7 @@ export async function confirmAddress(mode) {
|
||||
button.classList.add('btn-success');
|
||||
}
|
||||
|
||||
// Enable save button
|
||||
if (saveButton) {
|
||||
saveButton.disabled = false;
|
||||
}
|
||||
|
||||
showStatus('Address confirmed! You can now save the location.', 'success');
|
||||
showStatus('Address confirmed and updated!', 'success');
|
||||
} else {
|
||||
showStatus('No address found for these coordinates', 'warning');
|
||||
}
|
||||
@@ -386,8 +377,9 @@ export function resetAddressConfirmation(mode) {
|
||||
button.classList.add('btn-secondary');
|
||||
button.disabled = false;
|
||||
}
|
||||
// Keep save button enabled - confirmation is now optional
|
||||
if (saveButton) {
|
||||
saveButton.disabled = true;
|
||||
saveButton.disabled = false;
|
||||
}
|
||||
} else if (mode === 'edit') {
|
||||
isEditAddressConfirmed = false;
|
||||
@@ -400,8 +392,9 @@ export function resetAddressConfirmation(mode) {
|
||||
button.classList.add('btn-secondary');
|
||||
button.disabled = false;
|
||||
}
|
||||
// Keep save button enabled - confirmation is now optional
|
||||
if (saveButton) {
|
||||
saveButton.disabled = true;
|
||||
saveButton.disabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user