From 781317767516484f9a2bb7134772acd89e10ba5d Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Thu, 10 Aug 2023 18:47:16 +0200 Subject: [PATCH] don't zoom if there are no photos with coordinates --- modules/svg/local_photos.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/svg/local_photos.js b/modules/svg/local_photos.js index dd8681c1c..fafc958dd 100644 --- a/modules/svg/local_photos.js +++ b/modules/svg/local_photos.js @@ -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));