Use goog.array.forEach to unlisten the array of keys

This commit is contained in:
Frederic Junod
2015-09-15 10:05:57 +02:00
parent a613420953
commit 139bcca26a

View File

@@ -1118,10 +1118,8 @@ ol.Map.prototype.handleLayerGroupPropertyChanged_ = function(event) {
*/
ol.Map.prototype.handleLayerGroupChanged_ = function() {
if (!goog.isNull(this.layerGroupPropertyListenerKeys_)) {
var length = this.layerGroupPropertyListenerKeys_.length;
for (var i = 0; i < length; ++i) {
goog.events.unlistenByKey(this.layerGroupPropertyListenerKeys_[i]);
}
goog.array.forEach(this.layerGroupPropertyListenerKeys_,
goog.events.unlistenByKey);
this.layerGroupPropertyListenerKeys_ = null;
}
var layerGroup = this.getLayerGroup();