From 6adb32e746032be37b43117936b8cb0e7ca9daa5 Mon Sep 17 00:00:00 2001 From: Junior2Ran Date: Thu, 18 May 2023 15:42:30 +0800 Subject: [PATCH] update drawingmanager.min --- DrawingManager/src/DrawingManager.min.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/DrawingManager/src/DrawingManager.min.js b/DrawingManager/src/DrawingManager.min.js index 29ca2c1..fffb4a4 100644 --- a/DrawingManager/src/DrawingManager.min.js +++ b/DrawingManager/src/DrawingManager.min.js @@ -1 +1,9 @@ -var BMapGLLib=window.BMapGLLib=BMapGLLib||{};var BMAP_DRAWING_MARKER="marker",BMAP_DRAWING_POLYLINE="polyline",BMAP_DRAWING_CIRCLE="circle",BMAP_DRAWING_RECTANGLE="rectangle",BMAP_DRAWING_POLYGON="polygon";(function(){var d="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAs1JREFUWAnNmb9v01AQx989SzVI8dIBJNZ27Mb/QRpExMiOKAW1Mw3MRVCB2BlRECF/CBtjuwbBwGJL1JXs474vtuU4Tkho4tyTGr9ffvfxvV93VzL/mfYPLndSumqT4buG6Y4MI3+MpyQayc/IEI/Y0DfLW8Ov725cuKYlf2iZ/p3j8FZylT4hQx1m3lvmXSL6zoYH3pZ9PzgNfi367kKA3R634t/REXF6zMa0Fh28rp8IjJjsqb/det3vUVTXp1z3T8DOs/B+kvIHw3y7/OK180Q/PUuPB2+DL/PGsrMaZQrp3tPwJEn488rhIFQ+GGNDBmTN4qht6D7nm3ESfpRBurNeXGk9Ud/3gkf9N/SnOu6UBvE1jcKBSBQBmXWanAJsH0YvGtNcWV0C6WSX6yQ/McVuQ2DNycFW6ddQkdjz6EF54xQg46MkPMfibYimXozsbn872M2PoGKKcc5tHA7IoiDHkuE7DeKGSOP04rqHcL1Klq8VqMj6dgc3jtMgx+mBFjh8DlhwpSI/BiTaR0FTwn0PHnJWiYnPNcHlLNb4u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";var e=e||{guid:"$BAIDU$"};(function(){window[e.guid]={};e.extend=function(r,o){for(var q in o){if(o.hasOwnProperty(q)){r[q]=o[q]}}return r};e.lang=e.lang||{};e.lang.guid=function(){return"TANGRAM__"+(window[e.guid]._counter++).toString(36)};window[e.guid]._counter=window[e.guid]._counter||1;window[e.guid]._instances=window[e.guid]._instances||{};e.lang.Class=function(o){this.guid=o||e.lang.guid();window[e.guid]._instances[this.guid]=this};window[e.guid]._instances=window[e.guid]._instances||{};e.lang.isString=function(o){return"[object String]"==Object.prototype.toString.call(o)};e.lang.isFunction=function(o){return"[object Function]"==Object.prototype.toString.call(o)};e.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};e.lang.Class.prototype.dispose=function(){delete window[e.guid]._instances[this.guid];for(var o in this){if(!e.lang.isFunction(this[o])){delete this[o]}}this.disposed=true};e.lang.Event=function(o,p){this.type=o;this.returnValue=true;this.target=p||null;this.currentTarget=null};e.lang.Class.prototype.addEventListener=function(r,q,p){if(!e.lang.isFunction(q)){return}!this.__listeners&&(this.__listeners={});var o=this.__listeners,s;if(typeof p=="string"&&p){if(/[^\w\-]/.test(p)){throw ("nonstandard key:"+p)}else{q.hashCode=p;s=p}}r.indexOf("on")!=0&&(r="on"+r);typeof o[r]!="object"&&(o[r]={});s=s||e.lang.guid();q.hashCode=s;o[r][s]=q};e.lang.Class.prototype.removeEventListener=function(q,p){if(e.lang.isFunction(p)){p=p.hashCode}else{if(!e.lang.isString(p)){return}}!this.__listeners&&(this.__listeners={});q.indexOf("on")!=0&&(q="on"+q);var o=this.__listeners;if(!o[q]){return}o[q][p]&&delete o[q][p]};e.lang.Class.prototype.dispatchEvent=function(s,o){if(e.lang.isString(s)){s=new e.lang.Event(s)}!this.__listeners&&(this.__listeners={});o=o||{};for(var r in o){s[r]=o[r]}var r,q=this.__listeners,u=s.type;s.target=s.target||this;s.currentTarget=this;u.indexOf("on")!=0&&(u="on"+u);e.lang.isFunction(this[u])&&this[u].apply(this,arguments);if(typeof q[u]=="object"){for(r in q[u]){q[u][r].apply(this,arguments)}}return s.returnValue};e.lang.inherits=function(u,s,r){var q,t,o=u.prototype,p=new Function();p.prototype=s.prototype;t=u.prototype=new p();for(q in o){t[q]=o[q]}u.prototype.constructor=u;u.superClass=s.prototype;if("string"==typeof r){t._className=r}};e.dom=e.dom||{};e._g=e.dom._g=function(o){if(e.lang.isString(o)){return document.getElementById(o)}return o};e.g=e.dom.g=function(o){if("string"==typeof o||o instanceof String){return document.getElementById(o)}else{if(o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)){return o}}return null};e.insertHTML=e.dom.insertHTML=function(r,o,q){r=e.dom.g(r);var p,s;if(r.insertAdjacentHTML){r.insertAdjacentHTML(o,q)}else{p=r.ownerDocument.createRange();o=o.toUpperCase();if(o=="AFTERBEGIN"||o=="BEFOREEND"){p.selectNodeContents(r);p.collapse(o=="AFTERBEGIN")}else{s=o=="BEFOREBEGIN";p[s?"setStartBefore":"setEndAfter"](r);p.collapse(s)}p.insertNode(p.createContextualFragment(q))}return r};e.ac=e.dom.addClass=function(t,u){t=e.dom.g(t);var p=u.split(/\s+/),o=t.className,s=" "+o+" ",r=0,q=p.length;for(;r松开完成绘制",{position:K.point,offset:new BMapGL.Size(10,10)});b.setStyle(H.labelOptions);G.addOverlay(b)};var C=function(N){var O=G.getViewport(s.getBounds());O.zoom-=1;G.setViewport(O);G.removeOverlay(b);var M=new BMapGL.Point(s.getBounds().getNorthEast().lng,A.lat);D.hide();q=new BMapGL.Marker(M);q.setIcon(B);q.enableDragging();x=new BMapGL.Polyline([A,M],y);var P=new BMapGL.Point((s.getBounds().getNorthEast().lng+A.lng)/2,A.lat);o=new l("circle",P,r,s,H);J=J.concat([q,x,o]);var K=null;if(H.limit){K=H.limit.area}var L={limit:K,type:"circle",point:M,overlay:s,overlays:J};u=new c(L,H);G.addOverlay(q);G.addOverlay(x);G.addOverlay(o);G.addOverlay(u);H._skipEditing();o.addEventListener("radiuschange",function(V){var Q=V.radius;s.setRadius(Q);var U=i(A,Q,"east");var R=new BMapGL.Point(U.lng,A.lat);var T=U.lng>A.lng?(s.getBounds().getNorthEast().lng+A.lng)/2:(s.getBounds().getSouthWest().lng+A.lng)/2;var S=new BMapGL.Point(T,A.lat);q.setPosition(R);o.setInfo(S,Q);u.setPosition(R,true);u.updateWindow();x.setPath([A,R])});q.addEventListener("dragging",function(U){var R=new BMapGL.Point(U.latLng.lng,A.lat);var T=U.latLng.lng>A.lng?(s.getBounds().getNorthEast().lng+A.lng)/2:(s.getBounds().getSouthWest().lng+A.lng)/2;var Q=U.latLng.lng>A.lng?true:false;var S=new BMapGL.Point(T,A.lat);U.target.setPosition(R);o.setInfo(S,H._map.getDistance(A,U.latLng).toFixed(0));u.setPosition(R,Q);x.setPath([A,R]);r=H._map.getDistance(A,U.latLng).toFixed(0);s.setRadius(H._map.getDistance(A,U.latLng))});q.addEventListener("dragend",function(Q){u.updateWindow()});D.disableEdgeMove();D.removeEventListener("mousemove",w);D.removeEventListener("mousemove",F);e.un(document,"mouseup",C);G.removeOverlay(D)};var F=function(K){e.preventDefault(K);e.stopBubble(K);if(H.controlButton=="right"&&K.button==1){return}if(A==null){E(K)}};var p=function(K){e.preventDefault(K);e.stopBubble(K);G.removeOverlay(b);b=new BMapGL.Label("按下确认中心点,拖拽确认半径",{position:K.point,offset:new BMapGL.Size(10,10)});b.setStyle(H.labelOptions);G.addOverlay(b)};var z=function(K){G.removeOverlay(q);G.removeOverlay(x);G.removeOverlay(o);G.removeOverlay(u)};var v=function(K){A=K.latLng;s.setCenter(K.latLng)};var I=function(K){A=K.latLng;C(K)};D.addEventListener("mousedown",F);D.addEventListener("mousemove",p)};j.prototype._bindPolylineOrPolygon=function(){var v=this,o=this._map,A=this._mask,x=[],u=null,r=null,s=null,p=false;function w(){var D=arguments[0];var E=0;var C=0;for(var B=0;B0){s=D[0].point;r.setPositionAt(u.length-1,D[0].point);return}}s=null;r.setPositionAt(u.length-1,C.point);o.removeOverlay(b);b=new BMapGL.Label("单击绘制下一个点,双击完成绘制",{position:C.point,offset:new BMapGL.Size(10,10)});b.setStyle(v.labelOptions);o.addOverlay(b)};var t=function(H){e.stopBubble(H);p=false;o.removeOverlay(b);A.disableEdgeMove();A.removeEventListener("mousedown",q);A.removeEventListener("mousemove",z);A.removeEventListener("mousemove",y);A.removeEventListener("dblclick",t);if(v.controlButton=="right"){x.push(H.point)}else{if(e.ie<=8){}else{x.pop()}}try{if(v._enableGpc&&window.gpcas&&"polygon"===v._drawingType){var J=new gpcas.geometry.PolyDefault();for(var E=0;E松开结束绘制",{position:C.point,offset:new BMapGL.Size(10,10)});b.setStyle(u.labelOptions);p.addOverlay(b)};var s=function(K){y.hide();var L=null;var F=[];var M=t(q,K.point);var J=[];var C=p.getViewport(M);C.zoom-=1;p.setViewport(C);p.removeOverlay(b);var B=u._map.getDistance(q,M[2]).toFixed(0);var N=u._map.getDistance(q,M[6]).toFixed(0);var A=new l("rectangle",M[0],{width:B,height:N},v,u);for(var H=0;H0?C:null;return T};j.prototype.mc2ll=function(o){var q=this._map;var p=q.mercatorToLnglat(o.lng,o.lat);return new BMapGL.Point(p[0],p[1])};j.prototype.ll2mc=function(o){var q=this._map;var p=q.lnglatToMercator(o.lng,o.lat);return new BMapGL.Point(p[0],p[1])};function c(o,p){this.limit=o.limit;this.type=o.type;this.point=o.point;this.overlay=o.overlay;this.overlays=o.overlays;this.DrawingManager=p}c.prototype=new BMapGL.Overlay();c.prototype.dispatchEvent=e.lang.Class.prototype.dispatchEvent;c.prototype.addEventListener=e.lang.Class.prototype.addEventListener;c.prototype.removeEventListener=e.lang.Class.prototype.removeEventListener;c.prototype.initialize=function(s){var r=this;this._map=s;var o=(this.type==="polyline"?"长度":"面积");var q=(this.type==="polyline"?"万米":"万平方米");var t=this.div=document.createElement("div");t.className="operateWindow";var p='
'+o+"不超过"+this.limit/10000+q+"!
";t.innerHTML=p;this._map.getPanes().markerPane.appendChild(t);this.updateWindow();this._bind();return t};c.prototype._bind=function(){var q=this;var r=this._map;var o=this.overlay;var p=this.overlays;document.getElementById("confirmOperate").addEventListener("click",function(v){r.removeOverlay(q);if(q.type=="rectangle"){var u=q.DrawingManager._calculate(o,o.getPath());q.DrawingManager.overlays.push(o)}else{if(q.type=="circle"){var u=q.DrawingManager._calculate(o,q.point);q.DrawingManager.overlays.push(o)}else{if(q.type=="polygon"){var u=q.DrawingManager._calculate(o,(o.getPath()));q.DrawingManager.overlays.push(o);o.disableEditing()}else{if(q.type=="polyline"){var u=q.DrawingManager._calculate(o,(o.getPath()));q.DrawingManager.overlays.push(o);o.disableEditing()}}}}q.DrawingManager._dispatchOverlayComplete(o,u);for(var t=0;to){document.getElementById("confirmOperate").style.display="none";document.getElementById("warnOperate").style.display="block"}else{document.getElementById("confirmOperate").style.display="block";document.getElementById("warnOperate").style.display="none"}};c.prototype.setPosition=function(p,o){this.point=p;var r=this._map,q=r.pointToOverlayPixel(this.point);if(o){this.div.classList.remove("operateLeft");this.div.style.left=q.x+15+"px"}else{this.div.classList.add("operateLeft");this.div.style.left=q.x-105+"px"}this.div.style.top=q.y-16+"px"};c.prototype.draw=function(){var p=this._map,o=p.pointToOverlayPixel(this.point);this.div.style.left=o.x+15+"px";this.div.style.top=o.y-16+"px"};function l(q,o,r,p,s){this.type=q;this.point=o;this.number=r;this.overlay=p;this.DrawingManager=s}l.prototype=new BMapGL.Overlay();l.prototype.dispatchEvent=e.lang.Class.prototype.dispatchEvent;l.prototype.addEventListener=e.lang.Class.prototype.addEventListener;l.prototype.removeEventListener=e.lang.Class.prototype.removeEventListener;l.prototype.initialize=function(q){var p=this;this._map=q;var r=this.div=document.createElement("div");r.className="screenshot";if(this.type=="circle"){var o='
'+this.number+'
'}else{if(this.type=="rectangle"){var o='
'+this.number.width+'
x
'+this.number.height+'
'}}r.innerHTML=o;this._map.getPanes().markerPane.appendChild(r);this._bind();return r};l.prototype._bind=function(){this.setNumber(this.number);if(this.type=="circle"){this.bindCircleEvent()}else{this.bindRectEvent()}};l.prototype.bindCircleEvent=function(){var p=this;var o=document.getElementById("screenshotNum");var q=document.getElementById("circleInput");o.addEventListener("click",function(r){var s=o.innerText;o.style.display="none";q.value=s;q.style.display="inline-block";q.focus()});q.addEventListener("click",function(r){q.focus()});q.addEventListener("keydown",function(s){if(s.keyCode===13){var t=q.value;q.style.display="none";o.style.display="inline-block";o.innerText=t;var r={radius:t,overlay:p.overlay};p._dispatchRadiusChange(r)}});q.addEventListener("blur",function(s){var t=q.value;q.style.display="none";o.style.display="inline-block";o.innerText=t;var r={radius:t,overlay:p.overlay};p._dispatchRadiusChange(r)})};l.prototype.bindRectEvent=function(){var q=this;var p=document.getElementById("rectWidth");var s=document.getElementById("rectWidthInput");var o=document.getElementById("rectHeight");var r=document.getElementById("rectHeightInput");s.value=p.innerText;r.value=o.innerText;p.addEventListener("click",function(t){var u=p.innerText;p.style.display="none";s.value=u;s.style.display="inline-block";s.focus()});o.addEventListener("click",function(t){var u=o.innerText;o.style.display="none";r.value=u;r.style.display="inline-block";r.focus()});s.addEventListener("click",function(t){s.focus()});r.addEventListener("click",function(t){r.focus()});s.addEventListener("keydown",function(w){if(w.keyCode===13){var u=s.value;var v=r.value;s.style.display="none";r.style.display="none";p.style.display="inline-block";o.style.display="inline-block";p.innerText=u;o.innerText=v;var t={width:u,height:v,overlay:q.overlay};q._dispatchRectWHChange(t)}});r.addEventListener("keydown",function(w){if(w.keyCode===13){var u=s.value;var v=r.value;s.style.display="none";r.style.display="none";p.style.display="inline-block";o.style.display="inline-block";p.innerText=u;o.innerText=v;var t={width:u,height:v,overlay:q.overlay};q._dispatchRectWHChange(t)}})};l.prototype.setInfo=function(o,p){this.setNumber(p);this.setPosition(o)};l.prototype.setNumber=function(o){if(this.type=="circle"){document.getElementById("screenshotNum").textContent=o}else{document.getElementById("rectWidth").textContent=o.width;document.getElementById("rectHeight").textContent=o.height}};l.prototype.setPosition=function(o){this.point=o;var r=this._map,q=this.type,p=r.pointToOverlayPixel(this.point);if(q=="circle"){this.div.style.left=p.x-30+"px";this.div.style.top=p.y-40+"px"}else{if(q=="rectangle"){this.div.style.left=p.x+"px";this.div.style.top=p.y-45+"px"}}};l.prototype.draw=function(){var q=this._map,p=this.type,o=q.pointToOverlayPixel(this.point);if(p=="circle"){this.div.style.left=o.x-30+"px";this.div.style.top=o.y-40+"px"}else{if(p=="rectangle"){this.div.style.left=o.x+"px";this.div.style.top=o.y-45+"px"}}};l.prototype._dispatchRadiusChange=function(o){this.dispatchEvent("radiuschange",o)};l.prototype._dispatchRectWHChange=function(o){this.dispatchEvent("rectwhchange",o)};function h(){this._enableEdgeMove=false}h.prototype=new BMapGL.Overlay();h.prototype.dispatchEvent=e.lang.Class.prototype.dispatchEvent;h.prototype.addEventListener=e.lang.Class.prototype.addEventListener;h.prototype.removeEventListener=e.lang.Class.prototype.removeEventListener;h.prototype.initialize=function(q){var p=this;this._map=q;var r=this.container=document.createElement("div");var o=this._map.getSize();r.style.cssText="position:absolute;background:transparent;cursor:crosshair;width:"+o.width+"px;height:"+o.height+"px";this._map.addEventListener("resize",function(s){p._adjustSize(s.size)});this._map.getPanes().floatPane.appendChild(r);this._bind();return r};h.prototype.draw=function(){var q=this._map,o=q.pixelToPoint(new BMapGL.Pixel(0,0)),p=q.pointToOverlayPixel(o);this.container.style.left=p.x+"px";this.container.style.top=p.y+"px"};h.prototype.enableEdgeMove=function(){this._enableEdgeMove=true};h.prototype.disableEdgeMove=function(){clearInterval(this._edgeMoveTimer);this._enableEdgeMove=false};h.prototype._bind=function(){var t=this,o=this._map,p=this.container,u=null,v=null;var s=function(x){return{x:x.clientX,y:x.clientY}};var r=function(z){var y=z.type;z=e.getEvent(z);point=t.getDrawPoint(z);var A=function(B){z.point=point;t.dispatchEvent(z)};if(y=="mousedown"){u=s(z)}var x=s(z);if(y=="click"){if(Math.abs(x.x-u.x)<5&&Math.abs(x.y-u.y)<5){if(!v||!(Math.abs(x.x-v.x)<5&&Math.abs(x.y-v.y)<5)){A("click");v=s(z)}else{v=null}}}else{A(y)}};var w=["click","mousedown","mousemove","mouseup","dblclick"],q=w.length;while(q--){e.on(p,w[q],r)}e.on(p,"mousemove",function(x){if(t._enableEdgeMove){t.mousemoveAction(x)}})};h.prototype.mousemoveAction=function(v){function o(A){var z=A.clientX,y=A.clientY;if(A.changedTouches){z=A.changedTouches[0].clientX;y=A.changedTouches[0].clientY}return new BMapGL.Pixel(z,y)}var p=this._map,w=this,q=p.pointToPixel(this.getDrawPoint(v)),s=o(v),t=s.x-q.x,r=s.y-q.y;q=new BMapGL.Pixel((s.x-t),(s.y-r));this._draggingMovePixel=q;var x=p.pixelToPoint(q),u={pixel:q,point:x};this._panByX=this._panByY=0;if(q.x<=20||q.x>=p.width-20||q.y<=50||q.y>=p.height-10){if(q.x<=20){this._panByX=8}else{if(q.x>=p.width-20){this._panByX=-8}}if(q.y<=50){this._panByY=8}else{if(q.y>=p.height-10){this._panByY=-8}}if(!this._edgeMoveTimer){this._edgeMoveTimer=setInterval(function(){p.panBy(w._panByX,w._panByY,{noAnimation:true})},30)}}else{if(this._edgeMoveTimer){clearInterval(this._edgeMoveTimer);this._edgeMoveTimer=null}}};h.prototype._adjustSize=function(o){this.container.style.width=o.width+"px";this.container.style.height=o.height+"px"};h.prototype.getDrawPoint=function(t){var s=this._map,r=e.getTarget(t),p=t.offsetX||t.layerX||0,u=t.offsetY||t.layerY||0;if(r.nodeType!=1){r=r.parentNode}while(r&&r!=s.getContainer()){if(!(r.clientWidth==0&&r.clientHeight==0&&r.offsetParent&&r.offsetParent.nodeName=="TD")){p+=r.offsetLeft||0;u+=r.offsetTop||0}r=r.offsetParent}var q=new BMapGL.Pixel(p,u);var o=s.pixelToPoint(q);return o};function g(p,o){this.drawingManager=p;o=this.drawingToolOptions=o||{};this._opts={};this.defaultAnchor=BMAP_ANCHOR_TOP_LEFT;this.defaultOffset=new BMapGL.Size(10,10);this.defaultDrawingModes=[BMAP_DRAWING_MARKER,BMAP_DRAWING_CIRCLE,BMAP_DRAWING_POLYLINE,BMAP_DRAWING_POLYGON,BMAP_DRAWING_RECTANGLE];if(o.drawingModes){this.drawingModes=o.drawingModes}else{this.drawingModes=this.defaultDrawingModes}if(o.hasCustomStyle){if(o.anchor){this.setAnchor(o.anchor)}if(o.offset){this.setOffset(o.offset)}}}g.prototype=new BMapGL.Control();g.prototype.initialize=function(s){var p=this.container=document.createElement("div");p.className="BMapGLLib_Drawing";var o=this.panel=document.createElement("div");o.className="BMapGLLib_Drawing_panel";if(this.drawingToolOptions&&this.drawingToolOptions.hasCustomStyle&&this.drawingToolOptions.scale){this._setScale(this.drawingToolOptions.scale)}p.appendChild(o);var q=this._generalHtml();o.appendChild(q);var r=this.tip=document.createElement("div");r.className="BMapGLLib_tip";r.innerHTML='

';if(this.drawingToolOptions.enableTips===true){o.appendChild(r)}this._bind(o);if(this.drawingToolOptions.customContainer){e.g(this.drawingToolOptions.customContainer).appendChild(p)}else{s.getContainer().appendChild(p)}return p};g.prototype._generalHtml=function(u){var t=this;var p={};p.hander="拖动地图";p[BMAP_DRAWING_MARKER]="画点";p[BMAP_DRAWING_CIRCLE]="圆形工具";p[BMAP_DRAWING_POLYLINE]="画折线";p[BMAP_DRAWING_POLYGON]="多边形工具";p[BMAP_DRAWING_RECTANGLE]="矩形工具";var v=function(x,w){var y=document.createElement("a");y.className=x;y.href="javascript:void(0)";y.setAttribute("drawingType",w);y.setAttribute("onfocus","this.blur()");y.addEventListener("mouseenter",function(A){var z=A.target.getAttribute("drawingType");var B=p[z];if(z==="hander"){t.tip.children[0].innerText=B;t.tip.children[1].innerText="使用鼠标拖动地图"}else{t.tip.className+=" "+z;t.tip.children[0].innerText=B;t.tip.children[1].innerText="使用"+B+"选出目标区域"}t.tip.style.display="block"});y.addEventListener("mouseleave",function(B){var z=B.target.getAttribute("drawingType");var A=" "+t.tip.className.replace(/[\t\r\n]/g,"")+" ";while(A.indexOf(" "+z+" ")>=0){A=A.replace(" "+z+" "," ")}t.tip.className=A.replace(/^\s+|\s+$/g,"");t.tip.style.display="none"});return y};var q=document.createDocumentFragment();for(var r=0,o=this.drawingModes.length;r松开完成绘制",{position:K.point,offset:new BMapGL.Size(10,10)});b.setStyle(H.labelOptions);G.addOverlay(b)};var C=function(N){var O=G.getViewport(s.getBounds());O.zoom-=1;G.setViewport(O);G.removeOverlay(b);var M=new BMapGL.Point(s.getBounds().getNorthEast().lng,A.lat);D.hide();q=new BMapGL.Marker(M);q.setIcon(B);q.enableDragging();x=new BMapGL.Polyline([A,M],y);var P=new BMapGL.Point((s.getBounds().getNorthEast().lng+A.lng)/2,A.lat);o=new l("circle",P,r,s,H);J=J.concat([q,x,o]);var K=null;if(H.limit){K=H.limit.area}var L={limit:K,type:"circle",point:M,overlay:s,overlays:J};u=new c(L,H);G.addOverlay(q);G.addOverlay(x);G.addOverlay(o);G.addOverlay(u);H._skipEditing();o.addEventListener("radiuschange",function(V){var Q=V.radius;s.setRadius(Q);var U=i(A,Q,"east");var R=new BMapGL.Point(U.lng,A.lat);var T=U.lng>A.lng?(s.getBounds().getNorthEast().lng+A.lng)/2:(s.getBounds().getSouthWest().lng+A.lng)/2; +var S=new BMapGL.Point(T,A.lat);q.setPosition(R);o.setInfo(S,Q);u.setPosition(R,true);u.updateWindow();x.setPath([A,R])});q.addEventListener("dragging",function(U){var R=new BMapGL.Point(U.latLng.lng,A.lat);var T=U.latLng.lng>A.lng?(s.getBounds().getNorthEast().lng+A.lng)/2:(s.getBounds().getSouthWest().lng+A.lng)/2;var Q=U.latLng.lng>A.lng?true:false;var S=new BMapGL.Point(T,A.lat);U.target.setPosition(R);o.setInfo(S,H._map.getDistance(A,U.latLng).toFixed(0));u.setPosition(R,Q);x.setPath([A,R]);r=H._map.getDistance(A,U.latLng).toFixed(0);s.setRadius(H._map.getDistance(A,U.latLng))});q.addEventListener("dragend",function(Q){u.updateWindow()});D.disableEdgeMove();D.removeEventListener("mousemove",w);D.removeEventListener("mousemove",F);e.un(document,"mouseup",C);G.removeOverlay(D)};var F=function(K){e.preventDefault(K);e.stopBubble(K);if(H.controlButton=="right"&&K.button==1){return}if(A==null){E(K)}};var p=function(K){e.preventDefault(K);e.stopBubble(K);G.removeOverlay(b);b=new BMapGL.Label("按下确认中心点,拖拽确认半径",{position:K.point,offset:new BMapGL.Size(10,10)});b.setStyle(H.labelOptions);G.addOverlay(b)};var z=function(K){G.removeOverlay(q);G.removeOverlay(x);G.removeOverlay(o);G.removeOverlay(u)};var v=function(K){A=K.latLng;s.setCenter(K.latLng)};var I=function(K){A=K.latLng;C(K)};D.addEventListener("mousedown",F);D.addEventListener("mousemove",p)};j.prototype._bindPolylineOrPolygon=function(){var v=this,o=this._map,A=this._mask,x=[],u=null,r=null,s=null,p=false;function w(){var D=arguments[0];var E=0;var C=0;for(var B=0;B0){s=D[0].point;r.setPositionAt(u.length-1,D[0].point);return}}s=null;r.setPositionAt(u.length-1,C.point);o.removeOverlay(b);b=new BMapGL.Label("单击绘制下一个点,双击完成绘制",{position:C.point,offset:new BMapGL.Size(10,10)});b.setStyle(v.labelOptions);o.addOverlay(b)};var t=function(H){e.stopBubble(H);p=false;o.removeOverlay(b);A.disableEdgeMove();A.removeEventListener("mousedown",q);A.removeEventListener("mousemove",z);A.removeEventListener("mousemove",y);A.removeEventListener("dblclick",t);if(v.controlButton=="right"){x.push(H.point)}else{if(e.ie<=8){}else{x.pop()}}try{if(v._enableGpc&&window.gpcas&&"polygon"===v._drawingType){var J=new gpcas.geometry.PolyDefault();for(var E=0;E松开结束绘制",{position:C.point,offset:new BMapGL.Size(10,10)});b.setStyle(u.labelOptions);p.addOverlay(b)};var s=function(K){y.hide();var L=null;var F=[];var M=t(q,K.point);var J=[];var C=p.getViewport(M);C.zoom-=1;p.setViewport(C);p.removeOverlay(b);var B=u._map.getDistance(q,M[2]).toFixed(0);var N=u._map.getDistance(q,M[6]).toFixed(0);var A=new l("rectangle",M[0],{width:B,height:N},v,u);for(var H=0;H0?C:null;return T};j.prototype.mc2ll=function(o){var q=this._map;var p=q.mercatorToLnglat(o.lng,o.lat); +return new BMapGL.Point(p[0],p[1])};j.prototype.ll2mc=function(o){var q=this._map;var p=q.lnglatToMercator(o.lng,o.lat);return new BMapGL.Point(p[0],p[1])};function c(o,p){this.limit=o.limit;this.type=o.type;this.point=o.point;this.overlay=o.overlay;this.overlays=o.overlays;this.DrawingManager=p}c.prototype=new BMapGL.Overlay();c.prototype.dispatchEvent=e.lang.Class.prototype.dispatchEvent;c.prototype.addEventListener=e.lang.Class.prototype.addEventListener;c.prototype.removeEventListener=e.lang.Class.prototype.removeEventListener;c.prototype.initialize=function(s){var r=this;this._map=s;var o=(this.type==="polyline"?"长度":"面积");var q=(this.type==="polyline"?"万米":"万平方米");var t=this.div=document.createElement("div");t.className="operateWindow";var p='
'+o+"不超过"+this.limit/10000+q+"!
";t.innerHTML=p;this._map.getPanes().markerPane.appendChild(t);this.updateWindow();this._bind();return t};c.prototype._bind=function(){var q=this;var r=this._map;var o=this.overlay;var p=this.overlays;document.getElementById("confirmOperate").addEventListener("click",function(v){r.removeOverlay(q);if(q.type=="rectangle"){var u=q.DrawingManager._calculate(o,o.getPath());q.DrawingManager.overlays.push(o)}else{if(q.type=="circle"){var u=q.DrawingManager._calculate(o,q.point);q.DrawingManager.overlays.push(o)}else{if(q.type=="polygon"){var u=q.DrawingManager._calculate(o,(o.getPath()));q.DrawingManager.overlays.push(o);o.disableEditing()}else{if(q.type=="polyline"){var u=q.DrawingManager._calculate(o,(o.getPath()));q.DrawingManager.overlays.push(o);o.disableEditing()}}}}q.DrawingManager._dispatchOverlayComplete(o,u);for(var t=0;to){document.getElementById("confirmOperate").style.display="none";document.getElementById("warnOperate").style.display="block"}else{document.getElementById("confirmOperate").style.display="block";document.getElementById("warnOperate").style.display="none"}};c.prototype.setPosition=function(p,o){this.point=p;var r=this._map,q=r.pointToOverlayPixel(this.point);if(o){this.div.classList.remove("operateLeft");this.div.style.left=q.x+15+"px"}else{this.div.classList.add("operateLeft");this.div.style.left=q.x-105+"px"}this.div.style.top=q.y-16+"px"};c.prototype.draw=function(){var p=this._map,o=p.pointToOverlayPixel(this.point);this.div.style.left=o.x+15+"px";this.div.style.top=o.y-16+"px"};function l(q,o,r,p,s){this.type=q;this.point=o;this.number=r;this.overlay=p;this.DrawingManager=s}l.prototype=new BMapGL.Overlay();l.prototype.dispatchEvent=e.lang.Class.prototype.dispatchEvent;l.prototype.addEventListener=e.lang.Class.prototype.addEventListener;l.prototype.removeEventListener=e.lang.Class.prototype.removeEventListener;l.prototype.initialize=function(q){var p=this;this._map=q;var r=this.div=document.createElement("div");r.className="screenshot";if(this.type=="circle"){var o='
'+this.number+'
'}else{if(this.type=="rectangle"){var o='
'+this.number.width+'
x
'+this.number.height+'
'}}r.innerHTML=o;this._map.getPanes().markerPane.appendChild(r);this._bind();return r};l.prototype._bind=function(){this.setNumber(this.number);if(this.type=="circle"){this.bindCircleEvent()}else{this.bindRectEvent()}};l.prototype.bindCircleEvent=function(){var p=this;var o=document.getElementById("screenshotNum");var q=document.getElementById("circleInput");o.addEventListener("click",function(r){var s=o.innerText;o.style.display="none";q.value=s;q.style.display="inline-block";q.focus()});q.addEventListener("click",function(r){q.focus()});q.addEventListener("keydown",function(s){if(s.keyCode===13){var t=q.value;q.style.display="none";o.style.display="inline-block"; +o.innerText=t;var r={radius:t,overlay:p.overlay};p._dispatchRadiusChange(r)}});q.addEventListener("blur",function(s){var t=q.value;q.style.display="none";o.style.display="inline-block";o.innerText=t;var r={radius:t,overlay:p.overlay};p._dispatchRadiusChange(r)})};l.prototype.bindRectEvent=function(){var q=this;var p=document.getElementById("rectWidth");var s=document.getElementById("rectWidthInput");var o=document.getElementById("rectHeight");var r=document.getElementById("rectHeightInput");s.value=p.innerText;r.value=o.innerText;p.addEventListener("click",function(t){var u=p.innerText;p.style.display="none";s.value=u;s.style.display="inline-block";s.focus()});o.addEventListener("click",function(t){var u=o.innerText;o.style.display="none";r.value=u;r.style.display="inline-block";r.focus()});s.addEventListener("click",function(t){s.focus()});r.addEventListener("click",function(t){r.focus()});s.addEventListener("keydown",function(w){if(w.keyCode===13){var u=s.value;var v=r.value;s.style.display="none";r.style.display="none";p.style.display="inline-block";o.style.display="inline-block";p.innerText=u;o.innerText=v;var t={width:u,height:v,overlay:q.overlay};q._dispatchRectWHChange(t)}});r.addEventListener("keydown",function(w){if(w.keyCode===13){var u=s.value;var v=r.value;s.style.display="none";r.style.display="none";p.style.display="inline-block";o.style.display="inline-block";p.innerText=u;o.innerText=v;var t={width:u,height:v,overlay:q.overlay};q._dispatchRectWHChange(t)}})};l.prototype.setInfo=function(o,p){this.setNumber(p);this.setPosition(o)};l.prototype.setNumber=function(o){if(this.type=="circle"){document.getElementById("screenshotNum").textContent=o}else{document.getElementById("rectWidth").textContent=o.width;document.getElementById("rectHeight").textContent=o.height}};l.prototype.setPosition=function(o){this.point=o;var r=this._map,q=this.type,p=r.pointToOverlayPixel(this.point);if(q=="circle"){this.div.style.left=p.x-30+"px";this.div.style.top=p.y-40+"px"}else{if(q=="rectangle"){this.div.style.left=p.x+"px";this.div.style.top=p.y-45+"px"}}};l.prototype.draw=function(){var q=this._map,p=this.type,o=q.pointToOverlayPixel(this.point);if(p=="circle"){this.div.style.left=o.x-30+"px";this.div.style.top=o.y-40+"px"}else{if(p=="rectangle"){this.div.style.left=o.x+"px";this.div.style.top=o.y-45+"px"}}};l.prototype._dispatchRadiusChange=function(o){this.dispatchEvent("radiuschange",o)};l.prototype._dispatchRectWHChange=function(o){this.dispatchEvent("rectwhchange",o)};function h(){this._enableEdgeMove=false}h.prototype=new BMapGL.Overlay();h.prototype.dispatchEvent=e.lang.Class.prototype.dispatchEvent;h.prototype.addEventListener=e.lang.Class.prototype.addEventListener;h.prototype.removeEventListener=e.lang.Class.prototype.removeEventListener;h.prototype.initialize=function(q){var p=this;this._map=q;var r=this.container=document.createElement("div");var o=this._map.getSize();r.style.cssText="position:absolute;background:transparent;cursor:crosshair;width:"+o.width+"px;height:"+o.height+"px";this._map.addEventListener("resize",function(s){p._adjustSize(s.size)});this._map.getPanes().floatPane.appendChild(r);this._bind();return r};h.prototype.draw=function(){var q=this._map,o=q.pixelToPoint(new BMapGL.Pixel(0,0)),p=q.pointToOverlayPixel(o);this.container.style.left=p.x+"px";this.container.style.top=p.y+"px"};h.prototype.enableEdgeMove=function(){this._enableEdgeMove=true};h.prototype.disableEdgeMove=function(){clearInterval(this._edgeMoveTimer);this._enableEdgeMove=false};h.prototype._bind=function(){var t=this,o=this._map,p=this.container,u=null,v=null;var s=function(x){return{x:x.clientX,y:x.clientY}};var r=function(z){var y=z.type;z=e.getEvent(z);point=t.getDrawPoint(z);var A=function(B){z.point=point;t.dispatchEvent(z)};if(y=="mousedown"){u=s(z)}var x=s(z);if(y=="click"){if(Math.abs(x.x-u.x)<5&&Math.abs(x.y-u.y)<5){if(!v||!(Math.abs(x.x-v.x)<5&&Math.abs(x.y-v.y)<5)){A("click");v=s(z)}else{v=null}}}else{A(y)}};var w=["click","mousedown","mousemove","mouseup","dblclick"],q=w.length;while(q--){e.on(p,w[q],r)}e.on(p,"mousemove",function(x){if(t._enableEdgeMove){t.mousemoveAction(x)}})};h.prototype.mousemoveAction=function(v){function o(A){var z=A.clientX,y=A.clientY;if(A.changedTouches){z=A.changedTouches[0].clientX;y=A.changedTouches[0].clientY}return new BMapGL.Pixel(z,y)}var p=this._map,w=this,q=p.pointToPixel(this.getDrawPoint(v)),s=o(v),t=s.x-q.x,r=s.y-q.y;q=new BMapGL.Pixel((s.x-t),(s.y-r));this._draggingMovePixel=q;var x=p.pixelToPoint(q),u={pixel:q,point:x};this._panByX=this._panByY=0;if(q.x<=20||q.x>=p.width-20||q.y<=50||q.y>=p.height-10){if(q.x<=20){this._panByX=8}else{if(q.x>=p.width-20){this._panByX=-8}}if(q.y<=50){this._panByY=8}else{if(q.y>=p.height-10){this._panByY=-8}}if(!this._edgeMoveTimer){this._edgeMoveTimer=setInterval(function(){p.panBy(w._panByX,w._panByY,{noAnimation:true})},30)}}else{if(this._edgeMoveTimer){clearInterval(this._edgeMoveTimer);this._edgeMoveTimer=null}}};h.prototype._adjustSize=function(o){this.container.style.width=o.width+"px"; +this.container.style.height=o.height+"px"};h.prototype.getDrawPoint=function(t){var s=this._map,r=e.getTarget(t),p=t.offsetX||t.layerX||0,u=t.offsetY||t.layerY||0;if(r.nodeType!=1){r=r.parentNode}while(r&&r!=s.getContainer()){if(!(r.clientWidth==0&&r.clientHeight==0&&r.offsetParent&&r.offsetParent.nodeName=="TD")){p+=r.offsetLeft||0;u+=r.offsetTop||0}r=r.offsetParent}var q=new BMapGL.Pixel(p,u);var o=s.pixelToPoint(q);return o};function g(p,o){this.drawingManager=p;o=this.drawingToolOptions=o||{};this._opts={};this.defaultAnchor=BMAP_ANCHOR_TOP_LEFT;this.defaultOffset=new BMapGL.Size(10,10);this.defaultDrawingModes=[BMAP_DRAWING_MARKER,BMAP_DRAWING_CIRCLE,BMAP_DRAWING_POLYLINE,BMAP_DRAWING_POLYGON,BMAP_DRAWING_RECTANGLE];if(o.drawingModes){this.drawingModes=o.drawingModes}else{this.drawingModes=this.defaultDrawingModes}if(o.hasCustomStyle){if(o.anchor){this.setAnchor(o.anchor)}if(o.offset){this.setOffset(o.offset)}}}g.prototype=new BMapGL.Control();g.prototype.initialize=function(s){var p=this.container=document.createElement("div");p.className="BMapGLLib_Drawing";var o=this.panel=document.createElement("div");o.className="BMapGLLib_Drawing_panel";if(this.drawingToolOptions&&this.drawingToolOptions.hasCustomStyle&&this.drawingToolOptions.scale){this._setScale(this.drawingToolOptions.scale)}p.appendChild(o);var q=this._generalHtml();o.appendChild(q);var r=this.tip=document.createElement("div");r.className="BMapGLLib_tip";r.innerHTML='

';if(this.drawingToolOptions.enableTips===true){o.appendChild(r)}this._bind(o);if(this.drawingToolOptions.customContainer){e.g(this.drawingToolOptions.customContainer).appendChild(p)}else{s.getContainer().appendChild(p)}return p};g.prototype._generalHtml=function(u){var t=this;var p={};p.hander="拖动地图";p[BMAP_DRAWING_MARKER]="画点";p[BMAP_DRAWING_CIRCLE]="圆形工具";p[BMAP_DRAWING_POLYLINE]="画折线";p[BMAP_DRAWING_POLYGON]="多边形工具";p[BMAP_DRAWING_RECTANGLE]="矩形工具";var v=function(x,w){var y=document.createElement("a");y.className=x;y.href="javascript:void(0)";y.setAttribute("drawingType",w);y.setAttribute("onfocus","this.blur()");y.addEventListener("mouseenter",function(A){var z=A.target.getAttribute("drawingType");var B=p[z];if(z==="hander"){t.tip.children[0].innerText=B;t.tip.children[1].innerText="使用鼠标拖动地图"}else{t.tip.className+=" "+z;t.tip.children[0].innerText=B;t.tip.children[1].innerText="使用"+B+"选出目标区域"}t.tip.style.display="block"});y.addEventListener("mouseleave",function(B){var z=B.target.getAttribute("drawingType");var A=" "+t.tip.className.replace(/[\t\r\n]/g,"")+" ";while(A.indexOf(" "+z+" ")>=0){A=A.replace(" "+z+" "," ")}t.tip.className=A.replace(/^\s+|\s+$/g,"");t.tip.style.display="none"});return y};var q=document.createDocumentFragment();for(var r=0,o=this.drawingModes.length;r