/
Support.ts
36 lines (34 loc) · 993 Bytes
/
Support.ts
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
import * as support from "./utils/Support";
/**
* Test whether the current browser supports the full
* functionality of MapillaryJS.
*
* @description The full functionality includes WebGL rendering.
*
* @return {boolean}
*
* @example `var supported = Mapillary.isSupported();`
*/
export function isSupported(): boolean {
return isFallbackSupported() &&
support.isWebGLSupportedCached();
}
/**
* Test whether the current browser supports the fallback
* functionality of MapillaryJS.
*
* @description The fallback functionality does not include WebGL
* rendering, only 2D canvas rendering.
*
* @return {boolean}
*
* @example `var fallbackSupported = Mapillary.isFallbackSupported();`
*/
export function isFallbackSupported(): boolean {
return support.isBrowser() &&
support.isBlobSupported() &&
support.isArraySupported() &&
support.isFunctionSupported() &&
support.isJSONSupported() &&
support.isObjectSupported();
}