Skip to content

Commit

Permalink
Merge pull request #33 from origo-map/bugfix
Browse files Browse the repository at this point in the history
Buffer tool bug, take 2
  • Loading branch information
jokd authored Oct 18, 2023
2 parents 23f4d5c + b43541a commit 1a00e4b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,24 @@ const Multiselect = function Multiselect(options = {}) {

for (let index = 0; index < featureSelectors.length; index++) {
const f = featureSelectors[index];
f.addEventListener('click', (e) => {
bufferFeature = features.find(ff => ff.getId().toString() === this.id).clone();
f.addEventListener('click', function (e) {
bufferFeature = features.find((ff) => ff.getId().toString() === this.id).clone();
modal.closeModal();
resolve();
// Remove highlight here if user happens to close the buffer modal without submitting, as we don't know when that happens
// In the future core may have an event on Modal when its closed.
temporaryLayer.clear();
e.stopPropagation();
});
f.addEventListener('mouseover', () => {
const hoverFeature = features.find(ff => ff.getId().toString() === this.id).clone();
f.addEventListener('mouseover', function() {
const hoverFeature = features.find((ff) => ff.getId().toString() === this.id).clone();
displayTemporaryFeature(hoverFeature, chooseSymbol);

});
f.addEventListener('mouseout', () => {
f.addEventListener('mouseout', function () {
temporaryLayer.clear();
});
};
}
});
}

Expand Down

0 comments on commit 1a00e4b

Please sign in to comment.