From 181985859ef628e06aebd02841eea78faed57867 Mon Sep 17 00:00:00 2001 From: kunkliricsi Date: Wed, 18 Nov 2020 12:35:33 +0100 Subject: [PATCH] Added componentDidMount heatmap initializer --- Birdmap.API/ClientApp/src/components/heatmap/Heatmap.jsx | 9 ++++++++- Birdmap.API/nlog.config | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Birdmap.API/ClientApp/src/components/heatmap/Heatmap.jsx b/Birdmap.API/ClientApp/src/components/heatmap/Heatmap.jsx index ebcae64..a200483 100644 --- a/Birdmap.API/ClientApp/src/components/heatmap/Heatmap.jsx +++ b/Birdmap.API/ClientApp/src/components/heatmap/Heatmap.jsx @@ -42,7 +42,14 @@ export default class MapContainer extends Component { componentDidMount() { this.context.addHandler(C.probability_method_name, this.probabilityHandler); - this.setState({ heatmapPoints: [...this.context.heatmapPoints] }); + const newPoints = []; + for (var p of this.context.heatmapPoints) { + if (p.prob > 0.5) { + newPoints.push(p) + } + } + + this.setState({ heatmapPoints: newPoints }); } componentWillUnmount() { diff --git a/Birdmap.API/nlog.config b/Birdmap.API/nlog.config index ff4ba76..bf4e2ce 100644 --- a/Birdmap.API/nlog.config +++ b/Birdmap.API/nlog.config @@ -20,6 +20,9 @@ + + @@ -33,6 +36,9 @@ + + +