Fix viewer vector/raster autodetection

This commit is contained in:
Petr Sloup 2016-06-29 15:14:51 +02:00
parent 1104bf8a57
commit a55b5ad69c

View File

@ -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',