fix: add key_query to static assets 🎉 (#730)

* fix: add `key_query` to static assets

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: fix lint issues in css

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: issue with static images in `leaflet.css`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
Vinayak Kulkarni 2023-01-25 19:53:02 +05:30 committed by GitHub
parent a97139693c
commit 0519ee7535
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 523 additions and 488 deletions

View file

@ -17,38 +17,38 @@
font-style: normal; font-style: normal;
} }
body{ body {
background-color: #fff; background-color: #fff;
color: #212121; color: #212121;
font-family:'OpenSans', sans-serif, Arial; font-family: 'OpenSans', sans-serif, Arial;
font-size: 14px; font-size: 14px;
margin:0; margin: 0;
background-repeat:no-repeat !important; background-repeat: no-repeat !important;
background-size: contain !important; background-size: contain !important;
background-image: url(/images/header-map-1280px.png); background-image: url(/images/header-map-1280px.png);
} }
a{ a {
color: #499DCE; color: #499dce;
transition: color .2s; transition: color 0.2s;
} }
a:hover { a:hover {
color: #395D73; color: #395d73;
} }
.title { .title {
font-weight: bold; font-weight: bold;
font-size: 32px; font-size: 32px;
text-align:center; text-align: center;
margin:90px 0 0 0; margin: 90px 0 0 0;
position:relative; position: relative;
} }
.title.light:after { .title.light:after {
content: "light"; content: 'light';
display: block; display: block;
position: absolute; position: absolute;
left: 50%; left: 50%;
bottom: -5px; bottom: -5px;
color: #499DCE; color: #499dce;
font-size:.8em; font-size: 0.8em;
} }
section { section {
margin: 15px auto; margin: 15px auto;
@ -60,27 +60,27 @@ section {
} }
.subtitle { .subtitle {
font-size: 26px; font-size: 26px;
font-weight:normal; font-weight: normal;
text-align:center; text-align: center;
margin:10px 0 95px 0; margin: 10px 0 95px 0;
} }
.box-header { .box-header {
text-align:left; text-align: left;
text-transform:uppercase; text-transform: uppercase;
border:1px solid #ededed; border: 1px solid #ededed;
margin:25px 0 0 0; margin: 25px 0 0 0;
padding:12px 30px; padding: 12px 30px;
font-size:20px; font-size: 20px;
background:#fff; background: #fff;
} }
.item { .item {
background:#fff; background: #fff;
height: 191px; height: 191px;
border: 1px solid #ededed; border: 1px solid #ededed;
border-top:none; border-top: none;
} }
.item:nth-child(odd) { .item:nth-child(odd) {
background-color:#fbfbfb; background-color: #fbfbfb;
} }
.item img { .item img {
position: absolute; position: absolute;
@ -91,27 +91,27 @@ section {
border: 1px solid #ccc; border: 1px solid #ccc;
} }
.details { .details {
float:left; float: left;
height: 128px; height: 128px;
padding: 20px 30px 20px 188px; padding: 20px 30px 20px 188px;
} }
.details h3 { .details h3 {
font-size:18px; font-size: 18px;
margin-top: 25px; margin-top: 25px;
} }
.details p { .details p {
padding:0; padding: 0;
margin:18px 0; margin: 18px 0;
} }
.viewers { .viewers {
float:right; float: right;
text-align:center; text-align: center;
width: 120px; width: 120px;
margin-top: 25px; margin-top: 25px;
padding-right: 30px; padding-right: 30px;
} }
.btn { .btn {
display:block; display: block;
margin: 0; margin: 0;
line-height: 36px; line-height: 36px;
} }
@ -119,57 +119,58 @@ section {
position: relative; position: relative;
padding: 0; padding: 0;
overflow: hidden; overflow: hidden;
border-radius:4px; border-radius: 4px;
background-color: #499DCE; background-color: #499dce;
background: linear-gradient(90deg, #5aaad8, #4a9ecf); background: linear-gradient(90deg, #5aaad8, #4a9ecf);
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
font-weight: bold; font-weight: bold;
} }
.btn:first-child:hover { .btn:first-child:hover {
background: #395D73; background: #395d73;
} }
footer { footer {
width:100%; width: 100%;
border-top:1px solid #ededed; border-top: 1px solid #ededed;
text-align:center; text-align: center;
color:#d3d3d3; color: #d3d3d3;
padding-top:10px; padding-top: 10px;
font-size:12px; font-size: 12px;
} }
footer img { footer img {
width: 113px; width: 113px;
height: 31px; height: 31px;
} }
footer .t { footer .t {
display:none; display: none;
} }
footer p { footer p {
margin-top:0; margin-top: 0;
} }
footer a { footer a {
color: #787878; color: #787878;
text-decoration: none; text-decoration: none;
} }
.details h3, .identifier { .details h3,
.identifier {
max-width: 550px; max-width: 550px;
word-break: break-all; word-break: break-all;
} }
/* Responsive */ /* Responsive */
@media (max-width: 950px) { @media (max-width: 950px) {
section{ section {
margin: 0; margin: 0;
width: 96%; width: 96%;
padding: 2%; padding: 2%;
} }
} }
@media (max-width: 600px) { @media (max-width: 600px) {
.title{ .title {
margin: 25px 0 0 0; margin: 25px 0 0 0;
} }
.title.light:after { .title.light:after {
font-size:.6em; font-size: 0.6em;
} }
.title img { .title img {
width: 200px; width: 200px;

File diff suppressed because it is too large Load diff

View file

@ -5,10 +5,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{name}} - TileServer GL</title> <title>{{name}} - TileServer GL</title>
{{#is_vector}} {{#is_vector}}
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css{{&key_query}}" />
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css{{&key_query}}" />
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js"><\/script>'); }</script> <script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js{{&key_query}}"><\/script>'); }</script>
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js"><\/script>'); }</script> <script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js{{&key_query}}"><\/script>'); }</script>
<style> <style>
body {background:#fff;color:#333;font-family:Arial, sans-serif;} body {background:#fff;color:#333;font-family:Arial, sans-serif;}
#map {position:absolute;top:0;left:0;right:250px;bottom:0;} #map {position:absolute;top:0;left:0;right:250px;bottom:0;}
@ -18,13 +18,25 @@
</style> </style>
{{/is_vector}} {{/is_vector}}
{{^is_vector}} {{^is_vector}}
<link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css{{&key_query}}" />
<script src="{{public_url}}leaflet.js"></script> <script src="{{public_url}}leaflet.js{{&key_query}}"></script>
<script src="{{public_url}}leaflet-hash.js"></script> <script src="{{public_url}}leaflet-hash.js{{&key_query}}"></script>
<script src="{{public_url}}L.TileLayer.NoGap.js"></script> <script src="{{public_url}}L.TileLayer.NoGap.js{{&key_query}}"></script>
<style> <style>
body { margin:0; padding:0; } body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; } #map { position:absolute; top:0; bottom:0; width:100%; }
.leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers.png{{&key_query}});
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers-2x.png{{&key_query}});
background-size: 26px 26px;
}
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url({{public_url}}images/marker-icon.png{{&key_query}});
}
</style> </style>
{{/is_vector}} {{/is_vector}}
</head> </head>

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>TileServer GL - Server for vector and raster maps with GL styles</title> <title>TileServer GL - Server for vector and raster maps with GL styles</title>
<link rel="stylesheet" type="text/css" href="{{public_url}}index.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}index.css{{&key_query}}" />
<script> <script>
function toggle_xyz(id) { function toggle_xyz(id) {
var el = document.getElementById(id); var el = document.getElementById(id);
@ -17,7 +17,7 @@
</head> </head>
<body> <body>
<section> <section>
<h1 class="title {{#if is_light}}light{{/if}}"><img src="{{public_url}}images/logo.png" alt="TileServer GL" /></h1> <h1 class="title {{#if is_light}}light{{/if}}"><img src="{{public_url}}images/logo.png{{&key_query}}" alt="TileServer GL" /></h1>
<h2 class="subtitle">Vector {{#if is_light}}<s>and raster</s>{{else}}and raster{{/if}} maps with GL styles</h2> <h2 class="subtitle">Vector {{#if is_light}}<s>and raster</s>{{else}}and raster{{/if}} maps with GL styles</h2>
{{#if styles}} {{#if styles}}
<h2 class="box-header">Styles</h2> <h2 class="box-header">Styles</h2>
@ -27,7 +27,7 @@
{{#if thumbnail}} {{#if thumbnail}}
<img src="{{public_url}}styles/{{@key}}/{{thumbnail}}{{&../key_query}}" alt="{{name}} preview" /> <img src="{{public_url}}styles/{{@key}}/{{thumbnail}}{{&../key_query}}" alt="{{name}} preview" />
{{else}} {{else}}
<img src="{{public_url}}images/placeholder.png" alt="{{name}} preview" /> <img src="{{public_url}}images/placeholder.png{{&key_query}}" alt="{{name}} preview" />
{{/if}} {{/if}}
<div class="details"> <div class="details">
<h3>{{name}}</h3> <h3>{{name}}</h3>
@ -74,7 +74,7 @@
{{#if thumbnail}} {{#if thumbnail}}
<img src="{{public_url}}data/{{@key}}/{{thumbnail}}{{&../key_query}}" alt="{{name}} preview" /> <img src="{{public_url}}data/{{@key}}/{{thumbnail}}{{&../key_query}}" alt="{{name}} preview" />
{{else}} {{else}}
<img src="{{public_url}}images/placeholder.png" alt="{{name}} preview" /> <img src="{{public_url}}images/placeholder.png{{&key_query}}" alt="{{name}} preview" />
{{/if}} {{/if}}
<div class="details"> <div class="details">
<h3>{{name}}</h3> <h3>{{name}}</h3>
@ -104,7 +104,7 @@
{{/if}} {{/if}}
</section> </section>
<footer> <footer>
<a href="https://www.maptiler.com/" target="_blank"><img src="{{public_url}}images/maptiler-logo.svg" /></a> <a href="https://www.maptiler.com/" target="_blank"><img src="{{public_url}}images/maptiler-logo.svg{{&key_query}}" /></a>
<p> <p>
<a href="https://github.com/maptiler/tileserver-gl" target="_blank">Powered by TileServer GL ({{server_version}})</a> <a href="https://www.maptiler.com/" target="_blank">an open-source project from MapTiler.</a> <a href="https://github.com/maptiler/tileserver-gl" target="_blank">Powered by TileServer GL ({{server_version}})</a> <a href="https://www.maptiler.com/" target="_blank">an open-source project from MapTiler.</a>
</p> </p>

View file

@ -4,17 +4,29 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{name}} - TileServer GL</title> <title>{{name}} - TileServer GL</title>
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl.css{{&key_query}}" />
<link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}maplibre-gl-inspect.css{{&key_query}}" />
<link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css" /> <link rel="stylesheet" type="text/css" href="{{public_url}}leaflet.css{{&key_query}}" />
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js"><\/script>'); }</script> <script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-compat.js{{&key_query}}"><\/script>'); }</script>
<script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js"><\/script>'); }</script> <script>if (typeof Symbol !== 'undefined') { document.write('<script src="{{public_url}}maplibre-gl-inspect.min.js{{&key_query}}"><\/script>'); } else { document.write('<script src="{{public_url}}maplibre-gl-inspect-compat.min.js{{&key_query}}"><\/script>'); }</script>
<script src="{{public_url}}leaflet.js"></script> <script src="{{public_url}}leaflet.js{{&key_query}}"></script>
<script src="{{public_url}}leaflet-hash.js"></script> <script src="{{public_url}}leaflet-hash.js{{&key_query}}"></script>
<script src="{{public_url}}L.TileLayer.NoGap.js"></script> <script src="{{public_url}}L.TileLayer.NoGap.js{{&key_query}}"></script>
<style> <style>
body { margin:0; padding:0; } body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; } #map { position:absolute; top:0; bottom:0; width:100%; }
.leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers.png{{&key_query}});
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url({{public_url}}images/layers-2x.png{{&key_query}});
background-size: 26px 26px;
}
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url({{public_url}}images/marker-icon.png{{&key_query}});
}
</style> </style>
</head> </head>
<body> <body>