File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,9 @@ export class Marker extends Layer<DivIconMarker> {
204
204
) {
205
205
super ( ) ;
206
206
207
- const markerIcon = this . map . markerIcons . get ( type ) ?? this . map . markerIcons . get ( 'default' ) ;
207
+ const markerIcon =
208
+ this . map . markerIcons . get ( type ) ??
209
+ this . map . markerIcons . get ( "default" ) ;
208
210
if ( ! markerIcon ) {
209
211
new Notice (
210
212
t (
@@ -410,6 +412,17 @@ export class Marker extends Layer<DivIconMarker> {
410
412
this . leafletInstance . options . keyboard = ! this . map . options . lock ;
411
413
} ) ;
412
414
} ) ;
415
+
416
+ this . map . leafletInstance . on (
417
+ "baselayerchange" ,
418
+ ( layer : L . LayersControlEvent ) => {
419
+ if ( ! ( layer . layer as L . LayerGroup ) . hasLayer ( this . group ) ) {
420
+ this . hide ( ) ;
421
+ } else {
422
+ this . show ( ) ;
423
+ }
424
+ }
425
+ ) ;
413
426
}
414
427
editMarker ( ) {
415
428
let markerSettingsModal = new MarkerContextModal ( this , this . map ) ;
@@ -483,9 +496,7 @@ export class Marker extends Layer<DivIconMarker> {
483
496
) ;
484
497
}
485
498
}
486
- this . _link = x . startsWith ( "#" )
487
- ? this . map . options . context + x
488
- : x ;
499
+ this . _link = x . startsWith ( "#" ) ? this . map . options . context + x : x ;
489
500
if ( this . target ) this . target . text = x ;
490
501
if ( this . popup && this . displayed && this . tooltip === "always" )
491
502
this . popup . open ( this . target . display ) ;
You can’t perform that action at this time.
0 commit comments