From b5cdb40f9d55f4553c79e688dccffa63042ae76a Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 16 Oct 2019 21:54:40 +0300 Subject: Set proper layer opacity --- src/Geshem.js | 41 ----------------------------------------- src/Map.js | 2 +- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/src/Geshem.js b/src/Geshem.js index 6e09561..2ccaa62 100644 --- a/src/Geshem.js +++ b/src/Geshem.js @@ -88,47 +88,6 @@ class OldGeshem extends Component { } } - showRadarLayer(res, i) { - this.map.setPaintProperty(`radar-${res}-${i}`, "raster-opacity", 0.85); - } - - hideRadarLayer(res, i) { - this.map.setPaintProperty(`radar-${res}-${i}`, "raster-opacity", 0); - } - - removeRadarLayer(res, i) { - this.map.removeLayer(`radar-${res}-${i}`); - } - - onChangeSlider(val) { - this.hideRadarLayer(this.state.res, this.state.slider); - this.setState({ slider: val }); - this.showRadarLayer(this.state.res, val); - } - - initMap() { - const { lng, lat, zoom } = this.state; - - this.map.on("style.load", () => { - this.setState({ - mapLoaded: true - }); - if (this.state.imgs !== null) { - this.loadSources(); - } - }); - } - - componentDidMount() { - // this.getGeolocation(); - if (this.state.playback) { - this.loadPlaybackData(); - } else { - this.loadRadarData(); - } - this.initMap(); - } - render() { return (