Simplify events and store listeners only in one place

This commit is contained in:
ahocevar
2019-09-04 16:39:32 +02:00
parent d416866108
commit ebfb20440a
52 changed files with 224 additions and 599 deletions
+1 -3
View File
@@ -121,9 +121,7 @@ class Layer extends BaseLayer {
this.setMap(options.map);
}
listen(this,
getChangeEventType(LayerProperty.SOURCE),
this.handleSourcePropertyChange_, this);
this.addEventListener(getChangeEventType(LayerProperty.SOURCE), this.handleSourcePropertyChange_);
const source = options.source ? /** @type {SourceType} */ (options.source) : null;
this.setSource(source);