diff options
author | Markus Koch <markus@notsyncing.net> | 2020-04-25 15:56:50 +0200 |
---|---|---|
committer | Markus Koch <markus@notsyncing.net> | 2020-04-25 15:56:50 +0200 |
commit | 105dc4d3da821219d8d2a01b17833ead0c7c107f (patch) | |
tree | 20050b3ce8327efdd3181d17043e08a798d6cef3 /htdocs/tiles | |
parent | a4c7833d87a930ac00ca1df361fef02edfad67ac (diff) | |
download | lifomapserver-105dc4d3da821219d8d2a01b17833ead0c7c107f.tar.gz lifomapserver-105dc4d3da821219d8d2a01b17833ead0c7c107f.tar.bz2 lifomapserver-105dc4d3da821219d8d2a01b17833ead0c7c107f.zip |
Add tile ID conversion php file
Diffstat (limited to 'htdocs/tiles')
-rw-r--r-- | htdocs/tiles/index.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/htdocs/tiles/index.php b/htdocs/tiles/index.php index 62a2de0..7e0a89b 100644 --- a/htdocs/tiles/index.php +++ b/htdocs/tiles/index.php @@ -1,3 +1,14 @@ <?php + $x = intval($_GET['x']); + $y = intval($_GET['y']); + $z = intval($_GET['z']); + $id = preg_replace("/[^a-z0-9\-]/", "", $_GET['id']); + if (strlen($id) > 30) die(); + $hdr = "Location: /maps.linux-forks.de/tiles/$id/$z/" . str_pad($y * (2**$z) + $x, 5, "0", STR_PAD_LEFT) . ".png"; + if (isset($_GET["debug"])) { + echo $hdr; + } else { + header($hdr); + } ?> |