summaryrefslogtreecommitdiff
path: root/controllers/controllers.php
diff options
context:
space:
mode:
Diffstat (limited to 'controllers/controllers.php')
-rw-r--r--controllers/controllers.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php
index 0917315..82dfaca 100644
--- a/controllers/controllers.php
+++ b/controllers/controllers.php
@@ -898,3 +898,27 @@ $app->get('/airport-info', function() use($app){
$app->response()->body(json_encode($response));
}
});
+
+$app->get('/map-img', function() use($app) {
+
+ $params = $app->request()->params();
+
+ $app->response()['Content-type'] = 'image/png';
+
+ $params = [
+ 'marker[]' => 'lat:'.$params['lat'].';lng:'.$params['lng'].';icon:small-blue-cutout',
+ 'basemap' => 'custom',
+ 'width' => $params['w'],
+ 'height' => $params['h'],
+ 'zoom' => $params['z'],
+ 'tileurl' => Config::$mapTileURL,
+ 'token' => Config::$atlasToken,
+ ];
+
+ $ch = curl_init('https://atlas.p3k.io/map/img');
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
+ curl_exec($ch);
+
+});
+