Fix plz error
This commit is contained in:
parent
28f71ee479
commit
e59f3c05e3
3 changed files with 36 additions and 7 deletions
|
@ -9,12 +9,19 @@ class DistanceCalculator
|
|||
{
|
||||
public function calculateDistance(Coordinate $coordinate1, Coordinate $coordinate2)
|
||||
{
|
||||
$calculator = new Vincenty();
|
||||
if ($coordinate1 == null || $coordinate2 == null)
|
||||
{
|
||||
$distance = "N/A";
|
||||
}
|
||||
else
|
||||
{
|
||||
$calculator = new Vincenty();
|
||||
|
||||
$distance = $calculator->getDistance($coordinate1, $coordinate2);
|
||||
|
||||
$distance = round($distance / 1000);
|
||||
$distance = $calculator->getDistance($coordinate1, $coordinate2);
|
||||
|
||||
$distance = round($distance / 1000);
|
||||
}
|
||||
|
||||
return $distance;
|
||||
}
|
||||
}
|
Reference in a new issue