summaryrefslogtreecommitdiff
path: root/src/http/Controller/Map.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-03-24 13:28:57 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-03-24 13:28:57 +0100
commita21b030abd4d5cd88f914f79574e425c7908553a (patch)
treec4eca5ff8e3dd5b12c4a151045ebb0991b211a9b /src/http/Controller/Map.php
parentd58f61770463aab2c71464c11f902f0074b49b62 (diff)
various changesHEADmain
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',
[