mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-23 01:27:14 +02:00
parent
50449e6b9c
commit
51a473f4f0
@ -425,7 +425,12 @@ export class GalleryMapLightboxComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
clearPath(): void {
|
||||
this.pathLayersConfigOrdered.forEach(p => p.layer.clearLayers());
|
||||
this.pathLayersConfigOrdered.forEach(p => {
|
||||
p.layer.clearLayers();
|
||||
this.mapLayerControl.removeLayer(
|
||||
p.layer
|
||||
);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -554,10 +559,7 @@ export class GalleryMapLightboxComponent implements OnChanges, OnDestroy {
|
||||
|
||||
// Add layer to the map
|
||||
this.pathLayersConfigOrdered.filter(pl => pl.layer.getLayers().length > 0).forEach((pl) => {
|
||||
// make sure it does not appear twice
|
||||
this.mapLayerControl.removeLayer(
|
||||
pl.layer
|
||||
);
|
||||
|
||||
this.mapLayerControl.addOverlay(
|
||||
pl.layer,
|
||||
pl.name
|
||||
|
Loading…
Reference in New Issue
Block a user