@ -18,26 +18,28 @@ import PluginLayer from './PluginLayer.jsx';
import { DXNewsTicker } from './DXNewsTicker.jsx' ;
export const WorldMap = ( {
deLocation ,
dxLocation ,
onDXChange ,
potaSpots ,
mySpots ,
dxPaths ,
dxFilters ,
satellites ,
export const WorldMap = ( {
deLocation ,
dxLocation ,
onDXChange ,
potaSpots ,
mySpots ,
dxPaths ,
dxFilters ,
satellites ,
pskReporterSpots ,
wsjtxSpots ,
showDXPaths ,
showDXLabels ,
onToggleDXLabels ,
showPOTA ,
showSatellites ,
showDXPaths ,
showDXLabels ,
onToggleDXLabels ,
showPOTA ,
showSatellites ,
showPSKReporter ,
showWSJTX ,
onToggleSatellites ,
hoveredSpot
onToggleSatellites ,
hoveredSpot ,
leftSidebarVisible ,
rightSidebarVisible
} ) => {
const mapRef = useRef ( null ) ;
const mapInstanceRef = useRef ( null ) ;
@ -172,7 +174,7 @@ export const WorldMap = ({
/ / U p d a t e t i l e l a y e r w h e n s t y l e c h a n g e s
useEffect ( ( ) => {
if ( ! mapInstanceRef . current || ! tileLayerRef . current ) return ;
mapInstanceRef . current . removeLayer ( tileLayerRef . current ) ;
tileLayerRef . current = L . tileLayer ( MAP _STYLES [ mapStyle ] . url , {
attribution : MAP _STYLES [ mapStyle ] . attribution ,
@ -180,13 +182,25 @@ export const WorldMap = ({
crossOrigin : 'anonymous' ,
bounds : [ [ - 85 , - 180 ] , [ 85 , 180 ] ]
} ) . addTo ( mapInstanceRef . current ) ;
/ / E n s u r e t e r m i n a t o r i s o n t o p
if ( terminatorRef . current ) {
terminatorRef . current . bringToFront ( ) ;
}
} , [ mapStyle ] ) ;
/ / I n v a l i d a t e m a p s i z e w h e n s i d e b a r s a r e t o g g l e d
/ / T h i s e n s u r e s L e a f l e t r e c a l c u l a t e s t h e c o n t a i n e r d i m e n s i o n s
useEffect ( ( ) => {
if ( ! mapInstanceRef . current ) return ;
const timer = setTimeout ( ( ) => {
if ( mapInstanceRef . current ) {
mapInstanceRef . current . invalidateSize ( ) ;
}
} , 100 ) ;
return ( ) => clearTimeout ( timer ) ;
} , [ leftSidebarVisible , rightSidebarVisible ] ) ;
/ / C o u n t r i e s o v e r l a y f o r " C o u n t r i e s " m a p s t y l e
useEffect ( ( ) => {
if ( ! mapInstanceRef . current ) return ;