Minor fix in firesmap for race condition

This commit is contained in:
vjrj 2018-02-08 20:41:24 +01:00
parent 35ba215834
commit c3bc4e604a

View file

@ -103,9 +103,8 @@ class FiresMap extends React.Component {
this.setState({ useMarkers: use });
}
addScale() {
addScale(map) {
// https://www.npmjs.com/package/leaflet-graphicscale
const map = this.getMap();
const options = {
fill: 'fill',
showSubunits: true
@ -120,7 +119,7 @@ class FiresMap extends React.Component {
const bounds = lmap.getBounds();
mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]);
if (!this.state.scaleAdded) {
this.addScale();
this.addScale(lmap);
this.state.scaleAdded = true;
}
} catch (e) {