FiresMap issue with init
This commit is contained in:
parent
b6963ff290
commit
fde04bb77f
1 changed files with 124 additions and 122 deletions
|
|
@ -81,6 +81,7 @@ class FiresMap extends React.Component {
|
||||||
|
|
||||||
handleViewportChange(viewport) {
|
handleViewportChange(viewport) {
|
||||||
console.log(`Viewport changed: ${JSON.stringify(viewport)}`);
|
console.log(`Viewport changed: ${JSON.stringify(viewport)}`);
|
||||||
|
if (this.fireMap) {
|
||||||
const bounds = this.getMap().getBounds();
|
const bounds = this.getMap().getBounds();
|
||||||
// console.log(bounds);
|
// console.log(bounds);
|
||||||
mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]);
|
mapSize.set([bounds.getNorthEast(), bounds.getSouthWest()]);
|
||||||
|
|
@ -95,6 +96,7 @@ class FiresMap extends React.Component {
|
||||||
center.set(viewport.center);
|
center.set(viewport.center);
|
||||||
this.setState({ viewport });
|
this.setState({ viewport });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
centerOnUserLocation(viewport) {
|
centerOnUserLocation(viewport) {
|
||||||
this.setState({ viewport });
|
this.setState({ viewport });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue