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.0 KiB
JavaScript
2 lines
1.0 KiB
JavaScript
2 weeks ago
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{293:function(e,t,n){"use strict";n.r(t);var a,o=n(16),r=n(36),c=n(3),i=n(2),l=n(9),w=n(10),s=n(11),u=n(15),g=n(5),h=n(19),d=new g.a({source:new l.b}),f=new s.c({stroke:new u.a({color:"black",width:1})}),k=new o.a(new r.a([[-4e6,0],[4e6,0]])),m=new h.a({source:new w.a({features:[k]}),style:f}),p=new c.a({layers:[d,m],target:"map",view:new i.a({center:[0,0],zoom:2})}),v=document.getElementById("status");p.on("singleclick",(function(e){var t=!1;p.forEachFeatureAtPixel(e.pixel,(function(){t=!0}),{hitTolerance:a}),t?(f.getStroke().setColor("green"),v.innerHTML="A feature got hit!"):(f.getStroke().setColor("black"),v.innerHTML="No feature got hit."),k.changed()}));var b=document.getElementById("hitTolerance"),y=document.getElementById("circle"),I=function(){var e=2*(a=parseInt(b.value,10))+2;y.width=e,y.height=e;var t=y.getContext("2d");t.clearRect(0,0,e,e),t.beginPath(),t.arc(a+1,a+1,a+.5,0,2*Math.PI),t.fill(),t.stroke()};b.onchange=I,I()}},[[293,0]]]);
|
||
|
//# sourceMappingURL=hit-tolerance.js.map
|