How to use the react-map-gl.supported function in react-map-gl

To help you get started, we’ve selected a few react-map-gl 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 uber / react-map-gl / test / deprecated / map-spec.js View on Github external
test('MapGL call onLoad when provided', t => {
  const reactContainer = document.createElement('div');
  document.body.appendChild(reactContainer);

  function onLoad(...args) {
    t.equal(args.length, 0, 'onLoad does not expose the map object.');
    t.end();
  }

  const props = {...defaultProps, onLoad};
  ReactDOM.render(, reactContainer);

  if (!MapGL.supported()) {
    t.end();
  }

});
github tmrowco / electricitymap-contrib / web / src / components / zonemap.js View on Github external
() => {
      if (!ReactMapGL.supported()) {
        setIsSupported(false);
        onMapError('WebGL not supported');
      }
    },
    [],