Commit 2442f962 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: invalid map bounds with 0 georeferenced accessions

parent a5e831ef
......@@ -321,13 +321,15 @@ class BrowsePage extends React.Component<IMapPageProps, any> {
return <Loading />;
}
if (Math.abs(mapInfo.bounds[0][0] - mapInfo.bounds[1][0]) < Math.abs(initialBounds[0][0] - initialBounds[1][0])) {
initialBounds[0][0] = mapInfo.bounds[0][0];
initialBounds[1][0] = mapInfo.bounds[1][0];
}
if (Math.abs(mapInfo.bounds[0][1] - mapInfo.bounds[1][1]) < Math.abs(initialBounds[0][1] - initialBounds[1][1])) {
initialBounds[0][1] = mapInfo.bounds[0][1];
initialBounds[1][1] = mapInfo.bounds[1][1];
if (mapInfo.bounds[0][0] !== null && mapInfo.bounds[1][0] !== null) {
if (Math.abs(mapInfo.bounds[0][0] - mapInfo.bounds[1][0]) < Math.abs(initialBounds[0][0] - initialBounds[1][0])) {
initialBounds[0][0] = mapInfo.bounds[0][0];
initialBounds[1][0] = mapInfo.bounds[1][0];
}
if (Math.abs(mapInfo.bounds[0][1] - mapInfo.bounds[1][1]) < Math.abs(initialBounds[0][1] - initialBounds[1][1])) {
initialBounds[0][1] = mapInfo.bounds[0][1];
initialBounds[1][1] = mapInfo.bounds[1][1];
}
}
const suggestionTerms = new Map();
......
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