diff --git a/src/plugins/layers/useEarthquakes.js b/src/plugins/layers/useEarthquakes.js index bbd3bef..ce1d310 100644 --- a/src/plugins/layers/useEarthquakes.js +++ b/src/plugins/layers/useEarthquakes.js @@ -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 diff --git a/src/plugins/layers/useWSPR.js b/src/plugins/layers/useWSPR.js index 1f8b242..7fd6f0c 100644 --- a/src/plugins/layers/useWSPR.js +++ b/src/plugins/layers/useWSPR.js @@ -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