updateSize() {
    const targetElement = this.getTargetElement();

    let size = undefined;
    if (targetElement) {
      const computedStyle = getComputedStyle(targetElement);
      const width =
        targetElement.offsetWidth -
        parseFloat(computedStyle['borderLeftWidth']) -
        parseFloat(computedStyle['paddingLeft']) -
        parseFloat(computedStyle['paddingRight']) -
        parseFloat(computedStyle['borderRightWidth']);
      const height =
        targetElement.offsetHeight -
        parseFloat(computedStyle['borderTopWidth']) -
        parseFloat(computedStyle['paddingTop']) -
        parseFloat(computedStyle['paddingBottom']) -
        parseFloat(computedStyle['borderBottomWidth']);
      if (!isNaN(width) && !isNaN(height)) {
        size = [width, height];
        if (
          !hasArea(size) &&
          !!(
            targetElement.offsetWidth ||
            targetElement.offsetHeight ||
            targetElement.getClientRects().length
          )
        ) {
          // eslint-disable-next-line
          console.warn(
            "No map visible because the map container's width or height are 0."
          );
        }
      }
    }

    this.setSize(size);
    this.updateViewportSize_();
  }
/**
   * Force a recalculation of the map viewport size.  This should be called when
   * third-party code changes the size of the map viewport.
   * @api
   */
Force a recalculation of the map viewport size.  This should be called when
third-party code changes the size of the map viewport.
@api
Force a recalculation of the map viewport size . This should be called when third - party code changes the size of the map viewport . @api
updateSize() {
    const targetElement = this.getTargetElement();
    let size = undefined;
    if (targetElement) {
      const computedStyle = getComputedStyle(targetElement);
      const width =
        targetElement.offsetWidth -
        parseFloat(computedStyle['borderLeftWidth']) -
        parseFloat(computedStyle['paddingLeft']) -
        parseFloat(computedStyle['paddingRight']) -
        parseFloat(computedStyle['borderRightWidth']);
      const height =
        targetElement.offsetHeight -
        parseFloat(computedStyle['borderTopWidth']) -
        parseFloat(computedStyle['paddingTop']) -
        parseFloat(computedStyle['paddingBottom']) -
        parseFloat(computedStyle['borderBottomWidth']);
      if (!isNaN(width) && !isNaN(height)) {
        size = [width, height];
        if (
          !hasArea(size) &&
          !!(
            targetElement.offsetWidth ||
            targetElement.offsetHeight ||
            targetElement.getClientRects().length
          )
        ) {
          console.warn(
            "No map visible because the map container's width or height are 0."
          );
        }
      }
    }
    this.setSize(size);
    this.updateViewportSize_();
  }
updateSize ( ) { const targetElement = this . getTargetElement ( ) ; let size = undefined ; if ( targetElement ) { const computedStyle = getComputedStyle ( targetElement ) ; const width = targetElement . offsetWidth - parseFloat ( computedStyle [ 'borderLeftWidth' ] ) - parseFloat ( computedStyle [ 'paddingLeft' ] ) - parseFloat ( computedStyle [ 'paddingRight' ] ) - parseFloat ( computedStyle [ 'borderRightWidth' ] ) ; const height = targetElement . offsetHeight - parseFloat ( computedStyle [ 'borderTopWidth' ] ) - parseFloat ( computedStyle [ 'paddingTop' ] ) - parseFloat ( computedStyle [ 'paddingBottom' ] ) - parseFloat ( computedStyle [ 'borderBottomWidth' ] ) ; if ( ! isNaN ( width ) && ! isNaN ( height ) ) { size = [ width , height ] ; if ( ! hasArea ( size ) && ! ! ( targetElement . offsetWidth || targetElement . offsetHeight || targetElement . getClientRects ( ) . length ) ) { console . warn ( "No map visible because the map container's width or height are 0." ) ; } } } this . setSize ( size ) ; this . updateViewportSize_ ( ) ; }
Force a recalculation of the map viewport size.
Force a recalculation of the map viewport size .
// eslint-disable-next-line