From c3bc4e604a0866dc6d8cd45ad82af04034ddf417 Mon Sep 17 00:00:00 2001 From: vjrj Date: Thu, 8 Feb 2018 20:41:24 +0100 Subject: [PATCH] Minor fix in firesmap for race condition --- imports/ui/pages/FiresMap/FiresMap.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index e2b6b8c..15850f2 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -103,9 +103,8 @@ class FiresMap extends React.Component { this.setState({ useMarkers: use }); } - addScale() { + addScale(map) { // https://www.npmjs.com/package/leaflet-graphicscale - const map = this.getMap(); const options = { fill: 'fill', showSubunits: true @@ -120,7 +119,7 @@ class FiresMap extends React.Component { const bounds = lmap.getBounds(); mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]); if (!this.state.scaleAdded) { - this.addScale(); + this.addScale(lmap); this.state.scaleAdded = true; } } catch (e) {