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.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
2 weeks ago
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4970],{89046:function(e,n,t){for(var a=t(12739),r=t(41376),i=t(75469),s=t(54354),u=t(69039),o=t(77138),c=t(720),f=t(77975),d=t(40729),l=t(95783),w=t(58685),g=t(79847),v=t(41372),Z=t(42010),m=t(86923),p=document.getElementById("distance"),h=document.getElementById("min-distance"),I=new Array(2e4),k=45e5,y=0;y<2e4;++y){var E=[2*k*Math.random()-k,2*k*Math.random()-k];I[y]=new a.Z(new i.Z(E))}var C=new l.Z({features:I}),L=new w.Z({distance:parseInt(p.value,10),minDistance:parseInt(h.value,10),source:C}),x={},D=new v.Z({source:L,style:function(e){var n=e.get("features").length,t=x[n];return t||(t=new u.ZP({image:new o.Z({radius:10,stroke:new c.Z({color:"#fff"}),fill:new f.Z({color:"#3399CC"})}),text:new d.Z({text:n.toString(),fill:new f.Z({color:"#fff"})})}),x[n]=t),t}}),M=new Z.Z({source:new g.Z}),b=new r.Z({layers:[M,D],target:"map",view:new s.ZP({center:[0,0],zoom:2})}),B=function(){L.setDistance(parseInt(p.value,10))};p.addEventListener("input",B),p.addEventListener("change",B);var P=function(){L.setMinDistance(parseInt(h.value,10))};h.addEventListener("input",P),h.addEventListener("change",P),b.on("click",(function(e){D.getFeatures(e.pixel).then((function(e){if(e.length){var n=e[0].get("features");if(n.length>1){var t=(0,m.hI)(n.map((function(e){return e.getGeometry().getCoordinates()})));b.getView().fit(t,{duration:1e3,padding:[50,50,50,50]})}}}))}))}},function(e){var n=function(n){return e(e.s=n)};n(9877),n(89046)}]);
|
||
|
//# sourceMappingURL=cluster.js.map
|