Remove static members from Raster

This commit is contained in:
Tim Schaub
2018-02-25 08:19:05 -07:00
parent 7ab83f2722
commit 33d91f1b89

View File

@@ -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
*/