Don't dispatch select event if a selected feature is selected again

This commit is contained in:
Frederic Junod
2016-06-02 17:38:47 +02:00
parent e7c2d9ab32
commit b562f4d68a
2 changed files with 16 additions and 2 deletions

View File

@@ -281,9 +281,9 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
return !this.multi_;
}
}, this, this.layerFilter_);
if (selected.length > 0 && features.getLength() == 1 &&
features.item(0) == selected[0]) {
if (selected.length > 0 && features.getLength() == 1 && features.item(0) == selected[0]) {
// No change; an already selected feature is selected again
selected.length = 0;
} else {
if (features.getLength() !== 0) {
deselected = Array.prototype.concat(features.getArray());