Files
hb_pqs_web/public/static/map/modules/pointcollection_lx5y2g.js

2 lines
6.8 KiB
JavaScript
Raw Permalink Normal View History

2025-01-09 19:02:44 +08:00
/**/_jsload2&&_jsload2('pointcollection', 'x.extend(vd.prototype,{ra:function(a){var b=this;b.map=this.D=a;b.xc=document.createElement("canvas");b.xc.style.cssText="position: absolute; left: 0; top: 0;";b.V=b.xc;a=b.map.vb();b.xc.width=a.width;b.xc.height=a.height;b.xc.id="myCanvasElement";b.map.Rf().Jt.appendChild(b.xc);b.Wy=new Lg;b.ni();b.map.addEventListener("click",function(a){a=Mg(b.Wy,a.offsetX,a.offsetY);a!==p&&b.dispatchEvent("click",{point:a.point})});b.Vk=p;b.map.addEventListener("mousemove",function(a){for(var d=b.map.Mx(),e=d.length, f=p,g=0;g<e&&!(d[g]instanceof B.PointCollection&&(f=Mg(d[g].Wy,a.offsetX,a.offsetY),f!==p));g++);f===p?(b.Vk!==p&&(b.dispatchEvent("mouseout",{point:b.Vk.point}),b.Vk=p),b.xc.style.cursor=""):(b.Vk===p?(b.dispatchEvent("mouseover",{point:f.point}),b.Vk=f):b.Vk!==f&&(b.dispatchEvent("mouseout",{point:b.Vk.point}),b.dispatchEvent("mouseover",{point:f.point}),b.Vk=f),b.xc.style.cursor="pointer")});return b.xc},ni:function(){this.Wy.data.SF=[];var a=this.map.vb();this.xc.width=a.width;this.xc.height= a.height;this.xc.style.left=this.map.Ae.style.left;this.xc.style.top=this.map.Ae.style.top;if(this.ea.ha&&this.ea.ha.length){this.xc.getContext("2d").clearRect(0,0,this.xc.width,this.xc.height);-1!==document.location.href.indexOf(".local")&&(console&&console.time)&&console.time("\\u904d\\u5386\\u7ed8\\u5236\\u9ebb\\u70b9");this.xc.getContext("2d").beginPath();for(var b=0,c;c=this.ea.ha[b];b++){var d=this.map.Cc(c);if(!(0>d.x||0>d.y||d.x>a.width||d.y>a.height)){var e;switch(this.z.shape){case 1:e=new Ng; break;case 2:e=new Og;break;case 4:e=new Pg;break;case 5:e=new Qg;break;case sd:e=new Rg;break;default:e=new Rg}switch(this.z.size){case 1:("circle"===e.type||"star"===e.type)&&e.wf(1);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(2),e.Ch(2);break;case 2:("circle"===e.type||"star"===e.type)&&e.wf(2);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(4),e.Ch(4);break;case 3:("circle"===e.type||"star"===e.type)&&e.wf(4);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(8),e.Ch(8);break;case td:("circle"=== e.type||"star"===e.type)&&e.wf(5);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(10),e.Ch(10);break;case 5:("circle"===e.type||"star"===e.type)&&e.wf(8);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(16),e.Ch(16);break;case 6:("circle"===e.type||"star"===e.type)&&e.wf(10);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(20),e.Ch(20);break;case 7:("circle"===e.type||"star"===e.type)&&e.wf(15);if("rectangle"===e.type||"rhombus"===e.type)e.Eh(30),e.Ch(30);break;default:if(("circle"===e.type||"star"=== e.type)&&e.wf(5),"rectangle"===e.type||"rhombus"===e.type)e.Eh(10),e.Ch(10)}this.z.color&&("circle"===e.type||"star"===e.type||"rectangle"===e.type||"rhombus"===e.type)&&e.Sk(this.z.color);e.Wo(this.xc.getContext("2d"),d.x,d.y);e.point=c;this.Wy.data.SF.push(e)}}this.xc.getContext("2d").fillStyle=this.z.color;this.xc.getContext("2d").fill();-1!==document.location.href.indexOf(".local")&&(console&&console.timeEnd)&&console.timeEnd("\\u904d\\u5386\\u7ed8\\u5236\\u9ebb\\u70b9")}},B_:function(a){this.ea.ha= a;this.ni()},Di:function(a){a.color&&(this.z.color=a.color);a.size&&(this.z.size=a.size);a.shape&&(this.z.shape=a.shape);this.ni()},clear:function(){this.ea.ha=[];this.ni()},remove:function(){this.clear();this.xc&&this.xc.parentNode&&this.xc.parentNode.removeChild(this.xc);this.dispatchEvent(new N("onremove"))}});vd.prototype.initialize=vd.prototype.ra;vd.prototype.draw=vd.prototype.ni;vd.prototype.setPoints=vd.prototype.B_;vd.prototype.setStyles=vd.prototype.Di;vd.prototype.clear=vd.prototype.clear; vd.prototype.remove=vd.prototype.remove;function Lg(){this.data={SF:[]}}function Mg(a,b,c){for(var d=0,e;e=a.data.SF[d];d++)if(e.Ck(),b>e.position.x-e.qp()/2&&b<e.position.x+e.qp()/2&&c>e.position.y-e.Ck()/2&&c<e.position.y+e.Ck()/2)return e;return p}function Og(){this.type="waterdrop";this.position={x:0,y:0}}var Sg=document.createElement("img"),Tg=q;Sg.onload=function(){Tg=o};Sg.src=B.la+"images/point-collection/red-marker-10x13.png";var Ug=document.createElement("img");Ug.onload=t(); Ug.src=