summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2019-10-16 21:54:40 +0300
committerYuval Adam <_@yuv.al>2019-10-16 21:54:40 +0300
commitb5cdb40f9d55f4553c79e688dccffa63042ae76a (patch)
tree8c0e05815f48e4a0cbb5c6e34b40244ebe4030e0 /src
parentb056abbde2274661f15676ed07c29a13c620753c (diff)
Set proper layer opacity
Diffstat (limited to 'src')
-rw-r--r--src/Geshem.js41
-rw-r--r--src/Map.js2
2 files changed, 1 insertions, 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 (
<div id="geshem">
diff --git a/src/Map.js b/src/Map.js
index 843b9be..b1db5fd 100644
--- a/src/Map.js
+++ b/src/Map.js
@@ -45,7 +45,7 @@ function Map(props) {
sourceId={id}
type="raster"
paint={{
- "raster-opacity": i == props.slider ? 1 : 0,
+ "raster-opacity": i == props.slider ? 0.85 : 0,
"raster-opacity-transition": {
duration: 0
}