From 1004f4cce12cb1594547cd94d15b8228cbf30248 Mon Sep 17 00:00:00 2001
From: Petr Sloup
Date: Sat, 20 Aug 2016 14:01:12 +0200
Subject: [PATCH] Add XYZ to the list of services (close #42)
---
public/resources/index.css | 1 -
public/templates/index.tmpl | 23 ++++++++++++++++++++---
src/server.js | 9 +++++++++
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/public/resources/index.css b/public/resources/index.css
index 133e29e..ec18acc 100644
--- a/public/resources/index.css
+++ b/public/resources/index.css
@@ -78,7 +78,6 @@ section{
}
.details {
float:left;
- width:180px;
height: 128px;
padding: 20px 30px 20px 188px;
}
diff --git a/public/templates/index.tmpl b/public/templates/index.tmpl
index 231425b..051d85a 100644
--- a/public/templates/index.tmpl
+++ b/public/templates/index.tmpl
@@ -5,6 +5,15 @@
TileServerGL
+
diff --git a/src/server.js b/src/server.js
index 1047db7..e702036 100644
--- a/src/server.js
+++ b/src/server.js
@@ -241,6 +241,11 @@ module.exports = function(opts, callback) {
style.wmts_link = 'http://wmts.maptiler.com/' +
base64url('http://' + req.headers.host +
'/styles/' + id + '/rendered.json' + query) + '/wmts';
+
+ style.serving_rendered.tiles = utils.getTileUrls(
+ req, style.serving_rendered.tiles,
+ 'styles/' + id, style.serving_rendered.format);
+ style.xyz_link = style.serving_rendered.tiles[0];
}
});
var data = clone(serving.data || {});
@@ -265,6 +270,10 @@ module.exports = function(opts, callback) {
data_.wmts_link = 'http://wmts.maptiler.com/' +
base64url('http://' + req.headers.host +
'/data/' + id + '.json' + query) + '/wmts';
+
+ data_.tiles = utils.getTileUrls(
+ req, data_.tiles, 'data/' + id, data_.format);
+ data_.xyz_link = data_.tiles[0];
}
if (data_.filesize) {
var suffix = 'kB';