diff --git a/src/components/attributeTable/AttributeTable.vue b/src/components/attributeTable/AttributeTable.vue index 93e22085..e6fd0ec8 100644 --- a/src/components/attributeTable/AttributeTable.vue +++ b/src/components/attributeTable/AttributeTable.vue @@ -88,6 +88,10 @@ export default { // unregister event after table is closed this.layer.getSource().un('change', this.prepareTableDataAndColumns); } + + if (this.syncTableMapSelection) { + this.deactivateSelectRowOnMapClick(); + } }, watch: { layerId () { @@ -172,6 +176,14 @@ export default { }); }, + /** + * Deactivate behaviour that a selected feature on the + * map will be selected in the AttributeTable as well. + */ + deactivateSelectRowOnMapClick () { + WguEventBus.$off('map-selectionchange'); + }, + /** * Highlight row matching the feature ID * and set correct page of the table. @@ -247,6 +259,11 @@ export default { return; } + // unregister change event on previous layer source if any + if (this.layer) { + this.layer.getSource().un('change', this.prepareTableDataAndColumns); + } + // reset table properties this.records = []; this.features = [];