I have the startup function in my Widget.js
startup : function () {
this.inherited(arguments);
this.horizontalSlider = new HorizSlider({
minimum : 0,
maximum : 1,
intermediateChanges : true,
onChange : function (value) {
console.log('slider value: ' + value);
this._onTransparencyChanged(value);
console.log('opacity changed');
}
}, this.sliderNode);
this.horizontalSlider.startup();
new HorzRuleLabels({
container : "bottomDecoration"
}, this.transparencyRule);
console.log('startup');
},
but the onChange function, in the horizontal slider, when I try to change the opacity of layers. The console show me the error above.
This is the function:
_onTransparencyChanged : function (opacity) {
this._vectorial.setOpacity(1 - opacity);
this._baseAerea.setOpacity(opacity);
}
And similarly if I put the code of _onTransparencyChanged function in the onChange function I get an error like : cannot read property 'setOpacity' of undefined. What ever I do , got an error.
Thanks a lot