Commit 135457ae authored by Adrien Pavie's avatar Adrien Pavie
Browse files

Fix bug in initial bbox

parent b57ffdb5
......@@ -50,8 +50,14 @@ FROM (
`, [ sid ])
.then(result2 => {
geojson.features = result2.rows[0].features;
const bbox = result2.rows[0].envelope && result2.rows[0].envelope.coordinates[0];
geojson.bbox = bbox && [ bbox[0][0], bbox[0][1], bbox[2][0], bbox[2][1] ];
let bbox;
try {
bbox = result2.rows[0].envelope && result2.rows[0].envelope.coordinates[0];
geojson.bbox = bbox && [ bbox[0][0], bbox[0][1], bbox[2][0], bbox[2][1] ];
}
catch(e) {
console.error("Invalid bbox", bbox);
}
return geojson;
});
}
......
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