Add hub output with distance. #652
This commit is contained in:
parent
85be728bf6
commit
3e238347be
1 changed files with 11 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ use App\Service\MapTools;
|
|||
|
||||
class TestClosestOpenHubsCommand extends Command
|
||||
{
|
||||
$protected $maptools;
|
||||
protected $maptools;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
|
|
@ -37,7 +37,16 @@ class TestClosestOpenHubsCommand extends Command
|
|||
$lat = $input->getArgument('lat');
|
||||
|
||||
$point = new Point($long, $lat);
|
||||
$this->maptools->getClosestOpenHubs();
|
||||
|
||||
$hubs_with_distance = $this->maptools->getClosestOpenHubs($point, 10);
|
||||
|
||||
foreach($hubs_with_distance as $hub_dist)
|
||||
{
|
||||
$hub = $hub_dist['hub'];
|
||||
$distance = $hub_dist['distance'];
|
||||
|
||||
error_log('Hub ID ' . $hub->getID() . ' - ' . $hub->getName() . ' = ' . $distance . ' kms away.');
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue