From 50630fe1c7e34210813b9bd1ce88479a45ef2fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Jan=C3=A1k?= Date: Tue, 1 Mar 2016 11:57:18 +0100 Subject: [PATCH] Get config from docker volumes if is provided --- tileserver.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tileserver.php b/tileserver.php index 8c5ee32..c490ce2 100644 --- a/tileserver.php +++ b/tileserver.php @@ -62,7 +62,10 @@ class Server { * Set config */ public function __construct() { - $this->config = $GLOBALS['config']; + //Get config from docker volumes + $envConfig = $_ENV['config'] == null ? array() : $_ENV['config']; + + $this->config = array_merge($GLOBALS['config'], $envConfig); } /** @@ -1000,14 +1003,14 @@ class Wmts extends Server { list( $maxx, $maxy ) = $mercator->LatLonToMeters($bounds[3], $bounds[2]); $bounds3857 = array($minx, $miny, $maxx, $maxy); } - + $wmtsHost = substr($m['tiles'][0], 0, strpos($m['tiles'][0], $m['basename'])); - $resourceUrlTemplate = $wmtsHost . 'wmts/' . $basename + $resourceUrlTemplate = $wmtsHost . 'wmts/' . $basename . '/{TileMatrixSet}/{TileMatrix}/{TileCol}/{TileRow}'; if(strlen($format) <= 4){ $resourceUrlTemplate .= '.' . $format; } - + echo' ' . $title . '