From 43f3f900ed3b3664a2a38e24f5b3a49a1d33f21b Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 8 Jan 2016 22:38:20 +0200 Subject: Fix new props zoom/slide behavior --- static/js/bundle.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'static/js/bundle.js') diff --git a/static/js/bundle.js b/static/js/bundle.js index 7cf4f57..80b017b 100644 --- a/static/js/bundle.js +++ b/static/js/bundle.js @@ -204,22 +204,21 @@ } } } + + _this2.map.setPaintProperty('radar-280-0', 'raster-opacity', 0.85); }); } }, { key: 'componentWillReceiveProps', - value: function componentWillReceiveProps() { + value: function componentWillReceiveProps(props) { + console.log('old' + this.state.slider, 'new' + props.slider); this.map.setPaintProperty('radar-' + this.state.res + '-' + this.state.slider, 'raster-opacity', 0); + this.map.setPaintProperty('radar-' + this.state.res + '-' + props.slider, 'raster-opacity', 0.85); this.setState({ 'res': this.state.res, - 'slider': this.props.slider + 'slider': props.slider }); } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.map.setPaintProperty('radar-' + this.state.res + '-' + this.state.slider, 'raster-opacity', 0.85); - } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { @@ -248,6 +247,7 @@ var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(Map).call(this, props)); _this3.onChangeHandler = function (e) { + console.log('handle', e); _this3.setState({ 'slider': 7 - e }); -- cgit v1.3.1