"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _react = _interopRequireDefault(require("react"));

var _deck = _interopRequireWildcard(require("deck.gl"));

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var BoundaryMap = function BoundaryMap(props) {
  var viewport = props.viewport,
      data = props.data,
      opacity = props.opacity,
      getPolygon = props.getPolygon,
      getLineColor = props.getLineColor,
      getLineWidth = props.getLineWidth,
      lineWidthScale = props.lineWidthScale,
      lineJointRounded = props.lineJointRounded,
      getFillColor = props.getFillColor,
      filled = props.filled;
  return _react["default"].createElement("div", null, _react["default"].createElement(_deck["default"], _extends({
    className: "DeckGL"
  }, viewport), _react["default"].createElement(_deck.PolygonLayer, {
    id: "polygon-layer",
    className: "BoundaryMap",
    pickable: false,
    data: data,
    opacity: opacity,
    getPolygon: getPolygon,
    getLineColor: getLineColor,
    getLineWidth: getLineWidth,
    lineWidthScale: lineWidthScale,
    lineWidthMinPixels: 1,
    lineJointRounded: lineJointRounded,
    stroked: true,
    getFillColor: getFillColor,
    filled: filled,
    updateTriggers: {
      getLineColor: getLineColor,
      getFillColor: getFillColor
    }
  })));
};

BoundaryMap.propTypes = {
  viewport: _propTypes["default"].shape({}),
  data: _propTypes["default"].arrayOf(_propTypes["default"].shape({})).isRequired,
  opacity: _propTypes["default"].number,
  getPolygon: _propTypes["default"].func,
  getLineColor: _propTypes["default"].func,
  getLineWidth: _propTypes["default"].func,
  lineWidthScale: _propTypes["default"].number,
  lineJointRounded: _propTypes["default"].bool,
  getFillColor: _propTypes["default"].func,
  filled: _propTypes["default"].bool
};
BoundaryMap.defaultProps = {
  opacity: 1,
  getLineColor: function getLineColor() {
    return [255, 0, 0, 255];
  },
  getLineWidth: function getLineWidth() {
    return 40;
  },
  lineWidthScale: 1,
  lineJointRounded: false,
  getFillColor: function getFillColor() {
    return [0, 0, 0, 0];
  },
  filled: false
};
var _default = BoundaryMap;
exports["default"] = _default;