12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import has from"../../core/has.js";import{isSome as e,isNone as t}from"../../core/maybe.js";var r;function o(t,r,o={}){const l=n(t);for(;l.length>1;){const t=c(r,l.shift(),o);if(e(t))return t}return i(r,l.shift(),o)}function n(e){const t=has("esri-force-webgl");if(t===r.WEBGL1||t===r.WEBGL2)return[t];switch(e){case"2d":return has("mac")&&has("chrome")?[r.WEBGL1,r.WEBGL2]:[r.WEBGL2,r.WEBGL1];case"3d":return[r.WEBGL2,r.WEBGL1]}}function i(e,r,o={}){if(!window.WebGLRenderingContext)return l(e,a),null;const n=c(e,r,o);return t(n)&&l(e,s),n}function c(e,t,o={}){const n=t===r.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let i=null;for(const r of n){try{i=e.getContext(r,o)}catch(c){}if(i)break}return i}function l(e,t){const r=e.parentNode;r&&(r.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(r||(r={}));const a='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',s='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';export{r as ContextType,c as createContext,o as createContextOrErrorHTML,n as getContextTypes};
|