diff --git a/lib/Db/TimelineWriteMap.php b/lib/Db/TimelineWriteMap.php index 93f7f5da..6ec75435 100644 --- a/lib/Db/TimelineWriteMap.php +++ b/lib/Db/TimelineWriteMap.php @@ -29,13 +29,13 @@ trait TimelineWriteMap // Find cluster closest to the point $minDist = PHP_INT_MAX; $minId = -1; - foreach ($rows as $r) { + foreach ($rows as &$r) { $clusterLat = (float) $r['lat']; $clusterLon = (float) $r['lon']; $dist = ($lat - $clusterLat) ** 2 + ($lon - $clusterLon) ** 2; if ($dist < $minDist) { $minDist = $dist; - $minId = $r['id']; + $minId = (int) $r['id']; } }