Fix destroy and eventhandler install
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good Details

2022.01
Willem Dantuma 2021-01-26 16:47:08 +01:00
parent 8f54e095fe
commit e75afdc01d
1 changed files with 4 additions and 1 deletions

View File

@ -310,6 +310,9 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
if(this.itemLayers) {
this.updateLayers(this.itemLayers);
} else if(this.itemLayer) {
if(this.itemLayer.item.itemType == 'vnd.farmmaps.itemtype.shape.processed') {
this.installMapEventHandler();
}
this.updateLayers([this.itemLayer])
} else {
this.updateLayers([]);
@ -439,6 +442,6 @@ export class ItemLayersComponent extends LayerGroupComponent implements OnChange
ngOnDestroy() {
this.unInstallMapEventHandler();
this.map.instance.removeLayer(this.instance);
super.ngOnDestroy();
}
}