File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,20 +76,18 @@ watch(
7676 return
7777 }
7878
79- // Skip reload when the effective (clamped) year hasn't changed (e.g. 2024 -> 2025)
8079 if ( getEffectiveCloudlessYear ( newYear ) === getEffectiveCloudlessYear ( oldYear ) ) {
81- return
82- }
80+ // Remove the old cloudless layer if it exists
81+ if ( cloudlessLayer . value ) {
82+ map . value . removeLayer ( cloudlessLayer . value )
83+ }
8384
84- // Remove the old cloudless layer if it exists
85- if ( cloudlessLayer . value ) {
86- map . value . removeLayer ( cloudlessLayer . value )
87- }
85+ // Create and add the new cloudless layer with the updated year
86+ cloudlessLayer . value = createCloudlessLayer ( newYear )
8887
89- // Create and add the new cloudless layer with the updated year
90- cloudlessLayer . value = createCloudlessLayer ( newYear )
91- // Insert at index 0 to keep it as the base layer
92- map . value . getLayers ( ) . insertAt ( 0 , cloudlessLayer . value )
88+ // Insert at index 0 to keep it as the base layer
89+ map . value . getLayers ( ) . insertAt ( 0 , cloudlessLayer . value )
90+ }
9391
9492 if ( settings . value . mode === 'global' ) {
9593 if ( globalPredictionsController . value ) {
You can’t perform that action at this time.
0 commit comments