diff --git a/externs/olx.js b/externs/olx.js index bbac0af11d..06b2a01749 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5326,7 +5326,7 @@ olx.source.ImageVectorOptions.prototype.style; * operation: (ol.RasterOperation|undefined), * lib: (Object|undefined), * threads: (number|undefined), - * operationType: (ol.source.Raster.OperationType|undefined)}} + * operationType: (ol.source.RasterOperationType|undefined)}} * @api */ olx.source.RasterOptions; @@ -5374,7 +5374,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.source.Raster.OperationType|undefined} + * @type {ol.source.RasterOperationType|undefined} * @api */ olx.source.RasterOptions.prototype.operationType; diff --git a/src/ol/source/raster.js b/src/ol/source/raster.js index cfe5cf0822..0543f146a8 100644 --- a/src/ol/source/raster.js +++ b/src/ol/source/raster.js @@ -1,7 +1,6 @@ goog.provide('ol.source.Raster'); goog.require('ol'); -goog.require('ol.transform'); goog.require('ol.ImageCanvas'); goog.require('ol.TileQueue'); goog.require('ol.dom'); @@ -16,8 +15,10 @@ goog.require('ol.obj'); goog.require('ol.renderer.canvas.ImageLayer'); goog.require('ol.renderer.canvas.TileLayer'); goog.require('ol.source.Image'); +goog.require('ol.source.RasterOperationType'); goog.require('ol.source.State'); goog.require('ol.source.Tile'); +goog.require('ol.transform'); /** @@ -42,10 +43,10 @@ ol.source.Raster = function(options) { /** * @private - * @type {ol.source.Raster.OperationType} + * @type {ol.source.RasterOperationType} */ this.operationType_ = options.operationType !== undefined ? - options.operationType : ol.source.Raster.OperationType.PIXEL; + options.operationType : ol.source.RasterOperationType.PIXEL; /** * @private @@ -149,7 +150,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.source.Raster.OperationType.IMAGE, + imageOps: this.operationType_ === ol.source.RasterOperationType.IMAGE, queue: 1, lib: opt_lib, threads: this.threads_ @@ -505,13 +506,3 @@ 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' -}; diff --git a/src/ol/source/rasteroperationtype.js b/src/ol/source/rasteroperationtype.js new file mode 100644 index 0000000000..a86611f600 --- /dev/null +++ b/src/ol/source/rasteroperationtype.js @@ -0,0 +1,10 @@ +goog.provide('ol.source.RasterOperationType'); + +/** + * Raster operation type. Supported values are `'pixel'` and `'image'`. + * @enum {string} + */ +ol.source.RasterOperationType = { + PIXEL: 'pixel', + IMAGE: 'image' +};