Add ol.LayerView

This commit is contained in:
Tom Payne
2012-07-05 16:16:27 +02:00
committed by Tom Payne
parent 9900084f46
commit bd61a0be15
2 changed files with 62 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ goog.provide('ol');
goog.require('ol.Bounds');
goog.require('ol.Camera');
goog.require('ol.Extent');
goog.require('ol.LayerView');
goog.require('ol.MVCArray');
goog.require('ol.MVCObject');
goog.require('ol.TileBounds');

61
src/ol/layerview.js Normal file
View File

@@ -0,0 +1,61 @@
goog.provide('ol.LayerView');
goog.require('ol.MVCObject');
/**
* @enum {string}
* @private
*/
ol.LayerViewProperty_ = {
OPACITY: 'opacity',
VISIBLE: 'visible'
};
/**
* @constructor
* @extends {ol.MVCObject}
*/
ol.LayerView = function() {
goog.base(this);
this.setVisible(true);
this.setOpacity(1);
};
goog.inherits(ol.LayerView, ol.MVCObject);
/**
* @return {number} Opacity.
*/
ol.LayerView.prototype.getOpacity = function() {
return /** @type {number} */ (this.get(ol.LayerViewProperty_.OPACITY));
};
/**
* @return {boolean} Visible.
*/
ol.LayerView.prototype.getVisible = function() {
return /** @type {boolean} */ (this.get(ol.LayerViewProperty_.VISIBLE));
};
/**
* @param {number} opacity Opacity.
*/
ol.LayerView.prototype.setOpacity = function(opacity) {
this.set(ol.LayerViewProperty_.OPACITY, opacity);
};
/**
* @param {boolean} visible Visible.
*/
ol.LayerView.prototype.setVisible = function(visible) {
this.set(ol.LayerViewProperty_.VISIBLE, visible);
};