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
1.3 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[165],{393:function(e,n,t){"use strict";t.r(n);var o,r=t(30),a=t(3),i=t(19),c=t(10),w=t(2),l=t(11),s=t(21),f=t(15),u=t(67),g=new l.c({fill:new s.a({color:"rgba(255, 255, 255, 0.6)"}),stroke:new f.a({color:"#319FD3",width:1}),text:new u.a({font:"12px Calibri,sans-serif",fill:new s.a({color:"#000"}),stroke:new f.a({color:"#fff",width:3})})}),d=new i.a({source:new c.a({url:"data/geojson/countries.geojson",format:new r.a}),style:function(e){return g.getText().setText(e.get("name")),g}}),p=new a.a({layers:[d],target:"map",view:new w.a({center:[0,0],zoom:1})}),m=new l.c({stroke:new f.a({color:"#f00",width:1}),fill:new s.a({color:"rgba(255,0,0,0.1)"}),text:new u.a({font:"12px Calibri,sans-serif",fill:new s.a({color:"#000"}),stroke:new f.a({color:"#f00",width:3})})}),x=new i.a({source:new c.a,map:p,style:function(e){return m.getText().setText(e.get("name")),m}}),v=function(e){var n=p.forEachFeatureAtPixel(e,(function(e){return e})),t=document.getElementById("info");t.innerHTML=n?n.getId()+": "+n.get("name"):" ",n!==o&&(o&&x.getSource().removeFeature(o),n&&x.getSource().addFeature(n),o=n)};p.on("pointermove",(function(e){if(!e.dragging){var n=p.getEventPixel(e.originalEvent);v(n)}})),p.on("click",(function(e){v(e.pixel)}))}},[[393,0]]]);
//# sourceMappingURL=vector-layer.js.map