fba25254b20d3240daedba60cf8ab055be0fdae8.svn-base
8.52 KB
google.maps.__gjsload__('drawing_impl', 'function ZL(a,b){O(b,P(a,a[mb]))}var $L="rectanglecomplete",aM="polylinecomplete",bM="polygoncomplete",cM="overlaycomplete",dM="markercomplete",eM="circlecomplete";\nfunction fM(a,b){function c(b,c,h,m){var p=$("div",a);nG(p,"left");eG(p[F],0);c={title:c,fe:h,Vg:m,padding:[4],ge:i};h=$("span");jj(h[F],"inline-block");var r=b||"hand",v=gM[r],z=Lq(d,h,new T(0,v),hM);Yi(z[F],"relative");var C=new mH(p,h,b,c);R[G](C,"active_changed",function(){var a=C.get("active")?iM[r]:v;Kq(z,hM,new T(0,a))});C[t]("value",e,"drawingMode")}var d=El("drawing"),e=this;c(j,"\\u505c\\u6b62\\u7ed8\\u56fe",i,!b[B]);O(b,function(a,d){var e=jM[a];e&&c(a,e,k,d==b[B]-1)})}L(fM,W);\nvar jM={marker:"\\u6dfb\\u52a0\\u6807\\u8bb0",polygon:"\\u7ed8\\u5236\\u5f62\\u72b6",polyline:"\\u7ed8\\u5236\\u7ebf\\u6761",rectangle:"\\u7ed8\\u5236\\u77e9\\u5f62",circle:"\\u7ed8\\u5236\\u5706\\u5f62"},hM=new U(16,16),iM={hand:144,marker:112,polygon:96,polyline:128,rectangle:48,circle:0},gM={hand:80,marker:176,polygon:64,polyline:32,rectangle:16,circle:160};function kM(a,b,c){this.j=a;this.n=b;this.B=c;R[A](this,Le,this,this.Fj);R[A](this,sl,this,this.Od);R[A](this,gl,this,this.Dj);R[A](this,fl,this,this.Ej);R[A](this,el,this,this.Cj)}L(kM,W);I=kM[D];Yo(I,function(){if(this.get("active"))this.set("draggableCursor",this.n),this.set("draggingCursor","");else{var a=this.e;a&&(a[mb]("map"),a.set("map",j),this.e=j);this.b=k}});I.Fj=function(a){this.e?lM(this,a):(this.b=i,mM(this,a))};\nfunction mM(a,b){a.A=b;var c={};xd(c,a.get("options"));c[Mp]==j&&Vi(c,a.B());delete c.map;a.e=a.j.b(b,c);a.e[t]("map",a)}I.Dj=function(a,b){this.b||(this.set("draggingCursor",this.n),this.set("drawWithDrag",i),mM(this,a),Jq(b))};function lM(a,b){a.Od(b);var c=a.e;c[mb]("map");a.e=j;R[s](a,cM,{type:a.j.e(),overlay:c});R[s](a,a.j.f(),c);a.A=j;a.b=k}I.Cj=function(a,b){this.b||(this.set("draggingCursor",""),this.set("drawWithDrag",k),lM(this,a),Jq(b))};\nI.Od=function(a){this.e&&this.j.j(this.e,this.A,a)};I.Ej=function(a,b){this.b||(this.Od(a),Jq(b))};function nM(){}nM[D].b=function(a,b){b.center=a;b.radius=0;return new Eh(b)};nM[D].j=function(a,b,c){var d=a.get("map");d&&(d=d.N().get("mapType"),a.set("radius",uq(b,c,d&&d[ub])))};nM[D].e=function(){return"circle"};nM[D].f=function(){return eM};function oM(a){this.b=a;R[A](this,Le,this,this.e)}L(oM,W);Yo(oM[D],function(){this.get("active")&&this.set("draggableCursor",this.b)});oM[D].e=function(a){var b={};xd(b,this.get("options"));b.map=this.get("map");Yi(b,a);a=new yh(b);R[s](this,cM,{type:"marker",overlay:a});R[s](this,dM,a)};function pM(a,b,c,d){this.n=a;this.j=b;this.A=c;this.B=6+d;this.e=new qr;this.L=new T(0,0);this.C=new T(0,0);this.F=new T(0,0);R[A](this,Le,this,this.Li);R[A](this,ul,this,this.Mi);R[A](this,sl,this,this.Ni);R[A](this,gl,this,this.Ji);R[A](this,fl,this,this.Ki);R[A](this,el,this,this.Ii)}L(pM,W);I=pM[D];Yo(I,function(){this.get("active")?this.set("draggableCursor",this.j):this.b&&qM(this)});function rM(a,b){a.b[aq]()[q](b);a.e.set("anchors",[b])}\nI.Li=function(a){if(this.b){if(sM(this,a)){qM(this);return}}else tM(this);rM(this,a)};I.Mi=function(){this.b&&qM(this)};I.Ni=function(a){this.b&&this.set("draggableCursor",sM(this,a)?"pointer":this.j);this.e.set("freeVertexPosition",a)};I.Ji=function(a,b){this.get("drawPolysWithDrag")&&(this.b||(tM(this),rM(this,a)),this.set("draggingCursor",this.j),Jq(b),this.set("drawWithDrag",i))};I.Ki=function(a,b){this.get("drawPolysWithDrag")&&(this.e.set("freeVertexPosition",a),Jq(b))};\nI.Ii=function(a,b){this.get("drawPolysWithDrag")&&(sM(this,a)?qM(this):rM(this,a),this.set("draggingCursor",""),this.e.set("freeVertexPosition",j),Jq(b),this.set("drawWithDrag",k))};\nfunction sM(a,b){var c=a.b[aq](),d=c[$b](),e=a.get("map"),f=e.get("projection"),e=e.N().get("zoom"),e=a.B/(1<<e),g=f[ab](b,a.L),h=b.lng(),d=c[bc](d-1),d=new Q(d.lat(),Bd(d.lng(),h-180,h+180),i),d=f[ab](d,a.C);if(o.abs(g.x-d.x)<=e&&o.abs(g.y-d.y)<=e)return i;if(!a.n)return k;c=c[bc](0);c=new Q(c.lat(),Bd(c.lng(),h-180,h+180),i);f=f[ab](c,a.F);return o.abs(g.x-f.x)<=e&&o.abs(g.y-f.y)<=e}\nfunction tM(a){var b=a.get("options"),c=new W;c[Db](b);var d=new or(c,a.n),c={};xd(c,b);c.strokeColor=d.get("strokeColor");c.strokeOpacity=d.get("strokeOpacity");c.strokeWeight=d.get("strokeWeight");c[Mp]==j&&Vi(c,a.A());delete c[Hp];delete c.map;a.b=new Hh(c);a.b[t]("map",a);c.strokeOpacity=d.get("ghostStrokeOpacity");b=a.e;b[Db](c);b.set("anchors",[]);b[t]("map",a)}\nfunction qM(a){var b=a.b;a.b=j;b[mb]("map");a.e[mb]("map");a.e.set("map",j);a.set("draggableCursor",a.j);if(b[aq]()[$b]())if(a.n){b.set("map",j);var c={};xd(c,a.get("options"));dp(c,b[aq]());c.map=a.get("map");Vi(c,b.get("zIndex"));delete c.paths;b=new Gh(c);c={type:"polygon",overlay:b};R[s](a,cM,c);R[s](a,bM,b)}else c={type:"polyline",overlay:b},R[s](a,cM,c),R[s](a,aM,b);else b.set("map",j)};function uM(){}uM[D].b=function(a,b){b.bounds=new fe(a,a);return new Ih(b)};uM[D].j=function(a,b,c){a.set("bounds",vM(b,c))};uM[D].e=function(){return"rectangle"};uM[D].f=function(){return $L};function vM(a,b){var c,d;a.lat()<b.lat()?(c=a.lat(),d=b.lat()):(c=b.lat(),d=a.lat());var e,f;180>=ce(a.lng(),b.lng())?(f=a.lng(),e=b.lng()):(f=b.lng(),e=a.lng());return wl(c,f,d,e)};function wM(){var a=0;return function(){return a++}};function xM(){var a=[Le,ul,gl,fl,el];Wl()||a[q](sl);var b=a[bb]();b[q](ql,ml);a=this.b=yM(this,b,a);this.A=zM(this);b="url("+Dl+"crosshair.cur)";Z.e&&(b+=" 7 7");var b=b+", crosshair",c=wM(),d=Wl()?9:0;this.j={circle:new kM(new nM,b,c),marker:new oM(b),polygon:new pM(i,b,c,d),polyline:new pM(k,b,c,d),rectangle:new kM(new uM,b,c)};var b=AM(this),e;for(e in this.j)c=this.j[e],c[t]("map",this),c[t]("draggingCursor",a),c[t]("draggableCursor",b),c[t]("drawWithDrag",a,"panAtEdge"),c[t]("options",this,e+\n"Options"),R[E](c,cM,this),R[E](c,e+"complete",this);this.j.polygon[t]("drawPolysWithDrag",this);this.j.polyline[t]("drawPolysWithDrag",this);this.B=[]}L(xM,W);\nfunction yM(a,b,c){var d=new kr(b),e=k;O(c,function(b){R[G](d,b,function(c){(b==Le||b==ul||b==sl)&&Wd(c);if(!(e&&b==sl||!e&&a.get("panWhileDrawing"))){b==gl&&(e=i);b==el&&(e=k);var d=a.get("map");if(a.e){var m=d.N().get("projectionController"),d=d.N().get("panes");m&&d&&(c.ta?m=m.fromContainerPixelToLatLng(c.ta):(d=qn(c,d[mj]),m=m[dk](d)),R[s](a.e,b,m,c))}}})});return d}\nfunction zM(a){var b=new Go(["map","drawingMode","pegmanDragging"],"active",function(a,b,e){return!!a&&!!b&&!e});b[t]("map",a);b[t]("drawingMode",a);a.b[t]("active",b);return b}function AM(a){var b=new Go(["draggableCursor","panWhileDrawing"],"cursor",function(a,b){return b?j:a});b[t]("panWhileDrawing",a);a.b[t]("draggableCursor",b,"cursor");return b}\nua(xM[D],function(){var a=this.get("map"),b=this.A,c=this.b;a?(a=a.N(),this[t]("mouseEventTarget",a),b[t]("pegmanDragging",a),c[t]("containerPixelBounds",a,"pixelBounds"),this.n=R[E](c,ml,a)):(this[mb]("mouseEventTarget"),this.set("mouseEventTarget",j),b[mb]("pegmanDragging"),c[mb]("containerPixelBounds"),this.n&&(R[jb](this.n),this.n=j))});\nxM[D].mouseEventTarget_changed=function(){var a=["offset","panes","projectionTopLeft","size"];ZL(this.b,a);var b=this.B;O(b,R[jb]);La(b,0);var c=this.get("mouseEventTarget");if(c){var d=this.b,e=this.get("map");Xq(d,a,e.N());O([gl,fl,el],function(a){var e=R[G](d,a,function(b){b.handled||R[s](c,a,b)});b[q](e)});R[E](d,ql,c)}};xM[D].drawingMode_changed=function(){this.e&&this.e.set("active",k);this.b.set("panAtEdge",k);(this.e=this.j[this.get("drawingMode")])&&this.e.set("active",i)};function BM(a){Ug[ic](this);var b=new xM;b[t]("map",a);b[t]("drawingMode",a);b[t]("panWhileDrawing",a);b[t]("markerOptions",a);b[t]("polygonOptions",a);b[t]("polylineOptions",a);b[t]("rectangleOptions",a);b[t]("circleOptions",a);b[t]("drawPolysWithDrag",a);R[E](b,cM,a);R[E](b,eM,a);R[E](b,dM,a);R[E](b,bM,a);R[E](b,aM,a);R[E](b,$L,a);this[t]("map",a);this[t]("drawingControl",a);this[t]("drawingControlOptions",a);this[t]("drawingMode",a)}L(BM,Ug);\nua(BM[D],function(){var a=this.get("map");if(a)this[t]("layoutManager",a.N());else this[mb]("layoutManager"),this.set("layoutManager",j)});BM[D].layoutManager_changed=BM[D].drawingControl_changed=BM[D].drawingControlOptions_changed=BM[D].P;\nBM[D].Z=function(){this.b&&(this.za.b(this.b),th(this.b),this.b=j,this.e[Aj](),this.e=j);if((this.za=this.get("layoutManager"))&&this.get("drawingControl")!=k){var a=this.get("drawingControlOptions")||{},b=a.drawingModes||CM,c=n[wb]("div");Nq(c);Gi(c[F],X(5));jm(c,10);this.b=c;this.e=new fM(this.b,b);this.e[t]("drawingMode",this);this.za[Wp](this.b,a[Qj]||1,k,0.25)}};var CM=["marker","polyline","rectangle","circle","polygon"];function DM(){}DM[D].b=BM;var EM=new DM;ff[ve]=function(a){eval(a)};jf(ve,EM);\n')