Throw when calling abstract methods; fix abstract return types

This commit is contained in:
ahocevar
2018-10-30 18:45:42 +01:00
parent 2adac0b3e7
commit 1cdd040c96
22 changed files with 273 additions and 85 deletions

View File

@@ -1,8 +1,8 @@
/**
* @module ol/source/Image
*/
import {abstract} from '../util.js';
import {ENABLE_RASTER_REPROJECTION} from '../reproj/common.js';
import ImageState from '../ImageState.js';
import {linearFindNearest} from '../array.js';
import Event from '../events/Event.js';
@@ -81,6 +81,7 @@ class ImageSourceEvent extends Event {
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for sources providing a single image.
* @abstract
* @api
*/
class ImageSource extends Source {
@@ -188,7 +189,9 @@ class ImageSource extends Source {
* @return {import("../ImageBase.js").default} Single image.
* @protected
*/
getImageInternal(extent, resolution, pixelRatio, projection) {}
getImageInternal(extent, resolution, pixelRatio, projection) {
return abstract();
}
/**
* Handle image change events.