From a9f20474b3ae1e0ba25438d19ddaf47f844a4963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Mon, 20 Mar 2023 17:41:49 +0100 Subject: [PATCH] Fix bug with MultiPoint --- js/ds.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ds.js b/js/ds.js index 78de7ab..2b3d6ff 100644 --- a/js/ds.js +++ b/js/ds.js @@ -248,11 +248,11 @@ DataSpace.getCenterCoordinates = function (geoJSON) let coordinates = geometry === 'Point' ? geoJSON.features[0].geometry.coordinates : - geoJSON.features[0].geometry.coordinates[0]; + geoJSON.features[0].geometry.coordinates[0]; let centerCoords = [coordinates[1], coordinates[0]]; - - if (geometry !== 'Point') { + + if (! geometry.includes('Point')) { let avX = coordinates[0] .map(el => el[0]) .reduce((p, c) => p + c) / coordinates[0].length;