mirror of
https://github.com/maptiler/tileserver-gl.git
synced 2024-11-10 12:44:22 +03:00
Fix viewer vector/raster autodetection
This commit is contained in:
parent
1104bf8a57
commit
a55b5ad69c
@ -17,10 +17,11 @@
|
||||
<h1 style="display:none;">{{name}}</h1>
|
||||
<div id='map'></div>
|
||||
<script>
|
||||
var preference = (location.search || '').substr(1);
|
||||
if (preference != 'vector' && preference != 'raster') {
|
||||
preference = mapboxgl.supported() ? 'vector' : 'raster';
|
||||
}
|
||||
var q = (location.search || '').substr(1).split('&');
|
||||
var preference =
|
||||
q.indexOf('vector') >= 0 ? 'vector' :
|
||||
(q.indexOf('raster') >= 0 ? 'raster' :
|
||||
(mapboxgl.supported() ? 'vector' : 'raster'));
|
||||
if (preference == 'vector') {
|
||||
var map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
|
Loading…
Reference in New Issue
Block a user