Provide a reference to the layer

This commit is contained in:
Tim Schaub
2014-04-03 10:41:02 -06:00
parent 6c84358619
commit 9d5451b1d6
3 changed files with 37 additions and 4 deletions

View File

@@ -25,7 +25,8 @@ ol.layer.LayerProperty = {
/**
* @typedef {{brightness: number,
* @typedef {{layer: ol.layer.Layer,
* brightness: number,
* contrast: number,
* hue: number,
* opacity: number,
@@ -126,6 +127,7 @@ ol.layer.Base.prototype.getLayerState = function() {
var maxResolution = this.getMaxResolution();
var minResolution = this.getMinResolution();
return {
layer: /** @type {ol.layer.Layer} */ (this),
brightness: goog.isDef(brightness) ? goog.math.clamp(brightness, -1, 1) : 0,
contrast: goog.isDef(contrast) ? Math.max(contrast, 0) : 1,
hue: goog.isDef(hue) ? hue : 0,