FiresMap refactor

This commit is contained in:
vjrj 2018-01-31 10:57:12 +01:00
parent 68aba3b9c1
commit eafebf9d2a

View file

@ -60,13 +60,9 @@ class FiresMap extends React.Component {
componentDidMount() { componentDidMount() {
if (this.fireMap) { if (this.fireMap) {
if (this.getMap().getCenter()) {
const bounds = this.getMap().getBounds();
mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]);
this.addScale(); this.addScale();
} }
} }
}
onViewportChanged(viewport) { onViewportChanged(viewport) {
this.debounceView(viewport); this.debounceView(viewport);
@ -118,6 +114,8 @@ class FiresMap extends React.Component {
// console.log('Map loading'); // console.log('Map loading');
// console.log(map); // console.log(map);
if (map) { if (map) {
const bounds = this.getMap().getBounds();
mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]);
this.state.union = subsUnion(this.state.union, { this.state.union = subsUnion(this.state.union, {
map, map,
subs: this.props.userSubs, subs: this.props.userSubs,