You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.1 MiB
2 lines
2.1 MiB
3 years ago
|
/*! For license information please see 17.e59dc5b9.chunk.js.LICENSE.txt */
|
||
|
(this["webpackJsonpsimpro-web"]=this["webpackJsonpsimpro-web"]||[]).push([[17,4,7],{1154:function(e,t,n){"use strict";var r=n(601),a=n(616),i=n(2),o=n.n(i),s=n(801),l=n(772),c=n(773),u=n(813),f=n(814),h=n(760),d=n(793),p=n(788),m=n(789),g=n(790),v=n(990),b=n(657),y=(n(623),n(679),n(649),n(594),n(429),n(924)),_=n.n(y),w=(n(1627),n(79)),E=(n(1628),n(1629)),C=n.n(E),O=n(951);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var T={onEdited:"draw:edited",onDrawStart:"draw:drawstart",onDrawStop:"draw:drawstop",onDrawVertex:"draw:drawvertex",onEditStart:"draw:editstart",onEditMove:"draw:editmove",onEditResize:"draw:editresize",onEditVertex:"draw:editvertex",onEditStop:"draw:editstop",onDeleted:"draw:deleted",onDeleteStart:"draw:deletestart",onDeleteStop:"draw:deletestop"};function A(e){var t=Object(O.c)(),n=Object(i.useRef)(),r=Object(i.useRef)(e),a=function(n){var r=e.onCreated;(t.layerContainer||t.map).addLayer(n.layer),r&&r(n)};return o.a.useEffect((function(){var r=t.map,i=e.onMounted;for(var o in T)r.on(T[o],(function(t){var n=Object.keys(T).filter((function(e){return T[e]===t.type}));if(1===n.length){var r=n[0];e[r]&&e[r](t)}}));return r.on(_.a.Draw.Event.CREATED,a),n.current=P(e,t),r.addControl(n.current),i&&i(n.current),function(){for(var t in r.off(_.a.Draw.Event.CREATED,a),T)e[t]&&r.off(T[t],e[t])}}),[]),o.a.useEffect((function(){if(C()(e.draw,r.current.draw)&&C()(e.edit,r.current.edit)&&e.position===r.current.position)return!1;var a=t.map;n.current.remove(a),n.current=P(e,t),n.current.addTo(a);var i=e.onMounted;return i&&i(n.current),null}),[e.draw,e.edit,e.position]),null}function P(e,t){var n=t.layerContainer,r=e.draw,a=e.edit,i=e.position,o={edit:k(k({},a),{},{featureGroup:n})};return r&&(o.draw=k({},r)),i&&(o.position=i),new y.Control.Draw(o)}A.propTypes=k(k({},Object.keys(T).reduce((function(e,t){return e[t]=w.PropTypes.func,e}),{})),{},{onCreated:w.PropTypes.func,onMounted:w.PropTypes.func,draw:w.PropTypes.shape({polyline:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),polygon:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),rectangle:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),circle:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),marker:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool])}),edit:w.PropTypes.shape({edit:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),remove:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),poly:w.PropTypes.oneOfType([w.PropTypes.object,w.PropTypes.bool]),allowIntersection:w.PropTypes.bool}),position:w.PropTypes.oneOf(["topright","topleft","bottomright","bottomleft"]),leaflet:w.PropTypes.shape({map:w.PropTypes.instanceOf(y.Map),layerContainer:w.PropTypes.shape({addLayer:w.PropTypes.func.isRequired,removeLayer:w.PropTypes.func.isRequired})})});function L(){L=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(k){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var a=t&&t.prototype instanceof f?t:f,i=Object.create(a.prototype),o=new C(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(a,i){if("executing"===r)throw new Error("Generator is already running")
|