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

@ -28,11 +28,11 @@ body{
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;
@ -42,13 +42,13 @@ a:hover {
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;
@ -120,14 +120,14 @@ section {
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%;
@ -151,7 +151,8 @@ 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;
} }
@ -169,7 +170,7 @@ footer a {
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;

View file

@ -99,17 +99,35 @@
-moz-user-select: none; -moz-user-select: none;
} }
.leaflet-pane { z-index: 400; } .leaflet-pane {
z-index: 400;
}
.leaflet-tile-pane { z-index: 200; } .leaflet-tile-pane {
.leaflet-overlay-pane { z-index: 400; } z-index: 200;
.leaflet-shadow-pane { z-index: 500; } }
.leaflet-marker-pane { z-index: 600; } .leaflet-overlay-pane {
.leaflet-tooltip-pane { z-index: 650; } z-index: 400;
.leaflet-popup-pane { z-index: 700; } }
.leaflet-shadow-pane {
z-index: 500;
}
.leaflet-marker-pane {
z-index: 600;
}
.leaflet-tooltip-pane {
z-index: 650;
}
.leaflet-popup-pane {
z-index: 700;
}
.leaflet-map-pane canvas { z-index: 100; } .leaflet-map-pane canvas {
.leaflet-map-pane svg { z-index: 200; } z-index: 100;
}
.leaflet-map-pane svg {
z-index: 200;
}
.leaflet-vml-shape { .leaflet-vml-shape {
width: 1px; width: 1px;
@ -121,7 +139,6 @@
position: absolute; position: absolute;
} }
/* control positioning */ /* control positioning */
.leaflet-control { .leaflet-control {
@ -168,7 +185,6 @@
margin-right: 10px; margin-right: 10px;
} }
/* zoom and fade animations */ /* zoom and fade animations */
.leaflet-fade-anim .leaflet-popup { .leaflet-fade-anim .leaflet-popup {
@ -205,7 +221,6 @@ svg.leaflet-zoom-animated {
visibility: hidden; visibility: hidden;
} }
/* cursors */ /* cursors */
.leaflet-interactive { .leaflet-interactive {
@ -257,23 +272,21 @@ svg.leaflet-image-layer.leaflet-interactive path {
outline-offset: 1px; outline-offset: 1px;
} }
.leaflet-container a { .leaflet-container a {
color: #0078A8; color: #0078a8;
} }
.leaflet-zoom-box { .leaflet-zoom-box {
border: 2px dotted #38f; border: 2px dotted #38f;
background: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.5);
} }
/* general typography */ /* general typography */
.leaflet-container { .leaflet-container {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-size: 12px; font-size: 12px;
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1.5; line-height: 1.5;
} }
/* general toolbar styles */ /* general toolbar styles */
.leaflet-bar { .leaflet-bar {
@ -338,11 +351,11 @@ svg.leaflet-image-layer.leaflet-interactive path {
text-indent: 1px; text-indent: 1px;
} }
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { .leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {
font-size: 22px; font-size: 22px;
} }
/* layers control */ /* layers control */
.leaflet-control-layers { .leaflet-control-layers {
@ -398,11 +411,11 @@ svg.leaflet-image-layer.leaflet-interactive path {
} }
/* Default icon URLs */ /* Default icon URLs */
.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */ .leaflet-default-icon-path {
/* used only in path-guessing heuristic, see L.Icon.Default */
background-image: url(images/marker-icon.png); background-image: url(images/marker-icon.png);
} }
/* attribution and scale controls */ /* attribution and scale controls */
.leaflet-container .leaflet-control-attribution { .leaflet-container .leaflet-control-attribution {
@ -465,7 +478,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
background-clip: padding-box; background-clip: padding-box;
} }
/* popup */ /* popup */
.leaflet-popup { .leaflet-popup {
@ -548,7 +560,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
width: 24px; width: 24px;
margin: 0 auto; margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; -ms-filter: 'progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)';
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
} }
@ -559,7 +571,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
border: 1px solid #999; border: 1px solid #999;
} }
/* div icon */ /* div icon */
.leaflet-div-icon { .leaflet-div-icon {
@ -567,7 +578,6 @@ svg.leaflet-image-layer.leaflet-interactive path {
border: 1px solid #666; border: 1px solid #666;
} }
/* Tooltip */ /* Tooltip */
/* Base styles for the element that has a tooltip */ /* Base styles for the element that has a tooltip */
.leaflet-tooltip { .leaflet-tooltip {
@ -597,7 +607,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
pointer-events: none; pointer-events: none;
border: 6px solid transparent; border: 6px solid transparent;
background: transparent; background: transparent;
content: ""; content: '';
} }
/* Directions */ /* Directions */

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>