<gh_stars>1-10
{"ast":null,"code":"\"use strict\";\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport isEqual from 'fast-deep-equal';\nimport MapLayer from './MapLayer';\nimport pick from './utils/pick';\nvar OPTIONS = ['stroke', 'color', 'weight', 'opacity', 'lineCap', 'lineJoin', 'dashArray', 'dashOffset', 'fill', 'fillColor', 'fillOpacity', 'fillRule', 'bubblingMouseEvents', 'renderer', 'className', // Interactive Layer\n'interactive', // Layer\n'pane', 'attribution'];\n\nvar Path =\n/*#__PURE__*/\nfunction (_MapLayer) {\n  _inheritsLoose(Path, _MapLayer);\n\n  function Path(props) {\n    var _this;\n\n    _this = _MapLayer.call(this, props) || this;\n\n    if (_this.contextValue == null) {\n      _this.contextValue = _extends({}, props.leaflet, {\n        popupContainer: _this.leafletElement\n      });\n    }\n\n    return _this;\n  }\n\n  var _proto = Path.prototype;\n\n  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n    _MapLayer.prototype.componentDidUpdate.call(this, prevProps);\n\n    this.setStyleIfChanged(prevProps, this.props);\n  };\n\n  _proto.getPathOptions = function getPathOptions(props) {\n    return pick(props, OPTIONS);\n  };\n\n  _proto.setStyle = function setStyle(options) {\n    if (options === void 0) {\n      options = {};\n    }\n\n    this.leafletElement.setStyle(options);\n  };\n\n  _proto.setStyleIfChanged = function setStyleIfChanged(fromProps, toProps) {\n    var nextStyle = this.getPathOptions(toProps);\n\n    if (!isEqual(nextStyle, this.getPathOptions(fromProps))) {\n      this.setStyle(nextStyle);\n    }\n  };\n\n  return Path;\n}(MapLayer);\n\nexport { Path as default };","map":null,"metadata":{},"sourceType":"module"}