From 656cc283fe87c80008ad6215e67b60680edd3c92 Mon Sep 17 00:00:00 2001 From: vjrj Date: Wed, 31 Jan 2018 11:53:07 +0100 Subject: [PATCH] Trying to catch firemap exception --- imports/ui/pages/FiresMap/FiresMap.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/imports/ui/pages/FiresMap/FiresMap.js b/imports/ui/pages/FiresMap/FiresMap.js index 041ae97..6e14d7b 100644 --- a/imports/ui/pages/FiresMap/FiresMap.js +++ b/imports/ui/pages/FiresMap/FiresMap.js @@ -112,11 +112,15 @@ class FiresMap extends React.Component { // console.log(map); if (map) { console.log('Firesmap loading'); - const bounds = this.getMap().getBounds(); - mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]); - if (!this.state.scaleAdded) { - this.addScale(); - this.state.scaleAdded = true; + try { + const bounds = this.getMap().getBounds(); + mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]); + if (!this.state.scaleAdded) { + this.addScale(); + this.state.scaleAdded = true; + } + } catch (e) { + console.log('Failed to set map bounds and scale'); } this.state.union = subsUnion(this.state.union, { map,