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('vmlcontext', 'var Rf=10,Sf=Rf/2; function Tf(a){this.pi=[[1,0,0],[0,1,0],[0,0,1]];this.BM=[];this.CJ=[];this.pk=[];this.lineWidth=1;this.miterLimit=1*Rf;this.canvas=a;var b=K("div");b.style.width=a.clientWidth+"px";b.style.height=a.clientHeight+"px";b.style.position="absolute";a.appendChild(b);this.PK=b;this.rM=this.uw=this.tw=1;document.styleSheets.canvas_style||(a=document.createStyleSheet(),a.owningElement.id="canvas_style",a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\\\:shape,g_vml_\\\\:fill,g_vml_\\\\:stroke{behavior:url(#default#VML)}")} function Uf(a,b){for(var c=[[1,0,0],[0,1,0],[0,0,1]],d=0;3>d;d++)for(var e=0;3>e;e++){for(var f=0,g=0;3>g;g++)f+=a[d][g]*b[g][e];c[d][e]=f}return c}var Vf=Tf.prototype;Vf.clearRect=function(){this.PK.innerHTML=""};Vf.beginPath=function(){this.pk=[]};Vf.moveTo=function(a,b){var c=this.ji(a,b);this.pk.push({type:"moveTo",x:c.x,y:c.y});this.hs=c.x;this.is=c.y};Vf.lineTo=function(a,b){var c=this.ji(a,b);this.pk.push({type:"lineTo",x:c.x,y:c.y});this.hs=c.x;this.is=c.y}; Vf.bezierCurveTo=function(a,b,c,d,e,f){Wf(this,this.ji(a,b),this.ji(c,d),this.ji(e,f))};function Wf(a,b,c,d){a.pk.push({type:"bezierCurveTo",KV:b.x,LV:b.y,MV:c.x,NV:c.y,x:d.x,y:d.y});a.hs=d.x;a.is=d.y}Vf.quadraticCurveTo=function(a,b,c,d){a=this.ji(a,b);c=this.ji(c,d);d={x:this.hs+2/3*(a.x-this.hs),y:this.is+2/3*(a.y-this.is)};Wf(this,d,{x:d.x+(c.x-this.hs)/3,y:d.y+(c.y-this.is)/3},c)}; Vf.arc=function(a,b,c,d,e,f){var c=c*Rf,g=a+Math.cos(d)*c-Sf,i=b+Math.sin(d)*c-Sf,d=a+Math.cos(e)*c-Sf,e=b+Math.sin(e)*c-Sf;g==d&&!f&&(g+=0.125);a=this.ji(a,b);g=this.ji(g,i);d=this.ji(d,e);this.pk.push({type:f?"at":"wa",x:a.x,y:a.y,wa:c,h0:g.x,j0:g.y,g0:d.x,i0:d.y})};Vf.rect=function(a,b,c,d){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+d);this.lineTo(a,b+d);this.closePath()}; Vf.stroke=function(a){var b=[],c=a?this.fillStyle:this.strokeStyle,d=c.color,c=c.alpha;b.push("<g_vml_:shape",\' filled="\',!!a,\'"\',\' style="position:absolute;width:\',10,"px;height:",10,\'px;"\',\' coordorigin="0 0" coordsize="\',10*Rf," ",10*Rf,\'"\',\' stroked="\',!a,\'"\',\' path="\');for(var e=p,f=p,g=p,i=p,k=0;k<this.pk.length;k++){var l=this.pk[k];switch(l.type){case "moveTo":b.push(" m ",Math.round(l.x),",",Math.round(l.y));break;case "lineTo":b.push(" l ",Math.round(l.x),",",Math.round(l.y));break;case "close":b.push(" x "); l=p;break;case "bezierCurveTo":b.push(" c ",Math.round(l.KV),",",Math.round(l.LV),",",Math.round(l.MV),",",Math.round(l.NV),",",Math.round(l.x),",",Math.round(l.y));break;case "at":case "wa":b.push(" ",l.type," ",Math.round(l.x-this.tw*l.wa),",",Math.round(l.y-this.uw*l.wa)," ",Math.round(l.x+this.tw*l.wa),",",Math.round(l.y+this.uw*l.wa)," ",Math.round(l.h0),",",Math.round(l.j0)," ",Math.round(l.g0),",",Math.round(l.i0))}if(l){if(e==p||l.x<e)e=l.x;if(g==p||l.x>g)g=l.x;if(f==p||l.y<f)f=l.y;if(i== p||l.y>i)i=l.y}}b.push(\' ">\');a?b.push(\'<g_vml_:fill color="\',d,\'" opacity="\',c,\'" />\'):(a=this.rM*this.lineWidth,1>a&&(c*=a),b.push("<g_vml_:stroke",\' opacity="\',c,\'"\',\' joinstyle="\',this.lineJoin,\'"\',\' miterlimit="\',this.miterLimit,\'"\',\' endcap="\',"square",\'"\',\' weight="\',a,\'px"\',\' color="\',d,\'" />\'));b.push("</g_vml_:shape>");this.PK.insertAdjacentHTML("beforeEnd",b.join(""))};Vf.fill=function(){this.stroke(o)};Vf.closePath=function(){this.pk.push({type:"close"})}; Vf.ji=function(a,b){var c=this.pi;return{x:Rf*(a*c[0][0]+b*c[1][0]+c[2][0])-Sf,y:Rf*(a*c[0][1]+b*c[1][1]+c[2][1])-Sf}};Vf.save=function(){var a={};copyState(this,a);this.CJ.push(a);this.BM.push(this.pi);this.pi=Uf(createMatrixIdentity(),this.pi)};Vf.restore=function(){copyState(this.CJ.pop(),this);this.pi=this.BM.pop()}; function Xf(a,b,c){var d;a:{for(d=0;3>d;d++)for(var e=0;2>e;e++)if(!isFinite(b[d][e])||isNaN(b[d][e])){d=q;break a}d=o}d&&(a.pi=b,c&&(a.rM=Math.sqrt(Math.abs(b[0][0]*b[1][1]-b[0][1]*b[1][0]))))}Vf.translate=function(a,b){Xf(this,Uf([[1,0,0],[0,1,0],[a,b,1]],this.pi),q)};Vf.rotate=function(a){var b=Math.cos(a),a=Math.sin(a);Xf(this,Uf([[b,a,0],[-a,b,0],[0,0,1]],this.pi),q)};Vf.scale=function(a,b){this.tw*=a;this.uw*=b;Xf(this,Uf([[a,0,0],[0,b,0],[0,0,1]],this.pi),o)}; Vf.transform=function(a,b,c,d,e,f){Xf(this,Uf([[a,b,0],[c,d,0],[e,f,1]],this.pi),o)};Vf.setTransform=function(a,b,c,d,e,f){Xf(this,[[a,b,0],[c,d,0],[e,f,1]],o)};z.CP=Tf; ');
|