1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-08-08 07:36:28 +02:00

Layer list improved

This commit is contained in:
Dalibor Janák
2016-03-04 12:07:37 +01:00
parent fdeb010831
commit 70159a5b29

View File

@@ -14,7 +14,7 @@ $config['availableFormats'] = array('png', 'jpg', 'jpeg', 'gif', 'webp', 'pbf',
Router::serve(array( Router::serve(array(
'/' => 'Server:getHtml', '/' => 'Server:getHtml',
'/test' => 'Server:getInfo', '/maps' => 'Server:getInfo',
'/html' => 'Server:getHtml', '/html' => 'Server:getHtml',
'/:alpha/:number/:number/:number.grid.json' => 'Json:getUTFGrid', '/:alpha/:number/:number/:number.grid.json' => 'Json:getUTFGrid',
'/:alpha.json' => 'Json:getJson', '/:alpha.json' => 'Json:getJson',
@@ -492,25 +492,19 @@ class Server {
$this->setDatasets(); $this->setDatasets();
$maps = array_merge($this->fileLayer, $this->dbLayer); $maps = array_merge($this->fileLayer, $this->dbLayer);
header('Content-Type: text/html;charset=UTF-8'); header('Content-Type: text/html;charset=UTF-8');
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>' . $this->config['serverTitle'] . '</title></head><body>'; echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>' . $this->config['serverTitle'] . '</title></head><body>' .
echo '<h1>' . $this->config['serverTitle'] . '</h1>'; '<h1>' . $this->config['serverTitle'] . '</h1>' .
echo 'TileJSON service: <a href="//' . $this->config['baseUrls'][0] . '/index.json">' . $this->config['baseUrls'][0] . '/index.json</a><br>'; 'TileJSON service: <a href="//' . $this->config['baseUrls'][0] . '/index.json">' . $this->config['baseUrls'][0] . '/index.json</a><br>' .
echo 'WMTS service: <a href="//' . $this->config['baseUrls'][0] . '/wmts">' . $this->config['baseUrls'][0] . '/wmts</a><br>'; 'WMTS service: <a href="//' . $this->config['baseUrls'][0] . '/wmts">' . $this->config['baseUrls'][0] . '/wmts</a><br>' .
echo 'TMS service: <a href="//' . $this->config['baseUrls'][0] . '/tms">' . $this->config['baseUrls'][0] . '/tms</a>'; 'TMS service: <a href="//' . $this->config['baseUrls'][0] . '/tms">' . $this->config['baseUrls'][0] . '/tms</a>';
foreach ($maps as $map) { foreach ($maps as $map) {
$extend = '['; $extend = '[' . implode($map['bounds'], ', ') . ']';
foreach ($map['bounds'] as $ext) { echo '<p>Tileset: <b>' . $map['basename'] . '</b><br>' .
$extend = $extend . ' ' . $ext; 'Metadata: <a href="//' . $this->config['baseUrls'][0] . '/' . $map['basename'] . '.json">' .
} $this->config['baseUrls'][0] . '/' . $map['basename'] . '.json</a><br>' .
$extend = $extend . ' ]'; 'Bounds: ' . $extend ;
if (strpos($map['basename'], 'mbtiles') !== false) { if(isset($map['crs'])){echo '<br>CRS: ' . $map['crs'];}
echo '<p>Available MBtiles tileset: ' . $map['basename'] . '<br>'; echo '</p>';
} else {
echo '<p>Available file tileset: ' . $map['basename'] . '<br>';
}
echo 'Metadata: <a href="//' . $this->config['baseUrls'][0] . '/' . $map['basename'] . '.json">'
. $this->config['baseUrls'][0] . '/' . $map['basename'] . '.json</a><br>';
echo 'Bounds: ' . $extend . '</p>';
} }
echo '<p>Copyright (C) 2016 - Klokan Technologies GmbH</p>'; echo '<p>Copyright (C) 2016 - Klokan Technologies GmbH</p>';
echo '</body></html>'; echo '</body></html>';