1
0
mirror of https://github.com/klokantech/tileserver-php.git synced 2025-01-16 21:58:34 +01:00

Modified WMTS Resource URL generation to support hostnames that contain the layer name.

If the hostname contained the layer name (eg. https://layername.domain.com/layername/wmts) then the WMTS capabilities document contained an incorrect Resource URL because the hostname was stripped back to simply https://.  This modification simply looks for the last occurrence of the layer name instead of the first when forming the Resource URL.
This commit is contained in:
David Eagles 2021-09-24 11:09:17 +10:00 committed by GitHub
parent eb571b5d70
commit 7800af830a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1031,7 +1031,7 @@ class Wmts extends Server {
$maxMercatorZoom = max($maxMercatorZoom, $m['maxzoom']);
}
$wmtsHost = substr($m['tiles'][0], 0, strpos($m['tiles'][0], $m['basename']));
$wmtsHost = substr($m['tiles'][0], 0, strrpos($m['tiles'][0], $m['basename']));
$resourceUrlTemplate = $wmtsHost . $basename
. '/{TileMatrix}/{TileCol}/{TileRow}';
if(strlen($format) <= 4){