Fix destroy and eventhandler install
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma 2021-01-26 16:47:08 +01:00
parent 8f54e095fe
commit e75afdc01d

View File

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