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.1 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[140],{369:function(e,t,i){"use strict";i.r(t);var n=i(3),c=i(2),s=i(11),o=i(21),a=i(15),r=i(48),v=i(98),h=i(145),u=i(66),l=i(150),w=i(9),d=i(10),g=i(5),y=i(19),f=new g.a({source:new w.b}),A=new y.a({source:new d.a,style:new s.c({fill:new o.a({color:"rgba(255, 255, 255, 0.2)"}),stroke:new a.a({color:"#ffcc33",width:2}),image:new r.a({radius:7,fill:new o.a({color:"#ffcc33"})})})}),p=new n.a({layers:[f,A],target:"map",view:new c.a({center:[-11e6,46e5],zoom:4})}),m={init:function(){this.select=new v.a,p.addInteraction(this.select),this.modify=new h.a({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)}};m.init();var S=document.getElementById("options-form"),I={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 u.c({source:A.getSource(),type:"Point"}),LineString:new u.c({source:A.getSource(),type:"LineString"}),Polygon:new u.c({source:A.getSource(),type:"Polygon"}),Circle:new u.c({source:A.getSource(),type:"Circle"}),getActive:function(){return!!this.activeType&&this[this.activeType].getActive()},setActive:function(e){var t=S.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)}};I.init(),S.onchange=function(e){var t=e.target.getAttribute("name"),i=e.target.value;"draw-type"==t?I.getActive()&&I.setActive(!0):"interaction"==t&&("modify"==i?(I.setActive(!1),m.setActive(!0)):"draw"==i&&(I.setActive(!0),m.setActive(!1)))},I.setActive(!0),m.setActive(!1);var P=new l.a({source:A.getSource()});p.addInteraction(P)}},[[369,0]]]);
//# sourceMappingURL=snap.js.map