diff options
| author | Yuval Adam <yuval@y3xz.com> | 2016-01-08 22:38:20 +0200 |
|---|---|---|
| committer | Yuval Adam <yuval@y3xz.com> | 2016-01-08 22:38:20 +0200 |
| commit | 43f3f900ed3b3664a2a38e24f5b3a49a1d33f21b (patch) | |
| tree | 3d1ea1a8374e9594559bc5e110bb1f735de72096 /static/js | |
| parent | f745a835e841bdb48f36705fe08b7b4209ff37d3 (diff) | |
Fix new props zoom/slide behavior
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/bundle.js | 14 |
1 files changed, 7 insertions, 7 deletions
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,23 +204,22 @@ } } } + + _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() { this.map.remove(); @@ -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 }); |
