FiresMap refactor

This commit is contained in:
vjrj 2018-01-31 11:26:12 +01:00
parent eafebf9d2a
commit 57ea015c03

View file

@ -47,6 +47,7 @@ class FiresMap extends React.Component {
zoom: props.zoom
},
useMarkers: false,
scaleAdded: false,
showSubsUnion: true
};
const self = this;
@ -59,9 +60,6 @@ class FiresMap extends React.Component {
}
componentDidMount() {
if (this.fireMap) {
this.addScale();
}
}
onViewportChanged(viewport) {
@ -111,11 +109,15 @@ class FiresMap extends React.Component {
}
handleLeafletLoad(map) {
// console.log('Map loading');
// 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;
}
this.state.union = subsUnion(this.state.union, {
map,
subs: this.props.userSubs,