text: "use strict";
  
  import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
  import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
  import { Control } from 'leaflet';
  import { Component } from 'react';
  
  var MapControl =
  /*#__PURE__*/
  function (_Component) {
    _inheritsLoose(MapControl, _Component);
  
    function MapControl(props) {
      var _this;
  
      _this = _Component.call(this, props) || this;
  
      _defineProperty(_assertThisInitialized(_this), "leafletElement", void 0);
  
      _this.leafletElement = _this.createLeafletElement(_this.props);
      return _this;
    }
  
    var _proto = MapControl.prototype;
  
    _proto.createLeafletElement = function createLeafletElement(_props) {
      throw new Error('createLeafletElement() must be implemented');
    };
  
    _proto.updateLeafletElement = function updateLeafletElement(fromProps, toProps) {
      if (toProps.position !== fromProps.position) {
        this.leafletElement.setPosition(toProps.position);
      }
    };
  
    _proto.componentDidMount = function componentDidMount() {
      this.leafletElement.addTo(this.props.leaflet.map);
    };
  
    _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
      this.updateLeafletElement(prevProps, this.props);
    };
  
    _proto.componentWillUnmount = function componentWillUnmount() {
      this.leafletElement.remove();
    };
  
    _proto.render = function render() {
      return null;
    };
  
    return MapControl;
  }(Component);
  
  export { MapControl as default };