12345678 |
- /* 百度地图API V2 模块
- * 此模块必须配套使用baidumap_offline_v2_20160822.js对
- * 获取模块的方法:
- * http://api0.map.bdimg.com/getmodules?v=2.0&mod=模块1,模块2
- * 模块名称就是文件名
- * www.xiaoguo123.com 整理
- */
- _jsload2&&_jsload2('opmb', 'var Gg=q,Hg=p; z.Se(function(a){function b(){e&&(e=q,f=p,g||a.dispatchEvent(k))}function c(c){e=o;k=la(new N("ontouch"),c);f=new Q(c.changedTouches[0].clientX,c.changedTouches[0].clientY);var g=d("onclickex",c);setTimeout(function(){b();a.dispatchEvent(g)},a.K.lW);Gg||a.dispatchEvent(d("onclick",c))}function d(b,c){for(var d=new N(b),e=c.target,f=p,g=p;e&&e!==a.Ua;){if(e.ba){var i=x.lang.Mc(e.ba);i instanceof gb&&"canvas"!==e.nodeName.toLowerCase()&&(f=i);i instanceof qc&&(g=i)}e=e.offsetParent}for(var e=c.changedTouches[0].pageX, i=c.changedTouches[0].pageY,k=a.Ua;k&&k!=document.body;)e-=k.offsetLeft,i-=k.offsetTop,k=k.offsetParent;d.offsetX=e;d.offsetY=i;d.pixel=d.ib=new Q(d.offsetX,d.offsetY);d.point=d.point=a.ub(d.ib);d.overlay=d.$a=f;d.infoWindow=g;return d}a.K.lW=500;var e=q,f,g=q,i=q,k;x.M(a.Na(),"touchmove",function(b){a.K.Xb&&b.preventDefault()});x.M(a.platform,"touchstart",function(b){Gg=q;Hg=setTimeout(function(){Gg=o;a.dispatchEvent(la(d("onlongpress",b),b))},1E3);a.K.Xb&&na(b);i=q;a.dispatchEvent(la(d("ontouchstart", b),b));a.K.Xb&&Bb(b)});x.M(a.platform,"touchmove",function(b){a.K.Xb&&na(b);i=o;a.dispatchEvent(la(d("ontouchmove",b),b))});x.M(a.platform,"touchend",function(k){clearTimeout(Hg);a.K.Xb&&Bb(k);i||(e?(g=o,Gg||a.dispatchEvent(d("onclick",k)),20>Eb(f,new Q(k.changedTouches[0].clientX,k.changedTouches[0].clientY))?(a.dispatchEvent(d("ondblclick",k)),a.dispatchEvent(la(new N("ondbltouch"),k))):a.dispatchEvent(la(d("ontouchend",k),k)),b(),g=q):c(k));a.dispatchEvent(la(d("ontouchend",k),k))});x.M(a.platform, "gesturestart",function(b){b.preventDefault();a.dispatchEvent(la(new N("ongesturestart"),b))});x.M(a.platform,"gesturechange",function(b){b.preventDefault();a.dispatchEvent(la(new N("ongesturechange"),b))});x.M(a.platform,"gestureend",function(b){b.preventDefault();a.dispatchEvent(la(new N("ongestureend"),b))})}); z.Se(function(a){function b(a){a&&(B.WebkitTransform="");i=g=0;k=1;l[0].x=l[0].y=l[1].x=l[1].y=0;w=q}function c(){if(x.platform.Gm)if(/Nexus/.test(navigator.userAgent))a.K.Xb&&(B.left=a.offsetX+g+"px",B.top=a.offsetY+i+"px");else{if(a.K.Xb&&(B.left=a.offsetX+g*k+"px",B.top=a.offsetY+i*k+"px"),1!=k)B.WebkitTransform=a.K.Es?"scale("+k+") ":""}else B.WebkitTransform=(a.K.Xb?"translate("+g*k+"px, "+i*k+"px) ":"")+(a.K.Es?"scale("+k+") ":"")}function d(){for(var b=a.Ua,c=0,d=0;b!=document.body;)c+=b.offsetLeft, d+=b.offsetTop,b=b.offsetParent;Ig&&(d=c=0);B.WebkitTransformOrigin=a.K.Xb?(l[0].x+l[1].x)/2-a.offsetX-c+"px "+((l[0].y+l[1].y)/2-a.offsetY-d)+"px":Math.round(a.width/2)+"px "+Math.round(a.height/2)+"px"}function e(b,c){var d=new N(b);d.offsetX=c.changedTouches[0].clientX;d.offsetY=c.changedTouches[0].clientY;d.ib=new Q(d.offsetX,d.offsetY);d.point=a.ub(d.ib);return d}function f(a){for(var b=[],c,d=0,e=a.touches.length;d<e;d++)c=a.touches[d],b.push({x:c.pageX,y:c.pageY});return b}var g=0,i=0,k=1, l=[{x:0,y:0},{x:0,y:0}],m=0,n=0,u=q,v=q,w=q,y=p,C,A,B=a.platform.style;a.addEventListener("touchstart",function(b){if(!(b.$a instanceof T)){C=f(b);var c=b.targetTouches.length;m+=c;2<m&&(m=2);var d=a.R;2==c&&(d.bI=o);d.lb&&d.lb.stop();1==m?(this.R.qU=g,this.R.rU=i,l[0].x=b.targetTouches[0].clientX,l[0].y=b.targetTouches[0].clientY):2==m&&(l[1].x=b.targetTouches[c-1].clientX,l[1].y=b.targetTouches[c-1].clientY)}});a.addEventListener("touchmove",function(b){if(4<=x.OJ&&2<=b.changedTouches.length){A= f(b);var E=2==C.length&&2==A.length?Eb(A[0],A[1])/Eb(C[0],C[1]):1;0<Math.abs(1-E)&&(k=E,v=o,clearTimeout(Hg),d())}if(v&&!(2>b.changedTouches.length)){for(E=b.target;E&&E!=a.Ua;)E.Ax&&x.lang.Mc(E.Ax),E=E.offsetParent;for(var E=[],B=0;2>B;B++){for(var O=b.changedTouches[B].pageX,M=b.changedTouches[B].pageY,Y=a.Ua;Y&&Y!=document.body;)O-=Y.offsetLeft,M-=Y.offsetTop,Y=Y.offsetParent;E[B]={x:O,y:M}}y=new Q((E[0].x+E[1].x)/2,(E[0].y+E[1].y)/2)}E=b.targetTouches.length;1==m&&2!=n&&(g+=b.targetTouches[0].clientX- l[0].x,i+=b.targetTouches[0].clientY-l[0].y,l[0].x=b.targetTouches[0].clientX,l[0].y=b.targetTouches[0].clientY,c(),w=o);if(2==m){var O=l[0].x,M=l[0].y,Y=l[1].x,oa=l[1].y;if(w){for(var ka=0;ka<E;ka++)B=new Q(b.targetTouches[ka].clientX,b.targetTouches[ka].clientY),Eb(B,new Q(l[0].x,l[0].y))<Eb(B,new Q(l[1].x,l[1].y))?(l[0].x=B.x,l[0].y=B.y):(l[1].x=B.x,l[1].y=B.y);g+=(l[0].x-O+l[1].x-Y)/2;i+=(l[0].y-M+l[1].y-oa)/2;c()}else if(O=new Q(b.targetTouches[0].clientX,b.targetTouches[0].clientY),B=new Q(l[0].x, l[0].y),1==E&&(30>Eb(B,O)?(l[0].x=b.targetTouches[0].clientX,l[0].y=b.targetTouches[0].clientY):(w=o,l[1].x=b.targetTouches[0].clientX,l[1].y=b.targetTouches[0].clientY)),2==E)M=new Q(b.targetTouches[1].clientX,b.targetTouches[1].clientY),30>Eb(O,M)?(l[0].x=b.targetTouches[1].clientX,l[0].y=b.targetTouches[1].clientY):(Eb(B,O)<Eb(B,M)?(l[0].x=b.targetTouches[0].clientX,l[0].y=b.targetTouches[0].clientY,l[1].x=b.targetTouches[1].clientX,l[1].y=b.targetTouches[1].clientY):(l[1].x=b.targetTouches[0].clientX, l[1].y=b.targetTouches[0].clientY,l[0].x=b.targetTouches[1].clientX,l[0].y=b.targetTouches[1].clientY),w=o)}if(1==m&&2==n){for(ka=0;ka<E;ka++)B=new Q(b.targetTouches[ka].clientX,b.targetTouches[ka].clientY),Eb(B,new Q(l[0].x,l[0].y))<Eb(B,new Q(l[1].x,l[1].y))?(g+=B.x-l[0].x,i+=B.y-l[0].y,l[0].x=B.x,l[0].y=B.y):(g+=B.x-l[1].x,i+=B.y-l[1].y,l[1].x=B.x,l[1].y=B.y);c()}1==m&&this.K.Xb&&(E=this.R,E.Zj||(E.Zj=o,b=e("ondragstart",b),a.dispatchEvent(b),a.dispatchEvent(new N("onmovestart")),E.SC=b.ib,E.TC= ab(),u=o),E.mt=ab(),a.dispatchEvent(new N("ondragging")))});a.addEventListener("touchend",function(c){d();n=m;this.R.bI?(m=c.targetTouches.length,delete this.R.bI):m--; -1==m&&(m=0);x.platform.Gm&&(m=0);if(0==m){if(v){var f=0,l=a.fa();a.Cc=a.Ka;this.K.Es&&(f=Math.round(Math.log(k)/Math.log(2)),l=Math.max(Math.min(a.fa()+f,a.K.Zb),a.K.fc));var w=a.oa().Bc(l),A=y,B;B=a.lc;var C=a.oa().Bc(a.Cc);B=new H(B.lng+C*(A.x-a.width/2),B.lat-C*(A.y-a.height/2));w=new H(B.lng+(a.width/2-A.x)*w,B.lat-(a.height/ 2-A.y)*w);w=R.Eb(w);w=a.ac(w);f=new Q(w.x-g*k/Math.pow(2,f),w.y-i*k/Math.pow(2,f));w=a.K.Xb?a.ub(f):a.Ja();if(f=a.jh())if(f=f.ha())f=a.ac(f,a.Cc),a.ik(a.width/2-f.x,a.height/2-f.y,a.ub(f,a.Cc),o);a.Cd(w,l)}if(g!=this.R.qU||i!=this.R.rU)u&&!v&&(c=e("ondragend",c),Jg(a,c,c.ib,{x:g,y:i}),u=q),v?b(o):b(q);v=a.R.Zj=q;n=0}});a.addEventListener("gesturechange",function(a){k=a.scale;v=o;clearTimeout(Hg);d()})}); function Jg(a,b,c,d){var e=a.platform.style;if(a.K.Yw){var f=a.R,g=ab();if(140<g-f.mt)setTimeout(function(){e.WebkitTransform=""},0),setTimeout(function(){a.He(a.offsetX+d.x,a.offsetY+d.y)},0),window.setTimeout(function(){a.dispatchEvent(new N("onmoveend"));f.Zj=q},0),window.setTimeout(function(){a.dispatchEvent(b)},0);else{var i=f.SC,k=[0<c.x-i.x?1:-1,0<c.y-i.y?1:-1],g=Eb(i,c)/((g-f.TC)/1E3)/2,l=g/1.6,m=0.5*l*g/1E3,n=Math.abs(i.x-c.x),u=0,v=0;0==Math.abs(i.y-c.y)?u=n:(c=Math.abs(i.x-c.x)/Math.abs(i.y- c.y),v=Math.round(Math.sqrt(m*m/(1+c*c))),u=Math.round(c*v));-1==k[0]&&(u=-u);-1==k[1]&&(v=-v);f.lb&&f.lb.stop();var w=g/1E3,y=a.offsetX,C=a.offsetY;f.lb=new sb({duration:l,Ic:25,hc:function(a){a=a*w/1.6;return w*a-0.8*a*a},ua:function(b){b=b*3.2/(w*w);if(x.platform.Gm){e.left=a.offsetX+d.x+Math.round(b*u)+"px";e.top=a.offsetY+d.y+Math.round(b*v)+"px"}else e.WebkitTransform="translate("+(d.x+Math.round(b*u))+"px ,"+(d.y+Math.round(b*v))+"px)"},finish:function(){f.lb=p;setTimeout(function(){e.WebkitTransform= ""},0);setTimeout(function(){a.He(y+d.x+Math.round(u),C+d.y+Math.round(v))},0);setTimeout(function(){a.dispatchEvent(new N("onmoveend"))},0);window.setTimeout(function(){a.dispatchEvent(b)},0)},yt:function(b){f.lb=p;b=b*3.2/(w*w);setTimeout(function(){e.WebkitTransform=""},0);setTimeout(function(){a.He(y+d.x+Math.round(b*u),C+d.y+Math.round(b*v))},0);setTimeout(function(){a.dispatchEvent(new N("onmoveend"))},0)}})}}else window.setTimeout(function(){e.WebkitTransform=""},0),window.setTimeout(function(){a.He(a.offsetX+ d.x,a.offsetY+d.y)},0),window.setTimeout(function(){a.dispatchEvent(new N("onmoveend"))},0)}var Ig=-1<navigator.userAgent.indexOf("iPhone OS 5_")?o:q; ');
|