Move Layer into ol.layer namespace.
This commit is contained in:
@@ -14,7 +14,7 @@ goog.require('goog.style');
|
||||
goog.require('ol.Collection');
|
||||
goog.require('ol.Control');
|
||||
goog.require('ol.CoverageArea');
|
||||
goog.require('ol.Layer');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.MapProperty');
|
||||
goog.require('ol.TileCoverageArea');
|
||||
|
||||
@@ -81,7 +81,7 @@ goog.inherits(ol.control.Attribution, ol.Control);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @protected
|
||||
*/
|
||||
ol.control.Attribution.prototype.addLayer = function(layer) {
|
||||
@@ -89,7 +89,7 @@ ol.control.Attribution.prototype.addLayer = function(layer) {
|
||||
var layerKey = goog.getUid(layer);
|
||||
|
||||
this.layerVisibleChangeListenerKeys_[layerKey] = goog.events.listen(
|
||||
layer, ol.Object.getChangedEventType(ol.LayerProperty.VISIBLE),
|
||||
layer, ol.Object.getChangedEventType(ol.layer.LayerProperty.VISIBLE),
|
||||
this.handleLayerVisibleChanged, false, this);
|
||||
|
||||
if (layer.getStore().isReady()) {
|
||||
@@ -103,7 +103,7 @@ ol.control.Attribution.prototype.addLayer = function(layer) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @private
|
||||
*/
|
||||
ol.control.Attribution.prototype.createAttributionElementsForLayer_ =
|
||||
@@ -163,7 +163,7 @@ ol.control.Attribution.prototype.getElement = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @param {ol.Extent} mapExtent Map extent.
|
||||
* @param {number} mapResolution Map resolution.
|
||||
* @param {ol.Projection} mapProjection Map projection.
|
||||
@@ -249,7 +249,7 @@ ol.control.Attribution.prototype.getLayerAttributionVisiblities_ =
|
||||
* @param {goog.events.Event} event Event.
|
||||
*/
|
||||
ol.control.Attribution.prototype.handleLayerLoad = function(event) {
|
||||
var layer = /** @type {ol.Layer} */ event.target;
|
||||
var layer = /** @type {ol.layer.Layer} */ event.target;
|
||||
this.createAttributionElementsForLayer_(layer);
|
||||
};
|
||||
|
||||
@@ -266,7 +266,7 @@ ol.control.Attribution.prototype.handleLayerVisibleChanged = function(event) {
|
||||
var mapProjection = /** @type {ol.Projection} */ map.getProjection();
|
||||
var mapResolution = /** @type {number} */ map.getResolution();
|
||||
|
||||
var layer = /** @type {ol.Layer} */ event.target;
|
||||
var layer = /** @type {ol.layer.Layer} */ event.target;
|
||||
|
||||
this.updateLayerAttributionsVisibility_(
|
||||
layer, mapIsDef, mapExtent, mapResolution, mapProjection);
|
||||
@@ -279,7 +279,7 @@ ol.control.Attribution.prototype.handleLayerVisibleChanged = function(event) {
|
||||
* @protected
|
||||
*/
|
||||
ol.control.Attribution.prototype.handleLayersAdd = function(collectionEvent) {
|
||||
var layer = /** @type {ol.Layer} */ collectionEvent.elem;
|
||||
var layer = /** @type {ol.layer.Layer} */ collectionEvent.elem;
|
||||
this.addLayer(layer);
|
||||
};
|
||||
|
||||
@@ -290,7 +290,7 @@ ol.control.Attribution.prototype.handleLayersAdd = function(collectionEvent) {
|
||||
*/
|
||||
ol.control.Attribution.prototype.handleLayersRemove =
|
||||
function(collectionEvent) {
|
||||
var layer = /** @type {ol.Layer} */ collectionEvent.elem;
|
||||
var layer = /** @type {ol.layer.Layer} */ collectionEvent.elem;
|
||||
this.removeLayer(layer);
|
||||
};
|
||||
|
||||
@@ -343,7 +343,7 @@ ol.control.Attribution.prototype.handleMapLayersChanged = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @protected
|
||||
*/
|
||||
ol.control.Attribution.prototype.removeLayer = function(layer) {
|
||||
@@ -365,7 +365,7 @@ ol.control.Attribution.prototype.removeLayer = function(layer) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @param {boolean} mapIsDef Map is defined.
|
||||
* @param {ol.Extent} mapExtent Map extent.
|
||||
* @param {number} mapResolution Map resolution.
|
||||
|
||||
228
src/ol/layer.js
228
src/ol/layer.js
@@ -1,228 +0,0 @@
|
||||
goog.provide('ol.Layer');
|
||||
goog.provide('ol.LayerProperty');
|
||||
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.Store');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.LayerProperty = {
|
||||
BRIGHTNESS: 'brightness',
|
||||
CONTRAST: 'contrast',
|
||||
HUE: 'hue',
|
||||
OPACITY: 'opacity',
|
||||
SATURATION: 'saturation',
|
||||
VISIBLE: 'visible'
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Object}
|
||||
* @param {ol.Store} store Store.
|
||||
* @param {Object.<string, *>=} opt_values Values.
|
||||
*/
|
||||
ol.Layer = function(store, opt_values) {
|
||||
|
||||
goog.base(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Store}
|
||||
*/
|
||||
this.store_ = store;
|
||||
|
||||
this.setBrightness(0);
|
||||
this.setContrast(0);
|
||||
this.setHue(0);
|
||||
this.setOpacity(1);
|
||||
this.setSaturation(0);
|
||||
this.setVisible(true);
|
||||
|
||||
if (goog.isDef(opt_values)) {
|
||||
this.setValues(opt_values);
|
||||
}
|
||||
|
||||
};
|
||||
goog.inherits(ol.Layer, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Brightness.
|
||||
*/
|
||||
ol.Layer.prototype.getBrightness = function() {
|
||||
return /** @type {number} */ this.get(ol.LayerProperty.BRIGHTNESS);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'getBrightness',
|
||||
ol.Layer.prototype.getBrightness);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Contrast.
|
||||
*/
|
||||
ol.Layer.prototype.getContrast = function() {
|
||||
return /** @type {number} */ this.get(ol.LayerProperty.CONTRAST);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'getContrast',
|
||||
ol.Layer.prototype.getContrast);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Hue.
|
||||
*/
|
||||
ol.Layer.prototype.getHue = function() {
|
||||
return /** @type {number} */ this.get(ol.LayerProperty.HUE);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'getHue',
|
||||
ol.Layer.prototype.getHue);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Opacity.
|
||||
*/
|
||||
ol.Layer.prototype.getOpacity = function() {
|
||||
return /** @type {number} */ this.get(ol.LayerProperty.OPACITY);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'getOpacity',
|
||||
ol.Layer.prototype.getOpacity);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Saturation.
|
||||
*/
|
||||
ol.Layer.prototype.getSaturation = function() {
|
||||
return /** @type {number} */ this.get(ol.LayerProperty.SATURATION);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'getSaturation',
|
||||
ol.Layer.prototype.getSaturation);
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Store} Store.
|
||||
*/
|
||||
ol.Layer.prototype.getStore = function() {
|
||||
return this.store_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Visible.
|
||||
*/
|
||||
ol.Layer.prototype.getVisible = function() {
|
||||
return /** @type {boolean} */ this.get(ol.LayerProperty.VISIBLE);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'getVisible',
|
||||
ol.Layer.prototype.getVisible);
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Is ready.
|
||||
*/
|
||||
ol.Layer.prototype.isReady = function() {
|
||||
return this.getStore().isReady();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} brightness Brightness.
|
||||
*/
|
||||
ol.Layer.prototype.setBrightness = function(brightness) {
|
||||
brightness = goog.math.clamp(brightness, -1, 1);
|
||||
if (brightness != this.getBrightness()) {
|
||||
this.set(ol.LayerProperty.BRIGHTNESS, brightness);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'setBrightness',
|
||||
ol.Layer.prototype.setBrightness);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} contrast Contrast.
|
||||
*/
|
||||
ol.Layer.prototype.setContrast = function(contrast) {
|
||||
contrast = goog.math.clamp(contrast, -1, 1);
|
||||
if (contrast != this.getContrast()) {
|
||||
this.set(ol.LayerProperty.CONTRAST, contrast);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'setContrast',
|
||||
ol.Layer.prototype.setContrast);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} hue Hue.
|
||||
*/
|
||||
ol.Layer.prototype.setHue = function(hue) {
|
||||
if (hue != this.getHue()) {
|
||||
this.set(ol.LayerProperty.HUE, hue);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'setHue',
|
||||
ol.Layer.prototype.setHue);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} opacity Opacity.
|
||||
*/
|
||||
ol.Layer.prototype.setOpacity = function(opacity) {
|
||||
opacity = goog.math.clamp(opacity, 0, 1);
|
||||
if (opacity != this.getOpacity()) {
|
||||
this.set(ol.LayerProperty.OPACITY, opacity);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'setOpacity',
|
||||
ol.Layer.prototype.setOpacity);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} saturation Saturation.
|
||||
*/
|
||||
ol.Layer.prototype.setSaturation = function(saturation) {
|
||||
saturation = goog.math.clamp(saturation, -1, 1);
|
||||
if (saturation != this.getSaturation()) {
|
||||
this.set(ol.LayerProperty.SATURATION, saturation);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'setSaturation',
|
||||
ol.Layer.prototype.setSaturation);
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} visible Visible.
|
||||
*/
|
||||
ol.Layer.prototype.setVisible = function(visible) {
|
||||
visible = !!visible;
|
||||
if (visible != this.getVisible()) {
|
||||
this.set(ol.LayerProperty.VISIBLE, visible);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.Layer.prototype,
|
||||
'setVisible',
|
||||
ol.Layer.prototype.setVisible);
|
||||
228
src/ol/layer/layer.js
Normal file
228
src/ol/layer/layer.js
Normal file
@@ -0,0 +1,228 @@
|
||||
goog.provide('ol.layer.Layer');
|
||||
goog.provide('ol.layer.LayerProperty');
|
||||
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.Store');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.layer.LayerProperty = {
|
||||
BRIGHTNESS: 'brightness',
|
||||
CONTRAST: 'contrast',
|
||||
HUE: 'hue',
|
||||
OPACITY: 'opacity',
|
||||
SATURATION: 'saturation',
|
||||
VISIBLE: 'visible'
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Object}
|
||||
* @param {ol.Store} store Store.
|
||||
* @param {Object.<string, *>=} opt_values Values.
|
||||
*/
|
||||
ol.layer.Layer = function(store, opt_values) {
|
||||
|
||||
goog.base(this);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Store}
|
||||
*/
|
||||
this.store_ = store;
|
||||
|
||||
this.setBrightness(0);
|
||||
this.setContrast(0);
|
||||
this.setHue(0);
|
||||
this.setOpacity(1);
|
||||
this.setSaturation(0);
|
||||
this.setVisible(true);
|
||||
|
||||
if (goog.isDef(opt_values)) {
|
||||
this.setValues(opt_values);
|
||||
}
|
||||
|
||||
};
|
||||
goog.inherits(ol.layer.Layer, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Brightness.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getBrightness = function() {
|
||||
return /** @type {number} */ this.get(ol.layer.LayerProperty.BRIGHTNESS);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'getBrightness',
|
||||
ol.layer.Layer.prototype.getBrightness);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Contrast.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getContrast = function() {
|
||||
return /** @type {number} */ this.get(ol.layer.LayerProperty.CONTRAST);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'getContrast',
|
||||
ol.layer.Layer.prototype.getContrast);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Hue.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getHue = function() {
|
||||
return /** @type {number} */ this.get(ol.layer.LayerProperty.HUE);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'getHue',
|
||||
ol.layer.Layer.prototype.getHue);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Opacity.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getOpacity = function() {
|
||||
return /** @type {number} */ this.get(ol.layer.LayerProperty.OPACITY);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'getOpacity',
|
||||
ol.layer.Layer.prototype.getOpacity);
|
||||
|
||||
|
||||
/**
|
||||
* @return {number} Saturation.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getSaturation = function() {
|
||||
return /** @type {number} */ this.get(ol.layer.LayerProperty.SATURATION);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'getSaturation',
|
||||
ol.layer.Layer.prototype.getSaturation);
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Store} Store.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getStore = function() {
|
||||
return this.store_;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Visible.
|
||||
*/
|
||||
ol.layer.Layer.prototype.getVisible = function() {
|
||||
return /** @type {boolean} */ this.get(ol.layer.LayerProperty.VISIBLE);
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'getVisible',
|
||||
ol.layer.Layer.prototype.getVisible);
|
||||
|
||||
|
||||
/**
|
||||
* @return {boolean} Is ready.
|
||||
*/
|
||||
ol.layer.Layer.prototype.isReady = function() {
|
||||
return this.getStore().isReady();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} brightness Brightness.
|
||||
*/
|
||||
ol.layer.Layer.prototype.setBrightness = function(brightness) {
|
||||
brightness = goog.math.clamp(brightness, -1, 1);
|
||||
if (brightness != this.getBrightness()) {
|
||||
this.set(ol.layer.LayerProperty.BRIGHTNESS, brightness);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'setBrightness',
|
||||
ol.layer.Layer.prototype.setBrightness);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} contrast Contrast.
|
||||
*/
|
||||
ol.layer.Layer.prototype.setContrast = function(contrast) {
|
||||
contrast = goog.math.clamp(contrast, -1, 1);
|
||||
if (contrast != this.getContrast()) {
|
||||
this.set(ol.layer.LayerProperty.CONTRAST, contrast);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'setContrast',
|
||||
ol.layer.Layer.prototype.setContrast);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} hue Hue.
|
||||
*/
|
||||
ol.layer.Layer.prototype.setHue = function(hue) {
|
||||
if (hue != this.getHue()) {
|
||||
this.set(ol.layer.LayerProperty.HUE, hue);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'setHue',
|
||||
ol.layer.Layer.prototype.setHue);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} opacity Opacity.
|
||||
*/
|
||||
ol.layer.Layer.prototype.setOpacity = function(opacity) {
|
||||
opacity = goog.math.clamp(opacity, 0, 1);
|
||||
if (opacity != this.getOpacity()) {
|
||||
this.set(ol.layer.LayerProperty.OPACITY, opacity);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'setOpacity',
|
||||
ol.layer.Layer.prototype.setOpacity);
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} saturation Saturation.
|
||||
*/
|
||||
ol.layer.Layer.prototype.setSaturation = function(saturation) {
|
||||
saturation = goog.math.clamp(saturation, -1, 1);
|
||||
if (saturation != this.getSaturation()) {
|
||||
this.set(ol.layer.LayerProperty.SATURATION, saturation);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'setSaturation',
|
||||
ol.layer.Layer.prototype.setSaturation);
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} visible Visible.
|
||||
*/
|
||||
ol.layer.Layer.prototype.setVisible = function(visible) {
|
||||
visible = !!visible;
|
||||
if (visible != this.getVisible()) {
|
||||
this.set(ol.layer.LayerProperty.VISIBLE, visible);
|
||||
}
|
||||
};
|
||||
goog.exportProperty(
|
||||
ol.layer.Layer.prototype,
|
||||
'setVisible',
|
||||
ol.layer.Layer.prototype.setVisible);
|
||||
@@ -5,7 +5,7 @@ goog.provide('ol.tilestore.XYZ');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.Attribution');
|
||||
goog.require('ol.Coordinate');
|
||||
goog.require('ol.Layer');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.Projection');
|
||||
goog.require('ol.Size');
|
||||
goog.require('ol.TileCoord');
|
||||
|
||||
@@ -9,7 +9,7 @@ goog.require('ol.renderer.Layer');
|
||||
* @constructor
|
||||
* @extends {ol.renderer.Layer}
|
||||
* @param {ol.renderer.Map} mapRenderer Map renderer.
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @param {!Element} target Target.
|
||||
*/
|
||||
ol.renderer.dom.Layer = function(mapRenderer, layer, target) {
|
||||
|
||||
@@ -2,8 +2,8 @@ goog.provide('ol.renderer.Layer');
|
||||
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.EventType');
|
||||
goog.require('ol.Layer');
|
||||
goog.require('ol.LayerProperty');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.layer.LayerProperty');
|
||||
goog.require('ol.Object');
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ goog.require('ol.Object');
|
||||
* @constructor
|
||||
* @extends {ol.Object}
|
||||
* @param {ol.renderer.Map} mapRenderer Map renderer.
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
*/
|
||||
ol.renderer.Layer = function(mapRenderer, layer) {
|
||||
|
||||
@@ -26,35 +26,35 @@ ol.renderer.Layer = function(mapRenderer, layer) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.Layer}
|
||||
* @type {ol.layer.Layer}
|
||||
*/
|
||||
this.layer_ = layer;
|
||||
|
||||
goog.events.listen(this.layer_,
|
||||
ol.Object.getChangedEventType(ol.LayerProperty.BRIGHTNESS),
|
||||
ol.Object.getChangedEventType(ol.layer.LayerProperty.BRIGHTNESS),
|
||||
this.handleLayerBrightnessChange, false, this);
|
||||
|
||||
goog.events.listen(this.layer_,
|
||||
ol.Object.getChangedEventType(ol.LayerProperty.CONTRAST),
|
||||
ol.Object.getChangedEventType(ol.layer.LayerProperty.CONTRAST),
|
||||
this.handleLayerContrastChange, false, this);
|
||||
|
||||
goog.events.listen(this.layer_,
|
||||
ol.Object.getChangedEventType(ol.LayerProperty.HUE),
|
||||
ol.Object.getChangedEventType(ol.layer.LayerProperty.HUE),
|
||||
this.handleLayerHueChange, false, this);
|
||||
|
||||
goog.events.listen(this.layer_, goog.events.EventType.LOAD,
|
||||
this.handleLayerLoad, false, this);
|
||||
|
||||
goog.events.listen(this.layer_,
|
||||
ol.Object.getChangedEventType(ol.LayerProperty.OPACITY),
|
||||
ol.Object.getChangedEventType(ol.layer.LayerProperty.OPACITY),
|
||||
this.handleLayerOpacityChange, false, this);
|
||||
|
||||
goog.events.listen(this.layer_,
|
||||
ol.Object.getChangedEventType(ol.LayerProperty.SATURATION),
|
||||
ol.Object.getChangedEventType(ol.layer.LayerProperty.SATURATION),
|
||||
this.handleLayerSaturationChange, false, this);
|
||||
|
||||
goog.events.listen(this.layer_,
|
||||
ol.Object.getChangedEventType(ol.LayerProperty.VISIBLE),
|
||||
ol.Object.getChangedEventType(ol.layer.LayerProperty.VISIBLE),
|
||||
this.handleLayerVisibleChange, false, this);
|
||||
|
||||
};
|
||||
@@ -62,7 +62,7 @@ goog.inherits(ol.renderer.Layer, ol.Object);
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.Layer} Layer.
|
||||
* @return {ol.layer.Layer} Layer.
|
||||
*/
|
||||
ol.renderer.Layer.prototype.getLayer = function() {
|
||||
return this.layer_;
|
||||
|
||||
@@ -97,7 +97,7 @@ goog.inherits(ol.renderer.Map, goog.Disposable);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.Map.prototype.addLayer = function(layer) {
|
||||
@@ -113,7 +113,7 @@ ol.renderer.Map.prototype.canRotate = goog.functions.FALSE;
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @protected
|
||||
* @return {ol.renderer.Layer} layerRenderer Layer renderer.
|
||||
*/
|
||||
@@ -136,7 +136,7 @@ ol.renderer.Map.prototype.disposeInternal = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {function(this: T, ol.Layer, ol.renderer.Layer, number)} f Function.
|
||||
* @param {function(this: T, ol.layer.Layer, ol.renderer.Layer, number)} f Function.
|
||||
* @param {T=} opt_obj Object.
|
||||
* @template T
|
||||
*/
|
||||
@@ -164,7 +164,7 @@ ol.renderer.Map.prototype.getCoordinateFromPixel = function(pixel) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @protected
|
||||
* @return {ol.renderer.Layer} Layer renderer.
|
||||
*/
|
||||
@@ -215,7 +215,7 @@ ol.renderer.Map.prototype.handleCenterChanged = function() {
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.Map.prototype.handleLayersAdd = function(collectionEvent) {
|
||||
var layer = /** @type {ol.Layer} */ collectionEvent.elem;
|
||||
var layer = /** @type {ol.layer.Layer} */ collectionEvent.elem;
|
||||
this.addLayer(layer);
|
||||
};
|
||||
|
||||
@@ -251,7 +251,7 @@ ol.renderer.Map.prototype.handleLayersChanged = function() {
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.Map.prototype.handleLayersRemove = function(collectionEvent) {
|
||||
var layer = /** @type {ol.Layer} */ collectionEvent.elem;
|
||||
var layer = /** @type {ol.layer.Layer} */ collectionEvent.elem;
|
||||
this.removeLayer(layer);
|
||||
};
|
||||
|
||||
@@ -281,7 +281,7 @@ ol.renderer.Map.prototype.handleSizeChanged = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @protected
|
||||
*/
|
||||
ol.renderer.Map.prototype.removeLayer = function(layer) {
|
||||
@@ -290,7 +290,7 @@ ol.renderer.Map.prototype.removeLayer = function(layer) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {ol.renderer.Layer} Layer renderer.
|
||||
* @protected
|
||||
*/
|
||||
@@ -321,7 +321,7 @@ ol.renderer.Map.prototype.render = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @param {ol.renderer.Layer} layerRenderer Layer renderer.
|
||||
* @protected
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
goog.provide('ol.renderer.webgl.Layer');
|
||||
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol.Layer');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.renderer.Layer');
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ goog.require('ol.renderer.Layer');
|
||||
* @constructor
|
||||
* @extends {ol.renderer.Layer}
|
||||
* @param {ol.renderer.Map} mapRenderer Map renderer.
|
||||
* @param {ol.Layer} layer Layer.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
*/
|
||||
ol.renderer.webgl.Layer = function(mapRenderer, layer) {
|
||||
goog.base(this, mapRenderer, layer);
|
||||
|
||||
@@ -17,7 +17,7 @@ goog.require('goog.events.EventType');
|
||||
goog.require('goog.functions');
|
||||
goog.require('goog.style');
|
||||
goog.require('goog.webgl');
|
||||
goog.require('ol.Layer');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.Map');
|
||||
goog.require('ol.TileLayer');
|
||||
goog.require('ol.renderer.webgl.FragmentShader');
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
goog.provide('ol.TileLayer');
|
||||
|
||||
goog.require('ol.Layer');
|
||||
goog.require('ol.layer.Layer');
|
||||
goog.require('ol.TileStore');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.Layer}
|
||||
* @extends {ol.layer.Layer}
|
||||
* @param {ol.TileStore} tileStore Tile store.
|
||||
* @param {Object.<string, *>=} opt_values Values.
|
||||
*/
|
||||
ol.TileLayer = function(tileStore, opt_values) {
|
||||
goog.base(this, tileStore, opt_values);
|
||||
};
|
||||
goog.inherits(ol.TileLayer, ol.Layer);
|
||||
goog.inherits(ol.TileLayer, ol.layer.Layer);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user