Skip to content

Commit

Permalink
fix: remove hover interaction when removing select interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
silvester-pari committed Oct 29, 2024
1 parent 9fcc629 commit ad15ea7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions elements/map/src/helpers/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class EOxSelectInteraction {
return initialStyle(feature, resolution); // Apply style only if the feature is selected
}
return null;
},
}
);

/**
Expand Down Expand Up @@ -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];
Expand All @@ -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);
}

Expand All @@ -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."
);
}
}
Expand All @@ -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];
Expand Down

0 comments on commit ad15ea7

Please sign in to comment.