summaryrefslogtreecommitdiff
path: root/src/http/Controller/Map.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/Controller/Map.php')
-rw-r--r--src/http/Controller/Map.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/http/Controller/Map.php b/src/http/Controller/Map.php
index 69d23e1..3b0773f 100644
--- a/src/http/Controller/Map.php
+++ b/src/http/Controller/Map.php
@@ -10,13 +10,17 @@ use Symfony\Component\Routing\Annotation\Route;
class Map
{
- #[Route(path: '/map/{x}/{y}/{range}', defaults: ['range' => 1], methods: ['GET'])]
+ #[Route(path: '/map/{x}/{y}/{range}', defaults: ['range' => 0], methods: ['GET'])]
public function region(Request $request): Response
{
$x = $request->get('x');
$y = $request->get('y');
$range = $request->get('range');
+ if ($range <= 0) {
+ $range = $_ENV['MAP_DEFAULT_RANGE'];
+ }
+
$statement = DB::query(
'select * from villages where x>=:x1 and x<=:x2 and y>=:y1 and y<=:y2',
[