Add ol.Layer

This commit is contained in:
Tom Payne
2012-07-06 12:27:31 +02:00
committed by Tom Payne
parent 89ec9bf07a
commit a2cf655bfa
4 changed files with 78 additions and 23 deletions

77
src/ol/layer.js Normal file
View File

@@ -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);
};

View File

@@ -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_;
};