Cleaner implementation of keys

This commit is contained in:
Petr Sloup
2016-06-29 20:17:58 +02:00
parent a9443edfc6
commit 1307b29ff9
4 changed files with 27 additions and 26 deletions
+7 -7
View File
@@ -3,11 +3,11 @@
<head>
<meta charset="UTF-8">
<title>{{name}} - TileServer GL</title>
<link rel="stylesheet" type="text/css" href="/mapbox-gl.css{{&access_key_query}}" />
<script src="/mapbox-gl.js{{&access_key_query}}"></script>
<link rel="stylesheet" type="text/css" href="/mapbox.css{{&access_key_query}}" />
<script src="/mapbox.js{{&access_key_query}}"></script>
<script src="/leaflet-hash.js{{&access_key_query}}"></script>
<link rel="stylesheet" type="text/css" href="/mapbox-gl.css{{&key_query}}" />
<script src="/mapbox-gl.js{{&key_query}}"></script>
<link rel="stylesheet" type="text/css" href="/mapbox.css{{&key_query}}" />
<script src="/mapbox.js{{&key_query}}"></script>
<script src="/leaflet-hash.js{{&key_query}}"></script>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
@@ -25,12 +25,12 @@
if (preference == 'vector') {
var map = new mapboxgl.Map({
container: 'map',
style: '/styles/{{id}}.json{{&access_key_query}}',
style: '/styles/{{id}}.json{{&key_query}}',
hash: true
});
map.addControl(new mapboxgl.Navigation());
} else {
var map = L.mapbox.map('map', '/styles/{{id}}/rendered.json{{&access_key_query}}', { zoomControl: false });
var map = L.mapbox.map('map', '/styles/{{id}}/rendered.json{{&key_query}}', { zoomControl: false });
new L.Control.Zoom({ position: 'topright' }).addTo(map);
setTimeout(function() {
new L.Hash(map);