From 33d91f1b89d467233fa0dbd5b4fcff10cd9835fb Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 25 Feb 2018 08:19:05 -0700 Subject: [PATCH] Remove static members from Raster --- src/ol/source/Raster.js | 86 ++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/ol/source/Raster.js b/src/ol/source/Raster.js index bc2543184d..be27c28e6c 100644 --- a/src/ol/source/Raster.js +++ b/src/ol/source/Raster.js @@ -42,6 +42,47 @@ const RasterEventType = { }; +/** + * @classdesc + * Events emitted by {@link ol.source.Raster} instances are instances of this + * type. + * + * @constructor + * @extends {ol.events.Event} + * @implements {oli.source.RasterEvent} + * @param {string} type Type. + * @param {olx.FrameState} frameState The frame state. + * @param {Object} data An object made available to operations. + */ +const RasterSourceEvent = function(type, frameState, data) { + Event.call(this, type); + + /** + * The raster extent. + * @type {ol.Extent} + * @api + */ + this.extent = frameState.extent; + + /** + * The pixel resolution (map units per pixel). + * @type {number} + * @api + */ + this.resolution = frameState.viewState.resolution / frameState.pixelRatio; + + /** + * An object made available to all operations. This can be used by operations + * as a storage object (e.g. for calculating statistics). + * @type {Object} + * @api + */ + this.data = data; + +}; +inherits(RasterSourceEvent, Event); + + /** * @classdesc * A source that transforms data from any number of input sources using an @@ -282,7 +323,7 @@ RasterSource.prototype.processSources_ = function() { } const data = {}; - this.dispatchEvent(new RasterSource.Event(RasterEventType.BEFOREOPERATIONS, frameState, data)); + this.dispatchEvent(new RasterSourceEvent(RasterEventType.BEFOREOPERATIONS, frameState, data)); this.worker_.process(imageDatas, data, this.onWorkerComplete_.bind(this, frameState)); }; @@ -322,7 +363,7 @@ RasterSource.prototype.onWorkerComplete_ = function(frameState, err, output, dat this.changed(); this.renderedRevision_ = this.getRevision(); - this.dispatchEvent(new RasterSource.Event(RasterEventType.AFTEROPERATIONS, frameState, data)); + this.dispatchEvent(new RasterSourceEvent(RasterEventType.AFTEROPERATIONS, frameState, data)); }; @@ -427,47 +468,6 @@ function createTileRenderer(source) { } -/** - * @classdesc - * Events emitted by {@link ol.source.Raster} instances are instances of this - * type. - * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.source.RasterEvent} - * @param {string} type Type. - * @param {olx.FrameState} frameState The frame state. - * @param {Object} data An object made available to operations. - */ -RasterSource.Event = function(type, frameState, data) { - Event.call(this, type); - - /** - * The raster extent. - * @type {ol.Extent} - * @api - */ - this.extent = frameState.extent; - - /** - * The pixel resolution (map units per pixel). - * @type {number} - * @api - */ - this.resolution = frameState.viewState.resolution / frameState.pixelRatio; - - /** - * An object made available to all operations. This can be used by operations - * as a storage object (e.g. for calculating statistics). - * @type {Object} - * @api - */ - this.data = data; - -}; -inherits(RasterSource.Event, Event); - - /** * @override */