From eafebf9d2a7fb577ac156c6cd795121a9907fa7d Mon Sep 17 00:00:00 2001 From: vjrj Date: Wed, 31 Jan 2018 10:57:12 +0100 Subject: [PATCH] FiresMap refactor --- imports/ui/pages/FiresMap/FiresMap.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index 22f83b4..e7ffcc3 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -60,11 +60,7 @@ class FiresMap extends React.Component { componentDidMount() { if (this.fireMap) { - if (this.getMap().getCenter()) { - const bounds = this.getMap().getBounds(); - mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]); - this.addScale(); - } + this.addScale(); } } @@ -118,6 +114,8 @@ class FiresMap extends React.Component { // console.log('Map loading'); // console.log(map); if (map) { + const bounds = this.getMap().getBounds(); + mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]); this.state.union = subsUnion(this.state.union, { map, subs: this.props.userSubs,