Merge pull request #4429 from fredj/object_change_evt

Dispatch a change event only if the value changes
This commit is contained in:
Frédéric Junod
2015-11-17 12:51:26 +01:00
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -206,7 +206,9 @@ ol.Object.prototype.set = function(key, value, opt_silent) {
} else {
var oldValue = this.values_[key];
this.values_[key] = value;
this.notify(key, oldValue);
if (oldValue !== value) {
this.notify(key, oldValue);
}
}
};