text: "use strict";
  
  import _extends from "@babel/runtime/helpers/esm/extends";
  import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
  import { ImageOverlay as LeafletImageOverlay, latLngBounds } from 'leaflet';
  import { withLeaflet } from './context';
  import MapLayer from './MapLayer';
  
  var ImageOverlay = /*#__PURE__*/function (_MapLayer) {
    _inheritsLoose(ImageOverlay, _MapLayer);
  
    function ImageOverlay() {
      return _MapLayer.apply(this, arguments) || this;
    }
  
    var _proto = ImageOverlay.prototype;
  
    _proto.createLeafletElement = function createLeafletElement(props) {
      var el = new LeafletImageOverlay(props.url, props.bounds, this.getOptions(props));
      this.contextValue = _extends(_extends({}, props.leaflet), {}, {
        popupContainer: el
      });
      return el;
    };
  
    _proto.updateLeafletElement = function updateLeafletElement(fromProps, toProps) {
      if (toProps.url !== fromProps.url) {
        this.leafletElement.setUrl(toProps.url);
      }
  
      if (toProps.bounds !== fromProps.bounds) {
        this.leafletElement.setBounds(latLngBounds(toProps.bounds));
      }
  
      if (toProps.opacity !== fromProps.opacity) {
        this.leafletElement.setOpacity(toProps.opacity);
      }
  
      if (toProps.zIndex !== fromProps.zIndex) {
        this.leafletElement.setZIndex(toProps.zIndex);
      }
    };
  
    return ImageOverlay;
  }(MapLayer);
  
  export default withLeaflet(ImageOverlay);