How to use the react-map-gl.StaticMap 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 / deck.gl / website / src / components / mapbox / interactive-map.js View on Github external
import {PureComponent, createElement} from 'react';
import PropTypes from 'prop-types';
import MapControls from './map-controls';

// InteractiveMap is for browser only and should work with isomorphic rendering
// Conditionally require mapbox only in browser to avoid issues under node.js
// Node apps can use StaticMap directly - requires adding additional dependencies
import {isBrowser} from './globals';
const StaticMap = isBrowser ? require('react-map-gl').StaticMap : null;

const propTypes = {
  displayConstraints: PropTypes.object.isRequired
};

const defaultProps = {
  displayConstraints: {
    maxPitch: 60
  }
};

export default class InteractiveMap extends PureComponent {
  constructor(props) {
    super(props);
  }