diff --git a/public/index.html b/public/index.html index 2223436..60e5ead 100644 --- a/public/index.html +++ b/public/index.html @@ -2147,7 +2147,7 @@ // ============================================ // LEAFLET MAP COMPONENT // ============================================ - const WorldMap = ({ deLocation, dxLocation, onDXChange, potaSpots, mySpots, dxPaths, dxFilters, satellites, showDXPaths, showPOTA, showSatellites, onToggleSatellites }) => { + const WorldMap = ({ deLocation, dxLocation, onDXChange, potaSpots, mySpots, dxPaths, dxFilters, satellites, showDXPaths, showDXLabels, onToggleDXLabels, showPOTA, showSatellites, onToggleSatellites }) => { const mapRef = useRef(null); const mapInstanceRef = useRef(null); const tileLayerRef = useRef(null); @@ -2475,7 +2475,7 @@ }) .bindPopup(dxPopupContent) .bindTooltip(path.dxCall, { - permanent: false, + permanent: showDXLabels, direction: 'top', offset: [0, -8], className: 'dx-tooltip' @@ -2494,7 +2494,7 @@ }) .bindPopup(spotterPopupContent) .bindTooltip(path.spotter, { - permanent: false, + permanent: showDXLabels, direction: 'top', offset: [0, -6], className: 'dx-tooltip' @@ -2507,7 +2507,7 @@ } }); } - }, [dxPaths, dxFilters, showDXPaths]); + }, [dxPaths, dxFilters, showDXPaths, showDXLabels]); // Update POTA markers useEffect(() => { @@ -2679,6 +2679,33 @@ )} + {/* Labels toggle button */} + {onToggleDXLabels && showDXPaths && ( + + )} + {/* Map Legend - Bottom of map */}
{ try { const stored = localStorage.getItem('openhamclock_mapLayers'); - const defaults = { showDXPaths: true, showPOTA: true, showSatellites: true }; + const defaults = { showDXPaths: true, showDXLabels: true, showPOTA: true, showSatellites: true }; return stored ? { ...defaults, ...JSON.parse(stored) } : defaults; - } catch (e) { return { showDXPaths: true, showPOTA: true, showSatellites: true }; } + } catch (e) { return { showDXPaths: true, showDXLabels: true, showPOTA: true, showSatellites: true }; } }); // Save map layer preferences when changed @@ -4719,6 +4748,7 @@ // Toggle handlers for map layers const toggleDXPaths = useCallback(() => setMapLayers(prev => ({ ...prev, showDXPaths: !prev.showDXPaths })), []); + const toggleDXLabels = useCallback(() => setMapLayers(prev => ({ ...prev, showDXLabels: !prev.showDXLabels })), []); const togglePOTA = useCallback(() => setMapLayers(prev => ({ ...prev, showPOTA: !prev.showPOTA })), []); const toggleSatellites = useCallback(() => setMapLayers(prev => ({ ...prev, showSatellites: !prev.showSatellites })), []); @@ -5078,6 +5108,8 @@ dxFilters={dxFilters} satellites={satellites.positions} showDXPaths={mapLayers.showDXPaths} + showDXLabels={mapLayers.showDXLabels} + onToggleDXLabels={toggleDXLabels} showPOTA={mapLayers.showPOTA} showSatellites={mapLayers.showSatellites} onToggleSatellites={toggleSatellites}