60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Ramcar\BaseController;
|
|
use App\Access\Generator;
|
|
|
|
use CrEOF\Spatial\PHP\Types\Geometry\Point;
|
|
|
|
use App\Entity\Outlet;
|
|
use GuzzleHttp\Client as GuzzleClient;
|
|
use App\Service\MapTools;
|
|
use Doctrine\Common\Util\Debug;
|
|
|
|
class TestController extends BaseController
|
|
{
|
|
public function index(Generator $acl_gen)
|
|
{
|
|
$params = $this->initParameters('home');
|
|
|
|
$acl_data = $acl_gen->getACL();
|
|
error_log(print_r($acl_data, true));
|
|
|
|
return $this->render('home.html.twig', $params);
|
|
}
|
|
|
|
public function testIsGranted()
|
|
{
|
|
$params = $this->initParameters('home');
|
|
|
|
error_log(print_r($this->isGranted('dashboard.menu'), true));
|
|
|
|
return $this->render('home.html.twig', $params);
|
|
}
|
|
|
|
public function gmap()
|
|
{
|
|
$params = $this->initParameters('home');
|
|
|
|
return $this->render('test/map.html.twig', $params);
|
|
}
|
|
|
|
public function distance(MapTools $map_tools)
|
|
{
|
|
$params = $this->initParameters('home');
|
|
|
|
$point = new Point(121.0495453, 14.6042567);
|
|
// $point = new Point(120.343692, 16.048560);
|
|
|
|
$res = $map_tools->getClosestOutlets($point, 10);
|
|
foreach ($res as $data)
|
|
{
|
|
error_log($data['db_distance']);
|
|
error_log($data['distance']);
|
|
error_log($data['duration']);
|
|
}
|
|
|
|
return $this->render('home.html.twig', $params);
|
|
}
|
|
}
|