How to use @mapbox/mapbox-gl-supported - 9 common examples

To help you get started, we’ve selected a few @mapbox/mapbox-gl-supported examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / dr-ui / src / components / gl-wrapper / gl-wrapper.js View on Github external
componentDidMount() {
    this.setState({ supported: supported() });
  }
  render() {
github mapbox / mapbox-gl-js / docs / components / example.js View on Github external
render() {
            const {frontMatter} = this.props;
            frontMatter.language = ['JavaScript'];
            frontMatter.contentType = 'example';
            return (
                
                    <div>
                        <div>
                            <div>
                                <h1>{frontMatter.title}</h1>
                                <div>{md(frontMatter.description)}</div>

                                {!supported() &amp;&amp;
                                    <div id="unsupported">
                                        <div>
                                            <div>Mapbox GL unsupported</div>
                                            <div>Mapbox GL requires <a href="http://caniuse.com/webgl">WebGL support</a>. Please check that you are using a supported browser and that WebGL is <a href="http://get.webgl.org/">enabled</a>.</div>
                                        </div>
                                    </div>}
                            </div>

                            {supported() &amp;&amp;
                                </div></div>
github mapbox / mapbox-gl-js / docs / components / example.js View on Github external
<div>
                        <div>
                            <div>
                                <h1>{frontMatter.title}</h1>
                                <div>{md(frontMatter.description)}</div>

                                {!supported() &amp;&amp;
                                    <div id="unsupported">
                                        <div>
                                            <div>Mapbox GL unsupported</div>
                                            <div>Mapbox GL requires <a href="http://caniuse.com/webgl">WebGL support</a>. Please check that you are using a supported browser and that WebGL is <a href="http://get.webgl.org/">enabled</a>.</div>
                                        </div>
                                    </div>}
                            </div>

                            {supported() &amp;&amp;
                                </div></div>
github mapbox / mapbox-gl-js / src / ui / map.js View on Github external
_setupPainter() {
        const attributes = extend({}, isSupported.webGLContextAttributes, {
            failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat,
            preserveDrawingBuffer: this._preserveDrawingBuffer,
            antialias: this._antialias || false
        });

        const gl = this._canvas.getContext('webgl', attributes) ||
            this._canvas.getContext('experimental-webgl', attributes);

        if (!gl) {
            this.fire(new ErrorEvent(new Error('Failed to initialize WebGL')));
            return;
        }

        this.painter = new Painter(gl, this.transform);

        webpSupported.testSupport(gl);
github mapbox / mapbox-gl-js / src / ui / map.js View on Github external
_setupPainter() {
        const attributes = extend({}, isSupported.webGLContextAttributes, {
            failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat,
            preserveDrawingBuffer: this._preserveDrawingBuffer,
            antialias: this._antialias || false
        });

        const gl = this._canvas.getContext('webgl', attributes) ||
            this._canvas.getContext('experimental-webgl', attributes);

        if (!gl) {
            this.fire(new ErrorEvent(new Error('Failed to initialize WebGL')));
            return;
        }

        this.painter = new Painter(gl, this.transform);

        webpSupported.testSupport(gl);

@mapbox/mapbox-gl-supported

A library to determine if a browser supports Mapbox GL JS

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis

Similar packages