From 70159a5b298f80f8b898d0f834197ec27ff31962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Jan=C3=A1k?= Date: Fri, 4 Mar 2016 12:07:37 +0100 Subject: [PATCH] Layer list improved --- tileserver.php | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/tileserver.php b/tileserver.php index a55a323..49c12e0 100644 --- a/tileserver.php +++ b/tileserver.php @@ -14,7 +14,7 @@ $config['availableFormats'] = array('png', 'jpg', 'jpeg', 'gif', 'webp', 'pbf', Router::serve(array( '/' => 'Server:getHtml', - '/test' => 'Server:getInfo', + '/maps' => 'Server:getInfo', '/html' => 'Server:getHtml', '/:alpha/:number/:number/:number.grid.json' => 'Json:getUTFGrid', '/:alpha.json' => 'Json:getJson', @@ -492,25 +492,19 @@ class Server { $this->setDatasets(); $maps = array_merge($this->fileLayer, $this->dbLayer); header('Content-Type: text/html;charset=UTF-8'); - echo '' . $this->config['serverTitle'] . ''; - echo '

' . $this->config['serverTitle'] . '

'; - echo 'TileJSON service: ' . $this->config['baseUrls'][0] . '/index.json
'; - echo 'WMTS service: ' . $this->config['baseUrls'][0] . '/wmts
'; - echo 'TMS service: ' . $this->config['baseUrls'][0] . '/tms'; + echo '' . $this->config['serverTitle'] . '' . + '

' . $this->config['serverTitle'] . '

' . + 'TileJSON service: ' . $this->config['baseUrls'][0] . '/index.json
' . + 'WMTS service: ' . $this->config['baseUrls'][0] . '/wmts
' . + 'TMS service: ' . $this->config['baseUrls'][0] . '/tms'; foreach ($maps as $map) { - $extend = '['; - foreach ($map['bounds'] as $ext) { - $extend = $extend . ' ' . $ext; - } - $extend = $extend . ' ]'; - if (strpos($map['basename'], 'mbtiles') !== false) { - echo '

Available MBtiles tileset: ' . $map['basename'] . '
'; - } else { - echo '

Available file tileset: ' . $map['basename'] . '
'; - } - echo 'Metadata: ' - . $this->config['baseUrls'][0] . '/' . $map['basename'] . '.json
'; - echo 'Bounds: ' . $extend . '

'; + $extend = '[' . implode($map['bounds'], ', ') . ']'; + echo '

Tileset: ' . $map['basename'] . '
' . + 'Metadata: ' . + $this->config['baseUrls'][0] . '/' . $map['basename'] . '.json
' . + 'Bounds: ' . $extend ; + if(isset($map['crs'])){echo '
CRS: ' . $map['crs'];} + echo '

'; } echo '

Copyright (C) 2016 - Klokan Technologies GmbH

'; echo '';