map: fix typing

pull/417/head
Varun Patil 2023-02-09 20:13:30 -08:00
parent f278229cf6
commit 77c63c55cf
1 changed files with 2 additions and 2 deletions

View File

@ -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'];
}
}