Add ol.Layer
This commit is contained in:
@@ -34,7 +34,6 @@ GSLINT_EXCLUDES= \
|
|||||||
src/ol/geom/MultiPoint.js \
|
src/ol/geom/MultiPoint.js \
|
||||||
src/ol/geom/Point.js \
|
src/ol/geom/Point.js \
|
||||||
src/ol/handler/Drag.js \
|
src/ol/handler/Drag.js \
|
||||||
src/ol/layer/Layer.js \
|
|
||||||
src/ol/layer/OSM.js \
|
src/ol/layer/OSM.js \
|
||||||
src/ol/layer/TileLayer.js \
|
src/ol/layer/TileLayer.js \
|
||||||
src/ol/layer/WMS.js \
|
src/ol/layer/WMS.js \
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ goog.provide('ol');
|
|||||||
goog.require('ol.Bounds');
|
goog.require('ol.Bounds');
|
||||||
goog.require('ol.Camera');
|
goog.require('ol.Camera');
|
||||||
goog.require('ol.Extent');
|
goog.require('ol.Extent');
|
||||||
|
goog.require('ol.Layer');
|
||||||
goog.require('ol.LayerView');
|
goog.require('ol.LayerView');
|
||||||
goog.require('ol.MVCArray');
|
goog.require('ol.MVCArray');
|
||||||
goog.require('ol.MVCObject');
|
goog.require('ol.MVCObject');
|
||||||
|
|||||||
@@ -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);
|
||||||
|
};
|
||||||
@@ -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_;
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user