FiresMap refactor
This commit is contained in:
parent
eafebf9d2a
commit
57ea015c03
1 changed files with 6 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue