This commit is contained in:
Lachlan Kermode
2019-01-17 18:00:28 +00:00
parent 9d6d51e11d
commit 6226dc3e85
3 changed files with 6 additions and 9 deletions

View File

@@ -35,7 +35,7 @@ class Map extends React.Component {
}
componentWillReceiveProps(nextProps) {
// Set appropriate zoom for narrative
// Set appropriate zoom for narrative
if (hash(nextProps.app.mapBounds) !== hash(this.props.app.mapBounds)
&& nextProps.app.mapBounds !== null) {
this.map.fitBounds(nextProps.app.mapBounds);
@@ -43,13 +43,13 @@ class Map extends React.Component {
if (hash(nextProps.app.selected) !== hash(this.props.app.selected)) {
// Fly to first of events selected
const eventPoint = (nextProps.app.selected.length > 0) ? nextProps.app.selected[0] : null;
if (eventPoint !== null && eventPoint.latitude && eventPoint.longitude) {
this.map.setView([eventPoint.latitude, eventPoint.longitude]);
}
}
}
}
}
}
initializeMap() {
/**