fix: WSPR infinite cleanup loop + earthquake marker debug logging

WSPR:
- Added guard to prevent cleanup when no controls exist
- Stops infinite '[WSPR] Plugin disabled' console spam
- Only cleans up if controls are actually present

Earthquakes:
- Added detailed logging for each marker creation
- Logs: quakeId, lat, lon, size, color
- Will help identify if markers are being positioned correctly
pull/82/head
trancen 2 days ago
parent fddd92d005
commit 5498b3773b

@ -112,6 +112,7 @@ export function useLayer({ enabled = false, opacity = 0.9, map = null }) {
iconAnchor: [size/2, size/2]
});
console.log('Creating earthquake marker:', quakeId, 'at', lat, lon, 'size:', size, 'color:', color);
const circle = L.marker([lat, lon], { icon, opacity });
// Add to map first

@ -973,6 +973,14 @@ export function useLayer({ enabled = false, opacity = 0.7, map = null }) {
// Cleanup controls on disable - FIX: properly remove all controls and layers
useEffect(() => {
if (!enabled && map) {
// Only log once and check if controls actually exist before attempting removal
const hasControls = filterControlRef.current || legendControlRef.current ||
statsControlRef.current || chartControlRef.current;
if (!hasControls) {
return; // Nothing to clean up
}
console.log('[WSPR] Plugin disabled - cleaning up all controls and layers');
// Remove filter control

Loading…
Cancel
Save

Powered by TurnKey Linux.