You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
6.8 KiB
1 line
6.8 KiB
1 year ago
|
/**/_jsload2 && _jsload2('pointcollection', 'x.extend(zd.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().Vt.appendChild(b.xc);b.iz=new Rg;b.ni();b.map.addEventListener("click",function(a){a=Sg(b.iz,a.offsetX,a.offsetY);a!==p&&b.dispatchEvent("click",{point:a.point})});b.Xk=p;b.map.addEventListener("mousemove",function(a){for(var d=b.map.Yx(),e=d.length, f=p,g=0;g<e&&!(d[g]instanceof B.PointCollection&&(f=Sg(d[g].iz,a.offsetX,a.offsetY),f!==p));g++);f===p?(b.Xk!==p&&(b.dispatchEvent("mouseout",{point:b.Xk.point}),b.Xk=p),b.xc.style.cursor=""):(b.Xk===p?(b.dispatchEvent("mouseover",{point:f.point}),b.Xk=f):b.Xk!==f&&(b.dispatchEvent("mouseout",{point:b.Xk.point}),b.dispatchEvent("mouseover",{point:f.point}),b.Xk=f),b.xc.style.cursor="pointer")});return b.xc},ni:function(){this.iz.data.gG=[];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 Tg; break;case 2:e=new Ug;break;case 4:e=new Vg;break;case 5:e=new Wg;break;case wd:e=new Xg;break;default:e=new Xg}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 xd:("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.Uk(this.z.color);e.hp(this.xc.getContext("2d"),d.x,d.y);e.point=c;this.iz.data.gG.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")}},W_: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"))}});zd.prototype.initialize=zd.prototype.ra;zd.prototype.draw=zd.prototype.ni;zd.prototype.setPoints=zd.prototype.W_;zd.prototype.setStyles=zd.prototype.Di;zd.prototype.clear=zd.prototype.clear; zd.prototype.remove=zd.prototype.remove;function Rg(){this.data={gG:[]}}function Sg(a,b,c){for(var d=0,e;e=a.data.gG[d];d++)if(e.Ek(),b>e.position.x-e.Dp()/2&&b<e.position.x+e.Dp()/2&&c>e.position.y-e.Ek()/2&&c<e.position.y+e.Ek()/2)return e;return p}function Ug(){this.type="waterdrop";this.position={x:0,y:0}}var Yg=document.createElement("img"),Zg=q;Yg.onload=function(){Zg=o};Yg.src=B.la+"images/point-collection/red-marker-10x13.png";var $g=document.createElement("img");$g.onload=t(); $g.sr
|