don't zoom if there are no photos with coordinates

This commit is contained in:
Martin Raifer
2023-08-10 18:47:16 +02:00
parent 5951391ae6
commit 7813177675
+3 -2
View File
@@ -292,9 +292,10 @@ export function svgLocalPhotos(projection, context, dispatch) {
drawPhotos.fitZoom = function() {
const coords = _photos
.map(image => image.loc);
.map(image => image.loc)
.filter(l => isArray(l) && isNumber(l[0]) && isNumber(l[1]));
if (coords.length === 0) return;
const extent = coords
.filter(l => isArray(l) && isNumber(l[0]) && isNumber(l[1]))
.map(l => geoExtent(l, l))
.reduce((a, b) => a.extend(b));