diff --git a/Makefile b/Makefile index 683661c3ba..840530f2f5 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,6 @@ GSLINT_EXCLUDES= \ src/ol/geom/MultiPoint.js \ src/ol/geom/Point.js \ src/ol/handler/Drag.js \ - src/ol/layer/Layer.js \ src/ol/layer/OSM.js \ src/ol/layer/TileLayer.js \ src/ol/layer/WMS.js \ diff --git a/src/all.js b/src/all.js index 015da3bdb1..4acf926f1f 100644 --- a/src/all.js +++ b/src/all.js @@ -3,6 +3,7 @@ goog.provide('ol'); goog.require('ol.Bounds'); goog.require('ol.Camera'); goog.require('ol.Extent'); +goog.require('ol.Layer'); goog.require('ol.LayerView'); goog.require('ol.MVCArray'); goog.require('ol.MVCObject'); diff --git a/src/ol/layer.js b/src/ol/layer.js new file mode 100644 index 0000000000..a7164de7f0 --- /dev/null +++ b/src/ol/layer.js @@ -0,0 +1,77 @@ +goog.provide('ol.Layer'); + +goog.require('ol.Extent'); +goog.require('ol.MVCObject'); +goog.require('ol.Projection'); + + +/** + * @enum {string} + * @private + */ +ol.LayerProperty_ = { + ATTRIBUTION: 'attribution', + EXTENT: 'extent', + PROJECTION: 'projection' +}; + + + +/** + * @constructor + * @extends {ol.MVCObject} + */ +ol.Layer = function() { + + goog.base(this); + +}; +goog.inherits(ol.Layer, ol.MVCObject); + + +/** + * @return {string} Attribution. + */ +ol.Layer.prototype.getAttribution = function() { + return /** @type {string} */ (this.get(ol.LayerProperty_.ATTRIBUTION)); +}; + + +/** + * @return {ol.Extent} Extent. + */ +ol.Layer.prototype.getExtent = function() { + return /** @type {ol.Extent} */ (this.get(ol.LayerProperty_.EXTENT)); +}; + + +/** + * @return {ol.Projection} Projection. + */ +ol.Layer.prototype.getProjection = function() { + return /** @type {ol.Projection} */ (this.get(ol.LayerProperty_.PROJECTION)); +}; + + +/** + * @param {string} attribution Attribution. + */ +ol.Layer.prototype.setAttribution = function(attribution) { + this.set(ol.LayerProperty_.ATTRIBUTION, attribution); +}; + + +/** + * @param {ol.Extent} extent Extent. + */ +ol.Layer.prototype.setExtent = function(extent) { + this.set(ol.LayerProperty_.EXTENT, extent); +}; + + +/** + * @param {ol.Projection} projection Projetion. + */ +ol.Layer.prototype.setProjection = function(projection) { + this.set(ol.LayerProperty_.PROJECTION, projection); +}; diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js deleted file mode 100644 index 8f588e5684..0000000000 --- a/src/ol/layer/Layer.js +++ /dev/null @@ -1,22 +0,0 @@ -goog.provide('ol.layer.Layer'); - -/** - * @constructor - * @export - */ -ol.layer.Layer = function() { - - /** - * @type {string} - * @protected - */ - this.attribution_; - -}; - -/** - * @return {string} - */ -ol.layer.Layer.prototype.getAttribution = function() { - return this.attribution_; -};