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

View File

@@ -6,7 +6,6 @@ import {DEFAULT_WMS_VERSION} from './common.js';
import ImageWrapper from '../Image.js';
import {assert} from '../asserts.js';
import {listen} from '../events.js';
import EventType from '../events/EventType.js';
import {containsExtent, getCenter, getForViewAndSize, getHeight, getWidth} from '../extent.js';
import {assign} from '../obj.js';
@@ -296,8 +295,7 @@ class ImageWMS extends ImageSource {
this.renderedRevision_ = this.getRevision();
listen(this.image_, EventType.CHANGE,
this.handleImageChange, this);
this.image_.addEventListener(EventType.CHANGE, this.handleImageChange.bind(this));
return this.image_;