File size: 1,577 Bytes
fcf3b03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!doctype html>

<html style='height: 100%;'>

<head>
    <link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' />

    <style>
        html, body {
            height: 100%;
        }

        body {
            display:flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        h1, h2 {
            display: block;
        }
    </style>
</head>

<body class='fill-gray'>
    <h2 class='fancy center'>Mapbox GL JS is</h2>
    <h1 class='fancy center'>...</h1>
    <h3 id="reason" class='fancy center'></h3>

    <script src='index.js'></script>
    <script>
        var bodyElement = document.body;
        var h1Element = document.getElementsByTagName('h1')[0];
        var reasonEl = document.getElementById('reason');

        if (mapboxgl.supported({failIfMajorPerformanceCaveat: true})) {
            h1Element.innerHTML = 'supported';
            bodyElement.className = 'fill-green';
        } else if (mapboxgl.supported({failIfMajorPerformanceCaveat: false})) {
            h1Element.innerHTML = 'supported with a major performance caveat';
            reasonEl.innerHTML = '(' + mapboxgl.notSupportedReason({failIfMajorPerformanceCaveat: false}) + ')';
            bodyElement.className = 'fill-orange';
        } else {
            h1Element.innerHTML = 'not supported';
            reasonEl.innerHTML = '(' + mapboxgl.notSupportedReason({failIfMajorPerformanceCaveat: true}) + ')';
            bodyElement.className = 'fill-red';
        }
    </script>
</body>

</html>