You cannot 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.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9750],{69528:function(e,t,i){var n=i(41376),c=i(54354),s=i(69039),o=i(77975),r=i(720),a=i(77138),v=i(52110),u=i(64498),h=i(61038),l=i(99247),f=i(79847),g=i(95783),d=i(42010),w=i(41372),y=new d.Z({source:new f.Z}),A=new w.Z({source:new g.Z,style:new s.ZP({fill:new o.Z({color:"rgba(255, 255, 255, 0.2)"}),stroke:new r.Z({color:"#ffcc33",width:2}),image:new a.Z({radius:7,fill:new o.Z({color:"#ffcc33"})})})}),p=new n.Z({layers:[y,A],target:"map",view:new c.ZP({center:[-11e6,46e5],zoom:4})}),Z={init:function(){this.select=new v.Z,p.addInteraction(this.select),this.modify=new u.Z({features:this.select.getFeatures()}),p.addInteraction(this.modify),this.setEvents()},setEvents:function(){var e=this.select.getFeatures();this.select.on("change:active",(function(){e.forEach((function(t){e.remove(t)}))}))},setActive:function(e){this.select.setActive(e),this.modify.setActive(e)}};Z.init();var P=document.getElementById("options-form"),m={init:function(){p.addInteraction(this.Point),this.Point.setActive(!1),p.addInteraction(this.LineString),this.LineString.setActive(!1),p.addInteraction(this.Polygon),this.Polygon.setActive(!1),p.addInteraction(this.Circle),this.Circle.setActive(!1)},Point:new h.ZP({source:A.getSource(),type:"Point"}),LineString:new h.ZP({source:A.getSource(),type:"LineString"}),Polygon:new h.ZP({source:A.getSource(),type:"Polygon"}),Circle:new h.ZP({source:A.getSource(),type:"Circle"}),getActive:function(){return!!this.activeType&&this[this.activeType].getActive()},setActive:function(e){var t=P.elements["draw-type"].value;e?(this.activeType&&this[this.activeType].setActive(!1),this[t].setActive(!0),this.activeType=t):(this.activeType&&this[this.activeType].setActive(!1),this.activeType=null)}};m.init(),P.onchange=function(e){var t=e.target.getAttribute("name"),i=e.target.value;"draw-type"==t?m.getActive()&&m.setActive(!0):"interaction"==t&&("modify"==i?(m.setActive(!1),Z.setActive(!0)):"draw"==i&&(m.setActive(!0),Z.setActive(!1)))},m.setActive(!0),Z.setActive(!1);var S=new l.Z({source:A.getSource()});p.addInteraction(S)}},function(e){var t=function(t){return e(e.s=t)};t(9877),t(69528)}]);
|
|
//# sourceMappingURL=snap.js.map
|