Use extends and super for Image

This commit is contained in:
ahocevar
2018-07-17 13:27:37 +02:00
parent ec495bfcec
commit fb59d7a65b

View File

@@ -1,7 +1,6 @@
/**
* @module ol/Image
*/
import {inherits} from './util.js';
import ImageBase from './ImageBase.js';
import ImageState from './ImageState.js';
import {listenOnce, unlistenByKey} from './events.js';
@@ -28,10 +27,7 @@ import {getHeight} from './extent.js';
*/
/**
* @extends {module:ol/ImageBase}
*/
class ImageWrapper {
class ImageWrapper extends ImageBase {
/**
* @param {module:ol/extent~Extent} extent Extent.
@@ -43,7 +39,7 @@ class ImageWrapper {
*/
constructor(extent, resolution, pixelRatio, src, crossOrigin, imageLoadFunction) {
ImageBase.call(this, extent, resolution, pixelRatio, ImageState.IDLE);
super(extent, resolution, pixelRatio, ImageState.IDLE);
/**
* @private
@@ -152,7 +148,5 @@ class ImageWrapper {
}
}
inherits(ImageWrapper, ImageBase);
export default ImageWrapper;