diff --git a/elements/map/src/helpers/select.js b/elements/map/src/helpers/select.js index 7c1ca158e..0ca73f947 100644 --- a/elements/map/src/helpers/select.js +++ b/elements/map/src/helpers/select.js @@ -121,7 +121,7 @@ export class EOxSelectInteraction { return initialStyle(feature, resolution); // Apply style only if the feature is selected } return null; - }, + } ); /** @@ -278,7 +278,7 @@ export class EOxSelectInteraction { } else { const map = this.eoxMap.map; const allRenderedFeatures = this.selectLayer.getFeaturesInExtent( - map.getView().calculateExtent(map.getSize()), + map.getView().calculateExtent(map.getSize()) ); for (let i = 0; i < allRenderedFeatures.length; i++) { const renderFeature = allRenderedFeatures[i]; @@ -300,6 +300,7 @@ export class EOxSelectInteraction { remove() { this.selectStyleLayer.setMap(null); delete this.eoxMap.selectInteractions[this.options.id]; + this.eoxMap.map.removeInteraction(this.hover); this.selectLayer.un("change:source", this.changeSourceListener); } @@ -320,7 +321,7 @@ export class EOxSelectInteraction { return feature.get("id"); } throw Error( - "No feature id found. Please provide which feature property should be taken instead using idProperty.", + "No feature id found. Please provide which feature property should be taken instead using idProperty." ); } } @@ -343,7 +344,7 @@ export function addSelect(EOxMap, selectLayer, options) { EOxMap, selectLayer, // @ts-expect-error - Argument of type 'DrawOptions | SelectOptions' is not assignable to parameter of type 'SelectOptions' - options, + options ); return EOxMap.selectInteractions[options.id];