From e75afdc01df1d4f7a9fcda026a58b13291103a14 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Tue, 26 Jan 2021 16:47:08 +0100 Subject: [PATCH] Fix destroy and eventhandler install --- .../components/aol/item-layers/item-layers.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts b/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts index 44f16c6..652f47d 100644 --- a/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts +++ b/projects/common-map/src/fm-map/components/aol/item-layers/item-layers.component.ts @@ -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(); } }