Commit 6b09326a authored by Oleksii Savran's avatar Oleksii Savran

Fix: Map bounds

-removed redundant code
parent 7fceeb3d
......@@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
import { WithTranslation, withTranslation } from 'react-i18next';
import { WithStyles, withStyles } from '@material-ui/core/styles';
import { isMobile } from 'is-mobile';
import { isNumber } from 'lodash';
import { bindActionCreators } from 'redux';
import {showSnackbar} from 'actions/snackbar';
import navigateTo from 'actions/navigation';
......@@ -561,9 +562,14 @@ class MapPage extends React.Component<IMapPageProps, any> {
return <ErrorMessage error={ mapInfo.error }/>;
}
if (mapInfo.data.bounds[0] && mapInfo.data.bounds[1] && mapInfo.data.bounds[0].length === 2 && mapInfo.data.bounds[1].length === 2) {
initialBounds = mapInfo.data.bounds;
}
if (mapInfo.data.bounds[0] && mapInfo.data.bounds[1] && mapInfo.data.bounds[0].length === 2 && mapInfo.data.bounds[1].length === 2) {
initialBounds = mapInfo.data.bounds.map((bound, i) => {
return [
isNumber(bound[0]) ? bound[0] : initialBounds[i][0],
isNumber(bound[1]) ? bound[1] : initialBounds[i][1],
];
});
}
const suggestionTerms = new Map();
if (suggestions) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment