modules/core/bundle/deckgl.js
function createCanvas(props) {
  let {container = document.body} = props;

  if (typeof container === 'string') {
    container = document.getElementById(container);
  }

  if (!container) {
    throw Error('Deck: container not found');
  }

  // Add DOM elements
  const containerStyle = window.getComputedStyle(container);
  if (containerStyle.position === 'static') {
    container.style.position = 'relative';
  }

  const mapCanvas = document.createElement('div');
  container.appendChild(mapCanvas);
  Object.assign(mapCanvas.style, CANVAS_STYLE);

  const deckCanvas = document.createElement('canvas');
  container.appendChild(deckCanvas);
  Object.assign(deckCanvas.style, CANVAS_STYLE);

  return {container, mapCanvas, deckCanvas};
}
function createCanvas(props) {
  let {container = document.body} = props;

  if (typeof container === 'string') {
    container = document.getElementById(container);
  }

  if (!container) {
    throw Error('Deck: container not found');
  }

  // Add DOM elements
  const containerStyle = window.getComputedStyle(container);
  if (containerStyle.position === 'static') {
    container.style.position = 'relative';
  }

  const mapCanvas = document.createElement('div');
  container.appendChild(mapCanvas);
  Object.assign(mapCanvas.style, CANVAS_STYLE);

  const deckCanvas = document.createElement('canvas');
  container.appendChild(deckCanvas);
  Object.assign(deckCanvas.style, CANVAS_STYLE);

  return {container, mapCanvas, deckCanvas};
}
function createCanvas ( props ) { let { container = document . body } = props ; if ( typeof container === 'string' ) { container = document . getElementById ( container ) ; } if ( ! container ) { throw Error ( 'Deck: container not found' ) ; } // Add DOM elements const containerStyle = window . getComputedStyle ( container ) ; if ( containerStyle . position === 'static' ) { container . style . position = 'relative' ; } const mapCanvas = document . createElement ( 'div' ) ; container . appendChild ( mapCanvas ) ; Object . assign ( mapCanvas . style , CANVAS_STYLE ) ; const deckCanvas = document . createElement ( 'canvas' ) ; container . appendChild ( deckCanvas ) ; Object . assign ( deckCanvas . style , CANVAS_STYLE ) ; return { container , mapCanvas , deckCanvas } ; }
Create canvas elements for map and deck
Create canvas elements for map and deck