diff --git a/externs/olx.js b/externs/olx.js index 41eada26e2..5d9bd288f5 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5257,7 +5257,7 @@ olx.source.ImageVectorOptions.prototype.style; * operation: (ol.RasterOperation|undefined), * lib: (Object|undefined), * threads: (number|undefined), - * operationType: (ol.RasterOperationType|undefined)}} + * operationType: (ol.source.Raster.OperationType|undefined)}} * @api */ olx.source.RasterOptions; @@ -5305,7 +5305,7 @@ olx.source.RasterOptions.prototype.threads; * `'pixel'` operations are assumed, and operations will be called with an * array of pixels from input sources. If set to `'image'`, operations will * be called with an array of ImageData objects from input sources. - * @type {ol.RasterOperationType|undefined} + * @type {ol.source.Raster.OperationType|undefined} * @api */ olx.source.RasterOptions.prototype.operationType; diff --git a/src/ol/source/raster.js b/src/ol/source/raster.js index 8ed70b96e6..ae085fa1cc 100644 --- a/src/ol/source/raster.js +++ b/src/ol/source/raster.js @@ -1,5 +1,4 @@ goog.provide('ol.source.Raster'); -goog.provide('ol.RasterOperationType'); goog.require('ol'); goog.require('ol.transform'); @@ -21,16 +20,6 @@ goog.require('ol.source.State'); goog.require('ol.source.Tile'); -/** - * Raster operation type. Supported values are `'pixel'` and `'image'`. - * @enum {string} - */ -ol.RasterOperationType = { - PIXEL: 'pixel', - IMAGE: 'image' -}; - - /** * @classdesc * A source that transforms data from any number of input sources using an array @@ -53,10 +42,10 @@ ol.source.Raster = function(options) { /** * @private - * @type {ol.RasterOperationType} + * @type {ol.source.Raster.OperationType} */ this.operationType_ = options.operationType !== undefined ? - options.operationType : ol.RasterOperationType.PIXEL; + options.operationType : ol.source.Raster.OperationType.PIXEL; /** * @private @@ -160,7 +149,7 @@ ol.inherits(ol.source.Raster, ol.source.Image); ol.source.Raster.prototype.setOperation = function(operation, opt_lib) { this.worker_ = new ol.ext.pixelworks.Processor({ operation: operation, - imageOps: this.operationType_ === ol.RasterOperationType.IMAGE, + imageOps: this.operationType_ === ol.source.Raster.OperationType.IMAGE, queue: 1, lib: opt_lib, threads: this.threads_ @@ -512,3 +501,13 @@ ol.source.Raster.EventType = { */ AFTEROPERATIONS: 'afteroperations' }; + + +/** + * Raster operation type. Supported values are `'pixel'` and `'image'`. + * @enum {string} + */ +ol.source.Raster.OperationType = { + PIXEL: 'pixel', + IMAGE: 'image' +};