Be more consistent with layer options
This commit is contained in:
@@ -8,10 +8,10 @@ goog.require('ol.source.ImageSource');
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.layer.Layer}
|
* @extends {ol.layer.Layer}
|
||||||
* @param {ol.layer.LayerOptions} layerOptions Layer options.
|
* @param {ol.layer.LayerOptions} options Layer options.
|
||||||
*/
|
*/
|
||||||
ol.layer.ImageLayer = function(layerOptions) {
|
ol.layer.ImageLayer = function(options) {
|
||||||
goog.base(this, layerOptions);
|
goog.base(this, options);
|
||||||
};
|
};
|
||||||
goog.inherits(ol.layer.ImageLayer, ol.layer.Layer);
|
goog.inherits(ol.layer.ImageLayer, ol.layer.Layer);
|
||||||
|
|
||||||
|
|||||||
+9
-15
@@ -38,9 +38,9 @@ ol.layer.LayerState;
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.Object}
|
* @extends {ol.Object}
|
||||||
* @param {ol.layer.LayerOptions} layerOptions LayerOptions.
|
* @param {ol.layer.LayerOptions} options Layer options.
|
||||||
*/
|
*/
|
||||||
ol.layer.Layer = function(layerOptions) {
|
ol.layer.Layer = function(options) {
|
||||||
|
|
||||||
goog.base(this);
|
goog.base(this);
|
||||||
|
|
||||||
@@ -48,20 +48,14 @@ ol.layer.Layer = function(layerOptions) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {ol.source.Source}
|
* @type {ol.source.Source}
|
||||||
*/
|
*/
|
||||||
this.source_ = layerOptions.source;
|
this.source_ = options.source;
|
||||||
|
|
||||||
this.setBrightness(
|
this.setBrightness(goog.isDef(options.brightness) ? options.brightness : 0);
|
||||||
goog.isDef(layerOptions.brightness) ? layerOptions.brightness : 0);
|
this.setContrast(goog.isDef(options.contrast) ? options.contrast : 1);
|
||||||
this.setContrast(
|
this.setHue(goog.isDef(options.hue) ? options.hue : 0);
|
||||||
goog.isDef(layerOptions.contrast) ? layerOptions.contrast : 1);
|
this.setOpacity(goog.isDef(options.opacity) ? options.opacity : 1);
|
||||||
this.setHue(
|
this.setSaturation(goog.isDef(options.saturation) ? options.saturation : 1);
|
||||||
goog.isDef(layerOptions.hue) ? layerOptions.hue : 0);
|
this.setVisible(goog.isDef(options.visible) ? options.visible : true);
|
||||||
this.setOpacity(
|
|
||||||
goog.isDef(layerOptions.opacity) ? layerOptions.opacity : 1);
|
|
||||||
this.setSaturation(
|
|
||||||
goog.isDef(layerOptions.saturation) ? layerOptions.saturation : 1);
|
|
||||||
this.setVisible(
|
|
||||||
goog.isDef(layerOptions.visible) ? layerOptions.visible : true);
|
|
||||||
|
|
||||||
if (!this.source_.isReady()) {
|
if (!this.source_.isReady()) {
|
||||||
goog.events.listenOnce(this.source_, goog.events.EventType.LOAD,
|
goog.events.listenOnce(this.source_, goog.events.EventType.LOAD,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ ol.layer.TileLayerProperty = {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.layer.Layer}
|
* @extends {ol.layer.Layer}
|
||||||
* @param {ol.layer.TileLayerOptions} options Options.
|
* @param {ol.layer.TileLayerOptions} options Tile layer options.
|
||||||
*/
|
*/
|
||||||
ol.layer.TileLayer = function(options) {
|
ol.layer.TileLayer = function(options) {
|
||||||
|
|
||||||
|
|||||||
@@ -155,21 +155,21 @@ ol.layer.FeatureCache.prototype.getFeaturesByIds_ = function(ids) {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.layer.Layer}
|
* @extends {ol.layer.Layer}
|
||||||
* @param {ol.layer.VectorLayerOptions} layerOptions Layer options.
|
* @param {ol.layer.VectorLayerOptions} options Vector layer options.
|
||||||
*/
|
*/
|
||||||
ol.layer.Vector = function(layerOptions) {
|
ol.layer.Vector = function(options) {
|
||||||
|
|
||||||
goog.base(this, {
|
goog.base(this, {
|
||||||
opacity: layerOptions.opacity,
|
opacity: options.opacity,
|
||||||
source: layerOptions.source,
|
source: options.source,
|
||||||
visible: layerOptions.visible
|
visible: options.visible
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {ol.style.Style}
|
* @type {ol.style.Style}
|
||||||
*/
|
*/
|
||||||
this.style_ = goog.isDef(layerOptions.style) ? layerOptions.style : null;
|
this.style_ = goog.isDef(options.style) ? options.style : null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {ol.layer.FeatureCache}
|
* @type {ol.layer.FeatureCache}
|
||||||
|
|||||||
Reference in New Issue
Block a user