th-ol-draw
Version:
1 lines • 73.8 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("ol"),require("ol/interaction"),require("ol/style"),require("ol/Feature"),require("ol/interaction/Draw"),require("ol/layer"),require("ol/source"),require("ol/geom"),require("ol/geom/Polygon"),require("ol/extent.js"),require("ol/color"),require("ol/extent")):"function"==typeof define&&define.amd?define(["ol","ol/interaction","ol/style","ol/Feature","ol/interaction/Draw","ol/layer","ol/source","ol/geom","ol/geom/Polygon","ol/extent.js","ol/color","ol/extent"],e):(t=t||self).olPlot=e(t.ol,t.interaction,t.style,t.Feature,t.Draw,t.layer,t.source,t.geom,t.Polygon$1,t.extent_js,t.color,t.extent)}(this,function(s,r,l,u,n,a,h,c,i,p,g,f){"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t,e){t.prototype=Object.create(e.prototype),o(t.prototype.constructor=t,e)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function P(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;const m=function(){this.Events={},this.__cnt=0};m.hasOwnKey=Function.call.bind(Object.hasOwnProperty),m.slice=Function.call.bind(Array.prototype.slice),m.prototype.on=function(t,e,n){return this.bindEvent(t,e,0,n)},m.prototype.un=function(i){var t,e,o=!1,n=typeof i,r=this;return"string"==n?!!m.hasOwnKey(this.Events,i)&&(delete this.Events[i],!0):"object"==n?(t=i[0],e=i[1],!(!m.hasOwnKey(this.Events,t)||!m.hasOwnKey(this.Events[t],e))&&(delete this.Events[t][e],!0)):"function"!=n||(r.eachEvent(r.Events,function(n,t){r.eachEvent(t,function(t,e){e[0]===i&&(delete r.Events[n][t],o=!0)})}),o)},m.prototype.once=function(t,e,n){return this.bindEvent(t,e,1,n)},m.prototype.action=function(n,i){m.hasOwnKey(this.Events,n)&&this.eachEvent(this.Events[n],function(t,e){e[0].apply(e[2],i),e[1]&&delete this.Events[n][t]})},m.prototype.dispatch=function(t){var e=this,n=m.slice(arguments,1);setTimeout(function(){e.action(t,n)})},m.prototype.dispatchSync=function(t){this.action(t,m.slice(arguments,1))},m.prototype.clear=function(){this.Events={}},m.prototype.bindEvent=function(t,e,n,i){if("string"!=typeof t||"function"!=typeof e)throw new Error("传入的事件名称和回调函数有误!");return m.hasOwnKey(this.Events,t)||(this.Events[t]={}),this.Events[t][++this.__cnt]=[e,n,i],[t,this.__cnt]},m.prototype.eachEvent=function(t,e){for(var n in t)m.hasOwnKey(t,n)&&e(n,t[n])};function C(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function v(n){var i=0;return n&&Array.isArray(n)&&0<n.length&&n.forEach(function(t,e){e<n.length-1&&(i+=C(t,n[e+1]))}),i}function y(t){return Math.pow(v(t),.99)}function A(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}function w(t,e,n){var i=[(t[0]+e[0])/2,(t[1]+e[1])/2],o=[i[0]-t[1]+e[1],i[1]+t[0]-e[0]],n=[(e=[(t[0]+n[0])/2,(t[1]+n[1])/2])[0]-t[1]+n[1],e[1]+t[0]-n[0]];return G(i,o,e,n)}function M(t,e){var n,i=Math.asin(Math.abs(e[1]-t[1])/C(t,e));return e[1]>=t[1]&&e[0]>=t[0]?n=i+Math.PI:e[1]>=t[1]&&e[0]<t[0]?n=2*Math.PI-i:e[1]<t[1]&&e[0]<t[0]?n=i:e[1]<t[1]&&e[0]>=t[0]&&(n=Math.PI-i),n}function x(t,e,n){return(n=M(e,t)-M(e,n))<0?n+2*Math.PI:n}function E(t,e,n){return(n[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(n[0]-t[0])}function T(t,e,n,i,o){var r=1-(t=Math.max(Math.min(t,1),0)),s=t*t,a=s*t,h=r*r,l=h*r;return[l*e[0]+3*h*t*n[0]+3*r*s*i[0]+a*o[0],l*e[1]+3*h*t*n[1]+3*r*s*i[1]+a*o[1]]}function b(t,e,n,i,o){return t=M(t,e),t=o?t+n:t-n,n=i*Math.cos(t),t=i*Math.sin(t),[e[0]+n,e[1]+t]}function F(t,e,n,i){for(var o=[],r=(r=i-n)<0?r+2*Math.PI:r,s=0;s<=100;s++){var a=n+r*s/100,h=t[0]+e*Math.cos(a),a=t[1]+e*Math.sin(a);o.push([h,a])}return o}function _(t,e,n,i){var o=j(e,n,i),r=null,s=null,a=null,h=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/h,u=o[1]/h,c=C(e,n),o=C(n,i),s=R<h?E(e,n,i)?(r=[n[0]-(a=t*c)*u,n[1]+a*l],[n[0]+(a=t*o)*u,n[1]-a*l]):(r=[n[0]+(a=t*c)*u,n[1]-a*l],[n[0]-(a=t*o)*u,n[1]+a*l]):(r=[n[0]+t*(e[0]-n[0]),n[1]+t*(e[1]-n[1])],[n[0]+t*(i[0]-n[0]),n[1]+t*(i[1]-n[1])]);return[r,s]}function I(t,e){for(var n=null,i=null,o=[(f=t,h=[(l=e)[0],l[1],l[2],null,null],m=h[3],v=h[4],g=_(0,P=h[0],d=h[1],p=h[2])[0],c=j(P,d,p),u=Math.sqrt(c[0]*c[0]+c[1]*c[1]),v=R<u?(l=A(P,d),h=P[0]-l[0],p=P[1]-l[1],c=2/C(P,d),u=g[0]-l[0],g=g[1]-l[1],m=l[0]+((p=-c*p)*p-(c=c*h)*c)*u+(h=2*p*c)*g,l[1]+h*u+(c*c-p*p)*g):(m=P[0]+f*(d[0]-P[0]),P[1]+f*(d[1]-P[1])),[m,v])],r=[],s=0;s<e.length-2;s++)var a=[e[s],e[s+1],e[s+2]],a=_(t,n=a[0],i=a[1],a[2]),o=o.concat(a);var h,l,u,c,p,g,f,d,P,m,v=(l=t,u=(h=e).length,c=h[u-3],p=h[u-2],g=h[u-1],f=_(0,c,p,g)[1],d=j(c,p,g),P=Math.sqrt(d[0]*d[0]+d[1]*d[1]),v=m=null,v=R<P?(h=A(p,g),u=g[0]-h[0],c=g[1]-h[1],d=2/C(p,g),P=f[0]-h[0],f=f[1]-h[1],m=h[0]+((c=-d*c)*c-(d=d*u)*d)*P+(u=2*c*d)*f,h[1]+u*P+(d*d-c*c)*f):(m=g[0]+l*(p[0]-g[0]),g[1]+l*(p[1]-g[1])),[m,v]);o.push(v);for(var y=0;y<e.length-1;y++){n=e[y],i=e[y+1],r.push(n);for(var w=0;w<L;w++){var M=T(w/L,n,o[2*y],o[2*y+1],i);r.push(M)}r.push(i)}return r}function k(t){if(t.length<=2)return t;for(var e=[],n=t.length-1,i=0;i<=1;i+=.01){for(var o=0,r=0,s=0;s<=n;s++){var a=Y(n,s),h=Math.pow(i,s),l=Math.pow(1-i,n-s);o+=a*h*l*t[s][0],r+=a*h*l*t[s][1]}e.push([o,r])}return e.push(t[n]),e}function D(t){var e=1;switch(t){case t<=1:e=1;break;case 2===t:e=2;break;case 3===t:e=6;break;case 24===t:e=24;break;case 5===t:e=120;break;default:for(var n=1;n<=t;n++)e*=n}return e}function S(t){if(t.length<=2)return t;var e=[],n=t.length-2-1;e.push(t[0]);for(var i=0;i<=n;i++)for(var o=0;o<=1;o+=.05){for(var r=0,s=0,a=0;a<=2;a++){var h=U(a,o);r+=h*t[i+a][0],s+=h*t[i+a][1]}e.push([r,s])}return e.push(t[t.length-1]),e}function H(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function O(t,e){for(var n in e)H(e[n])&&H(t[n])?O(t[n],e[n]):t[n]=e[n];return t}var L=100,N=Math.PI/2,R=1e-4,W="ol-plot-vector-layer",z="plot-helper-control-point-div",B="plot-helper-hidden-div",V={borderRadius:"2px",fontSize:"12px",outline:0,overflow:"hidden",boxSizing:"border-box",border:"1px solid #eeeeee",fontFamily:"Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Noto Sans CJK SC,WenQuanYi Micro Hei,Arial,sans-serif",color:"#010500",fontWeight:400,padding:"3px",fontStretch:"normal",lineHeight:"normal",textAlign:"left",marginLeft:"auto",marginRight:"auto",width:"auto",height:"auto",background:"rgb(255, 255, 255)",fontStyle:"",fontVariant:""},G=function(t,e,n,i){if(t[1]===e[1])return[(i[0]-n[0])/(i[1]-n[1])*(t[1]-n[1])+n[0],t[1]];if(n[1]===i[1])return[(e[0]-t[0])/(e[1]-t[1])*(n[1]-t[1])+t[0],n[1]];e=(e[0]-t[0])/(e[1]-t[1]),i=(i[0]-n[0])/(i[1]-n[1]),i=(e*t[1]-t[0]-i*n[1]+n[0])/(e-i);return[e*i-e*t[1]+t[0],i]},j=function(t,e,n){var i=t[0]-e[0],o=t[1]-e[1],t=Math.sqrt(i*i+o*o);i/=t,o/=t;t=n[0]-e[0],n=n[1]-e[1],e=Math.sqrt(t*t+n*n);return[i+(t/=e),o+(n/=e)]},Y=function(t,e){return D(t)/(D(e)*D(t-e))},U=function(t,e){var n=0;return 0===t?n=Math.pow(e-1,2)/2:1===t?n=(-2*Math.pow(e,2)+2*e+1)/2:2===t&&(n=Math.pow(e,2)/2),n};function q(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e))})}function X(t,e){try{var n,i=null;return t&&(n=t.getLayers().getArray(),i=K(n,"layerName",e)),i}catch(t){console.log(t)}}function Z(t,e,n){try{if(t){var i,o=X(t,e);return(o=!(o instanceof a.Vector)?null:o)||n&&n.create&&(o=new a.Vector({layerName:e,params:n,layerType:"vector",source:new h.Vector({wrapX:!1}),style:new l.Style({fill:new l.Fill({color:"rgba(67, 110, 238, 0.4)"}),stroke:new l.Stroke({color:"#4781d9",width:2}),image:new l.Circle({radius:7,fill:new l.Fill({color:"#ffcc33"})})})})),t&&o&&(n&&n.hasOwnProperty("selectable")&&o.set("selectable",n.selectable),(i=X(t,e))&&i instanceof a.Vector||t.addLayer(o)),o}}catch(t){console.log(t)}}var K=function n(t,i,o){var r=null;return 0<t.length&&t.every(function(t){if(t instanceof a.Group){var e=t.getLayers().getArray();return!(r=n(e,i,o))}return t.get(i)!==o||(r=t,!1)}),r};function Q(t){return"string"==typeof t?document.getElementById(t):t}var e,J=(function(t,e){!function(t,e){var p=typeof Map==="function"?new Map:function(){var i=[];var o=[];return{has:function t(e){return i.indexOf(e)>-1},get:function t(e){return o[i.indexOf(e)]},set:function t(e,n){if(i.indexOf(e)===-1){i.push(e);o.push(n)}},delete:function t(e){var n=i.indexOf(e);if(n>-1){i.splice(n,1);o.splice(n,1)}}}}(),g=function t(e){return new Event(e,{bubbles:true})};try{new Event("test")}catch(t){g=function t(e){var n=document.createEvent("Event");n.initEvent(e,true,false);return n}}function i(o){if(!o||!o.nodeName||o.nodeName!=="TEXTAREA"||p.has(o))return;var n=null;var i=null;var r=null;function t(){var t=window.getComputedStyle(o,null);if(t.resize==="vertical")o.style.resize="none";else if(t.resize==="both")o.style.resize="horizontal";if(t.boxSizing==="content-box")n=-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom));else n=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);if(isNaN(n))n=0;l()}function s(t){{var e=o.style.width;o.style.width="0px";o.offsetWidth;o.style.width=e}o.style.overflowY=t}function a(t){var e=[];while(t&&t.parentNode&&t.parentNode instanceof Element){if(t.parentNode.scrollTop)e.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop});t=t.parentNode}return e}function h(){if(o.scrollHeight===0)return;var t=a(o);var e=document.documentElement&&document.documentElement.scrollTop;o.style.height="";o.style.height=o.scrollHeight+n+"px";i=o.clientWidth;t.forEach(function(t){t.node.scrollTop=t.scrollTop});if(e)document.documentElement.scrollTop=e}function l(){h();var t=Math.round(parseFloat(o.style.height));var e=window.getComputedStyle(o,null);var n=e.boxSizing==="content-box"?Math.round(parseFloat(e.height)):o.offsetHeight;if(n<t){if(e.overflowY==="hidden"){s("scroll");h();n=e.boxSizing==="content-box"?Math.round(parseFloat(window.getComputedStyle(o,null).height)):o.offsetHeight}}else if(e.overflowY!=="hidden"){s("hidden");h();n=e.boxSizing==="content-box"?Math.round(parseFloat(window.getComputedStyle(o,null).height)):o.offsetHeight}if(r!==n){r=n;var i=g("autosize:resized");try{o.dispatchEvent(i)}catch(t){}}}var u=function t(){if(o.clientWidth!==i)l()};var c=function(e){window.removeEventListener("resize",u,false);o.removeEventListener("input",l,false);o.removeEventListener("keyup",l,false);o.removeEventListener("autosize:destroy",c,false);o.removeEventListener("autosize:update",l,false);Object.keys(e).forEach(function(t){o.style[t]=e[t]});p.delete(o)}.bind(o,{height:o.style.height,resize:o.style.resize,overflowY:o.style.overflowY,overflowX:o.style.overflowX,wordWrap:o.style.wordWrap});o.addEventListener("autosize:destroy",c,false);if("onpropertychange"in o&&"oninput"in o)o.addEventListener("keyup",l,false);window.addEventListener("resize",u,false);o.addEventListener("input",l,false);o.addEventListener("autosize:update",l,false);o.style.overflowX="hidden";o.style.wordWrap="break-word";p.set(o,{destroy:c,update:l});t()}function n(t){var e=p.get(t);if(e)e.destroy()}function o(t){var e=p.get(t);if(e)e.update()}var r=null;if(typeof window==="undefined"||typeof window.getComputedStyle!=="function"){r=function t(e){return e};r.destroy=function(t){return t};r.update=function(t){return t}}else{r=function t(e,n){if(e)Array.prototype.forEach.call(e.length?e:[e],function(t){return i(t)});return e};r.destroy=function(t){if(t)Array.prototype.forEach.call(t.length?t:[t],n);return t};r.update=function(t){if(t)Array.prototype.forEach.call(t.length?t:[t],o);return t}}e.default=r,t.exports=e["default"]}(t,e)}(e={exports:{}},e.exports),e.exports),$=/([\:\-\_]+(.))/g,tt=/^moz([A-Z])/,et=function(t){return t.replace($,function(t,e,n,i){return i?n.toUpperCase():n}).replace(tt,"Moz$1")},nt=function(){if(document.addEventListener)return function(t,e,n){t&&e&&n&&t.addEventListener(e,n,!1)}}(),it=function(){if(document.removeEventListener)return function(t,e,n){t&&e&&t.removeEventListener(e,n,!1)}}();function ot(t,e,n){if(t&&e)if("object"==typeof e)for(var i in e)e.hasOwnProperty(i)&&ot(t,i,e[i]);else"opacity"===(e=et(e))?t.style.filter=isNaN(n)?"":"alpha(opacity="+100*n+")":t.style[e]=n}var rt,st=function(o){function t(t){var e=[(t=void 0===t?{}:t).id,t.element,t.offset,t.stopEvent,t.positioning,t.insertFirst,t.autoPan,t.autoPanAnimation,t.autoPanMargin,t.className||"ol-plot-text-editor"],n=e[2],i=e[4];return(e=o.call(this,{id:e[0],element:e[1],stopEvent:e[3],insertFirst:e[5],autoPan:e[6],autoPanAnimation:e[7],autoPanMargin:e[8],className:e[9]})||this).setOffset(void 0!==n?n:[0,0]),e.setPositioning(void 0!==i?i:"center-center"),e.mapDragPan=void 0,e.isClick_=!1,e.dragging_=!1,e.isFocus_=!1,e.options_=t,e._position=t.position&&0<t.position.length?t.position:[],e.handleTimer_=null,e.currentPixel_=[],q(["handleFocus_","handleBlur_","handleClick_","handleDragStart_","handleDragEnd_","handleDragDrag_","closeCurrentPlotText","handleResizeMouseDown_","handleResizeMouseMove_","handleResizeMouseUp_","resizeButtonMoveHandler_"],P(e)),e.createTextContent(t),e}d(t,o);var e=t.prototype;return e.createTextContent=function(t){var e=t.className||"ol-plot-text-editor",n=document.createElement("textarea");n.className=e,n.style.width=t.width+"px",n.style.height=t.height+"px",n.style.minHeight=t.minHeight+"px",n.setAttribute("id",t.id),n.setAttribute("autofocus",!0),J(n),nt(n,"focus",this.handleFocus_),nt(n,"blur",this.handleBlur_),nt(n,"click",this.handleClick_),nt(n,"mousedown",this.handleDragStart_),nt(window,"mouseup",this.handleDragEnd_),this.set("isPlotText",!0),this.setElement(n),this.createCloseButton(t),this.createResizeButton(t),this.setPosition(this._position),this.dispatchEvent("textBoxDrawEnd",{overlay:this,element:n,uuid:t.id})},e.getTextAreaFromContent_=function(){var e="",t=Array.prototype.slice.call(this.element&&this.element.children,0);return 0<t.length&&t.every(function(t){return 1!==t.nodeType||"textarea"!==t.nodeName.toLowerCase()||(e=t,!1)}),e},e.createCloseButton=function(t){var e=document.createElement("span");e.className="ol-plot-text-editor-close",e.setAttribute("data-id",t.id),it(e,"click",this.closeCurrentPlotText),nt(e,"click",this.closeCurrentPlotText),this.element.appendChild(e)},e.createResizeButton=function(t){var e=document.createElement("span");e.className="ol-plot-text-editor-resize",e.setAttribute("data-id",t.id),it(e,"mousedown",this.handleResizeMouseDown_),it(e,"mousemove",this.handleResizeMouseMove_),nt(e,"mousedown",this.handleResizeMouseDown_),nt(e,"mousemove",this.handleResizeMouseMove_),this.element.appendChild(e)},e.resizeButtonMoveHandler_=function(t){var e,n,i=t.pixel,o=this.getTextAreaFromContent_();i.length<1||this.currentPixel_.length<1||!o||(e=[i[0]-this.currentPixel_[0],i[1]-this.currentPixel_[1]],t=(n=[o.offsetWidth,o.offsetHeight])[1]+2*e[1],ot(o,"width",n[0]+2*e[0]+"px"),ot(o,"height",t+"px"),this.currentPixel_=i,this.getMap().render())},e.handleResizeMouseMove_=function(t){t.stopImmediatePropagation()},e.handleResizeMouseDown_=function(t){this.getMap()&&(this.currentPixel_=[t.x,t.y],this.getMap().on("pointermove",this.resizeButtonMoveHandler_),nt(this.getMap().getViewport(),"mouseup",this.handleResizeMouseUp_))},e.handleResizeMouseUp_=function(t){this.getMap()&&(this.getMap().un("pointermove",this.resizeButtonMoveHandler_),it(this.getMap().getViewport(),"mouseup",this.handleResizeMouseUp_),this.currentPixel_=[])},e.closeCurrentPlotText=function(t){this.getMap()&&t&&function(t,e){if(t&&e){if(-1!==e.indexOf(" "))throw new Error("className should not contain space.");return t.classList?t.classList.contains(e):-1<(" "+t.className+" ").indexOf(" "+e+" ")}}(t.target,"ol-plot-text-editor-close")&&(!(t=t.target.getAttribute("data-id"))||(t=this.getMap().getOverlayById(t))&&this.getMap().removeOverlay(t))},e.handleFocus_=function(){this.isFocus_=!0,this.getMap()&&(this.getMap().set("activeTextArea",this),this.getMap().dispatchEvent("activeTextArea"))},e.handleBlur_=function(){this.isFocus_=!1,this.getMap()&&(this.getMap().set("activeTextArea",null),this.getMap().set("disActiveTextArea",this),this.getMap().dispatchEvent("disActiveTextArea"))},e.handleDragStart_=function(t){var e=this;this.getMap()&&!this.dragging_&&this.isMoveModel()&&this.isFocus_&&(this.handleTimer_=window.setTimeout(function(){window.clearTimeout(e.handleTimer_),e.handleTimer_=null,e.isClick_||(e.dragging_=!0,e.disableMapDragPan(),e.preCursor_=e.element.style.cursor,nt(e.getMap().getViewport(),"mousemove",e.handleDragDrag_),nt(e.element,"mouseup",e.handleDragEnd_))},300))},e.handleDragDrag_=function(t){this.dragging_&&(this.element.style.cursor="move",this._position=this.getMap().getCoordinateFromPixel([t.clientX,t.clientY]),this.setPosition(this._position))},e.handleDragEnd_=function(t){this.isClick_=!1,window.clearTimeout(this.handleTimer_),this.handleTimer_=null,this.dragging_&&this.isFocus_&&(this.dragging_=!1,this.enableMapDragPan(),this.element.style.cursor=this.preCursor_,it(this.getMap().getViewport(),"mousemove",this.handleDragDrag_),it(this.element,"mouseup",this.handleDragEnd_))},e.handleClick_=function(t){t.target===this.element?this.isClick_=!0:this.isClick_=!1},e.isMoveModel=function(){return window.getSelection().getRangeAt(0).collapsed},e.setStyle=function(t){void 0===t&&(t={});var e=this.getTextAreaFromContent_();if(e)for(var n in t)t[n]&&ot(e,n,t[n])},e.getStyle=function(){var t={},e=this.getTextAreaFromContent_();if(e)for(var n in V)t[n]=function(e,n){if(!e||!n)return null;"float"===(n=et(n))&&(n="cssFloat");try{var t=document.defaultView.getComputedStyle(e,"");return e.style[n]||t?t[n]:null}catch(t){return e.style[n]}}(e,n);return t},e.setValue=function(t){var e=this.getTextAreaFromContent_();e&&((e.value=t)&&J.update(e),this.getMap().render())},e.getValue=function(){var t=this.getTextAreaFromContent_();return t?t.value:""},e.getWidth=function(){var t=this.getTextAreaFromContent_();return t&&t.offsetWidth?t.offsetWidth:0},e.getHeight=function(){var t=this.getTextAreaFromContent_();return t&&t.offsetHeight?t.offsetHeight:0},e.enableMapDragPan=function(){var t=this.getMap();t&&this.mapDragPan&&this.mapDragPan instanceof r.DragPan&&(t.addInteraction(this.mapDragPan),delete this.mapDragPan)},e.disableMapDragPan=function(){var e=this,n=this.getMap();n&&n.getInteractions().getArray().every(function(t){return!(t instanceof r.DragPan)||(e.mapDragPan=t,n.removeInteraction(t),!1)})},e.setMap=function(t){o.prototype.setMap.call(this,t),t&&t instanceof s.Map&&(this.setStyle(O(V,this.options_.style)),this.setValue(this.options_.value))},t}(s.Overlay),at="TextArea",ht="Curve",lt="GatheringPlace",ut="Polyline",ct="FreeHandLine",pt="Point",gt="Pennant",ft="RectAngle",dt="Circle",Pt="Ellipse",mt="Lune",vt="Sector",yt="ClosedCurve",wt="Polygon",Mt="FreePolygon",Ct="AttackArrow",At="DoubleArrow",xt="StraightArrow",Et="FineArrow",Tt="AssaultDirection",bt="TailedAttackArrow",Ft="SquadCombat",_t="TailedSquadCombat",It="RectFlag",kt="TriangleFlag",Dt="CurveFlag",St=Object.freeze({__proto__:null,TEXTAREA:at,ARC:"Arc",CURVE:ht,GATHERING_PLACE:lt,POLYLINE:ut,FREEHANDLINE:ct,POINT:pt,PENNANT:gt,RECTANGLE:ft,CIRCLE:dt,ELLIPSE:Pt,LUNE:mt,SECTOR:vt,CLOSED_CURVE:yt,POLYGON:wt,FREE_POLYGON:Mt,ATTACK_ARROW:Ct,DOUBLE_ARROW:At,STRAIGHT_ARROW:xt,FINE_ARROW:Et,ASSAULT_DIRECTION:Tt,TAILED_SQUAD_COMBAT:_t,TAILED_ATTACK_ARROW:bt,SQUAD_COMBAT:Ft,RECTFLAG:It,TRIANGLEFLAG:kt,CURVEFLAG:Dt}),Ht=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=pt,i.options=n||{},i.set("params",i.options),i.fixPointCount=1,e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t=this.points[0];this.setCoordinates(t)},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Point),Ot=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=gt,i.options=n||{},i.set("params",i.options),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){this.setCoordinates(this.points)},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Point),Lt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=ut,i.freehand=!1,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){this.setCoordinates(this.points)},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.LineString),Nt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type="Arc",i.fixPointCount=3,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t,e,n,i,o,r,s,a,h=this.getPointCount();h<2||(2===h?this.setCoordinates(this.points):(i=(s=[this.points[0],this.points[1],this.points[2],null,null])[3],a=s[4],o=w(t=s[0],e=s[1],n=s[2]),r=C(t,o),h=M(t,o),s=M(e,o),a=E(t,e,n)?(i=s,h):(i=h,s),this.setCoordinates(F(o,r,i,a))))},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.LineString),Rt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=dt,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;var t=this.points[0],e=C(t,this.points[1]);this.setCoordinates([this.generatePoints(t,e)])},e.generatePoints=function(t,e){for(var n,i,o,r=[],s=0;s<=100;s++)o=2*Math.PI*s/100,n=t[0]+e*Math.cos(o),i=t[1]+e*Math.sin(o),r.push([n,i]);return r},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Wt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=ht,i.t=.3,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t=this.getPointCount();if(t<2)return!1;2===t?this.setCoordinates(this.points):(t=I(this.t,this.points),this.setCoordinates(t))},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.LineString),zt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=ct,i.freehand=!0,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){this.setCoordinates(this.points)},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.LineString),Bt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=ft,i.fixPointCount=2,i.set("params",n),i.isFill=!1!==n.isFill||n.isFill,e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t,e,n;2===this.points.length&&(t=[],t=this.isFill?(n=p.boundingExtent(this.points),i.fromExtent(n).getCoordinates()):(e=this.points[0],n=this.points[1],[e,[e[0],n[1]],n,[n[0],e[1]],e]),this.setCoordinates(t))},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Vt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=Pt,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;var t=[this.points[0],this.points[1]],e=t[0],n=t[1],i=A(e,n),t=Math.abs((e[0]-n[0])/2),n=Math.abs((e[1]-n[1])/2),n=this.generatePoints(i,t,n);this.setCoordinates([n])},e.generatePoints=function(t,e,n){for(var i,o,r,s=[],a=0;a<=L;a++)r=2*Math.PI*a/L,i=t[0]+e*Math.cos(r),o=t[1]+n*Math.sin(r),s.push([i,o]);return s},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Gt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=mt,i.fixPointCount=3,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;var t=this.getPoints();2===this.getPointCount()&&(a=A(t[0],t[1]),h=C(t[0],a),l=b(t[0],a,N,h),t.push(l));var e=[t[0],t[1],t[2],void 0,void 0],n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=w(n,i,o),h=C(n,a),l=M(n,a),e=M(i,a),s=E(n,i,o)?(r=e,l):(r=l,e);(t=F(a,h,r,s)).push(t[0]),this.setCoordinates([t])},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),jt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=vt,i.fixPointCount=3,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t,e,n,i=this.getPointCount();if(i<2)return!1;2===i?this.setCoordinates([this.points]):(n=(e=[(t=this.getPoints())[0],t[1],t[2]])[2],e=C(i=e[1],t=e[0]),i=M(i,t),n=M(n,t),(n=F(t,e,i,n)).push(t,n[0]),this.setCoordinates([n]))},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Yt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=yt,i.t=.3,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t=this.getPointCount();if(t<2)return!1;if(2===t)this.setCoordinates([this.points]);else{var e=this.getPoints();e.push(e[0],e[1]);for(var n=[],i=[],o=0;o<e.length-2;o++)var r=_(this.t,e[o],e[o+1],e[o+2]),n=n.concat(r);t=n.length;n=[n[t-1]].concat(n.slice(0,t-1));for(var s=0;s<e.length-2;s++){var a=e[s],h=e[s+1];i.push(a);for(var l=0;l<=L;l++){var u=T(l/L,a,n[2*s],n[2*s+1],h);i.push(u)}i.push(h)}this.setCoordinates([i])}},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Ut=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=wt,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;this.setCoordinates([this.points])},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),qt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=Mt,i.freehand=!0,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){this.setCoordinates([this.points])},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Xt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=Ct,i.headHeightFactor=.18,i.headWidthFactor=.3,i.neckHeightFactor=.85,i.neckWidthFactor=.15,i.headTailFactor=.8,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){try{var t,e,n,i,o,r,s,a,h,l,u,c,p,g,f=this.getPointCount();if(f<2)return!1;2===f?this.setCoordinates([this.points]):(n=(e=[(t=this.getPoints())[0],t[1]])[0],i=e[1],E(t[0],t[1],t[2])&&(n=t[1],i=t[0]),o=[A(n,i)].concat(t.slice(2)),a=(s=[(r=this.getArrowHeadPoints(o,n,i))[0],r[4]])[0],h=s[1],l=C(n,i)/y(o),c=(u=this.getArrowBodyPoints(o,a,h,l)).length,(p=[n].concat(u.slice(0,c/2))).push(a),(g=[i].concat(u.slice(c/2,c))).push(h),p=S(p),g=S(g),this.setCoordinates([p.concat(r,g.reverse())]))}catch(t){console.log(t)}},e.getArrowPoints=function(t,e,n,i){var o=A(t,e),r=C(o,n),s=b(n,o,0,.3*r,!0),a=b(n,o,0,.5*r,!0),s=[o,s=b(o,s,N,r/5,i),a=b(o,a,N,r/4,i),n],o=this.getArrowHeadPoints(s);if(!(o&&Array.isArray(o)&&0<o.length))throw new Error("插值出错");r=[o[0],o[4]],i=r[0],a=r[1],n=C(t,e)/y(s)/2,r=this.getArrowBodyPoints(s,i,a,n);if(r){s=r.length,n=r.slice(0,s/2),s=r.slice(s/2,s);return n.push(i),s.push(a),(n=n.reverse()).push(e),(s=s.reverse()).push(t),n.reverse().concat(o,s)}},e.getArrowHeadPoints=function(t,e,n){try{var i=(r=y(t))*this.headHeightFactor,o=t[t.length-1],r=C(o,t[t.length-2]),s=C(e,n),a=(i=i>s*this.headTailFactor?s*this.headTailFactor:i)*this.headWidthFactor,h=i*this.neckWidthFactor,l=(i=r<i?r:i)*this.neckHeightFactor,u=b(t[t.length-2],o,0,i,!0),c=b(t[t.length-2],o,0,l,!0),p=b(o,u,N,a,!1),g=b(o,u,N,a,!0);return[b(o,c,N,h,!1),p,o,g,b(o,c,N,h,!0)]}catch(t){console.log(t)}},e.getArrowBodyPoints=function(t,e,n,i){for(var o=v(t),r=y(t)*i,s=(r-C(e,n))/2,a=0,h=[],l=[],u=1;u<t.length-1;u++){var c=x(t[u-1],t[u],t[u+1])/2,p=(r/2-(a+=C(t[u-1],t[u]))/o*s)/Math.sin(c),g=b(t[u-1],t[u],Math.PI-c,p,!0),p=b(t[u-1],t[u],c,p,!1);h.push(g),l.push(p)}return h.concat(l)},e.getTempPoint4=function(t,e,n){try{var i=A(t,e),o=C(i,n),r=x(t,i,n),s=void 0,a=void 0,h=void 0;return r<N?(s=o*Math.sin(r),a=o*Math.cos(r),h=b(t,i,N,s,!1),b(i,h,N,a,!0)):N<=r&&r<Math.PI?(s=o*Math.sin(Math.PI-r),a=o*Math.cos(Math.PI-r),h=b(t,i,N,s,!1),b(i,h,N,a,!1)):r>=Math.PI&&r<1.5*Math.PI?(s=o*Math.sin(r-Math.PI),a=o*Math.cos(r-Math.PI),h=b(t,i,N,s,!0),b(i,h,N,a,!0)):(s=o*Math.sin(2*Math.PI-r),a=o*Math.cos(2*Math.PI-r),h=b(t,i,N,s,!0),b(i,h,N,a,!1))}catch(t){console.log(t)}},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Zt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=At,i.headHeightFactor=.25,i.headWidthFactor=.3,i.neckHeightFactor=.85,i.neckWidthFactor=.15,i.connPoint=null,i.tempPoint4=null,i.fixPointCount=4,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){try{var t,e,n,i,o,r,s,a,h,l,u,c,p,g,f,d,P=this.getPointCount();if(P<2)return!1;if(2===P)return this.setCoordinates([this.points]),!1;2<P&&(e=(t=[this.points[0],this.points[1],this.points[2]])[0],n=t[1],i=t[2],3===P?(this.tempPoint4=this.getTempPoint4(e,n,i),this.connPoint=A(e,n)):4===P?(this.tempPoint4=this.points[3],this.connPoint=A(e,n)):(this.tempPoint4=this.points[3],this.connPoint=this.points[4]),r=o=void 0,r=E(e,n,i)?(o=this.getArrowPoints(e,this.connPoint,this.tempPoint4,!1),this.getArrowPoints(this.connPoint,n,i,!0)):(o=this.getArrowPoints(n,this.connPoint,i,!1),this.getArrowPoints(this.connPoint,e,this.tempPoint4,!0)),a=((s=o.length)-5)/2,h=o.slice(0,a),l=o.slice(a,5+a),f=o.slice(5+a,s),p=r.slice(0,a),u=r.slice(a,5+a),c=r.slice(5+a,s),p=k(p),g=k(c.concat(h.slice(1))),f=k(f),d=p.concat(u,g,l,f),this.setCoordinates([d]))}catch(t){console.log(t)}},e.getArrowPoints=function(t,e,n,i){var o=A(t,e),r=C(o,n),s=b(n,o,0,.3*r,!0),a=b(n,o,0,.5*r,!0),s=[o,s=b(o,s,N,r/5,i),a=b(o,a,N,r/4,i),n],o=this.getArrowHeadPoints(s);if(!(o&&Array.isArray(o)&&0<o.length))throw new Error("插值出错");r=[o[0],o[4]],i=r[0],a=r[1],n=C(t,e)/y(s)/2,r=this.getArrowBodyPoints(s,i,a,n);if(r){s=r.length,n=r.slice(0,s/2),s=r.slice(s/2,s);return n.push(i),s.push(a),(n=n.reverse()).push(e),(s=s.reverse()).push(t),n.reverse().concat(o,s)}},e.getArrowHeadPoints=function(t){try{var e=y(t)*this.headHeightFactor,n=t[t.length-1],i=e*this.headWidthFactor,o=e*this.neckWidthFactor,r=e*this.neckHeightFactor,s=b(t[t.length-2],n,0,e,!0),a=b(t[t.length-2],n,0,r,!0),h=b(n,s,N,i,!1),l=b(n,s,N,i,!0);return[b(n,a,N,o,!1),h,n,l,b(n,a,N,o,!0)]}catch(t){console.log(t)}},e.getArrowBodyPoints=function(t,e,n,i){for(var o=v(t),r=y(t)*i,s=(r-C(e,n))/2,a=0,h=[],l=[],u=1;u<t.length-1;u++){var c=x(t[u-1],t[u],t[u+1])/2,p=(r/2-(a+=C(t[u-1],t[u]))/o*s)/Math.sin(c),g=b(t[u-1],t[u],Math.PI-c,p,!0),p=b(t[u-1],t[u],c,p,!1);h.push(g),l.push(p)}return h.concat(l)},e.getTempPoint4=function(t,e,n){try{var i=A(t,e),o=C(i,n),r=x(t,i,n),s=void 0,a=void 0,h=void 0;return r<N?(s=o*Math.sin(r),a=o*Math.cos(r),h=b(t,i,N,s,!1),b(i,h,N,a,!0)):N<=r&&r<Math.PI?(s=o*Math.sin(Math.PI-r),a=o*Math.cos(Math.PI-r),h=b(t,i,N,s,!1),b(i,h,N,a,!1)):r>=Math.PI&&r<1.5*Math.PI?(s=o*Math.sin(r-Math.PI),a=o*Math.cos(r-Math.PI),h=b(t,i,N,s,!0),b(i,h,N,a,!0)):(s=o*Math.sin(2*Math.PI-r),a=o*Math.cos(2*Math.PI-r),h=b(t,i,N,s,!0),b(i,h,N,a,!1))}catch(t){console.log(t)}},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){3===this.getPointCount()&&null!==this.tempPoint4&&this.points.push(this.tempPoint4),null!==this.connPoint&&this.points.push(this.connPoint)},t}(c.Polygon),Kt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=xt,i.fixPointCount=2,i.maxArrowLength=3e6,i.arrowLengthScale=5,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){try{if(this.getPointCount()<2)return!1;var t=this.getPoints(),e=[t[0],t[1]],n=e[0],i=e[1],o=(o=C(n,i)/this.arrowLengthScale)>this.maxArrowLength?this.maxArrowLength:o,r=b(n,i,Math.PI/6,o,!1),s=b(n,i,Math.PI/6,o,!0);this.setCoordinates([n,i,r,i,s])}catch(t){console.log(t)}},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.LineString),Qt=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=Et,i.tailWidthFactor=.1,i.neckWidthFactor=.2,i.headWidthFactor=.25,i.headAngle=Math.PI/8.5,i.neckAngle=Math.PI/13,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){try{if(this.getPointCount()<2)return!1;var t=this.getPoints(),e=[t[0],t[1]],n=e[0],i=e[1],o=y(t),r=o*this.tailWidthFactor,s=o*this.neckWidthFactor,a=o*this.headWidthFactor,h=b(i,n,N,r,!0),l=b(i,n,N,r,!1),u=b(n,i,this.headAngle,a,!1),c=b(n,i,this.headAngle,a,!0),p=[h,b(n,i,this.neckAngle,s,!1),u,i,c,b(n,i,this.neckAngle,s,!0),l];this.setCoordinates([p])}catch(t){console.log(t)}},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),Jt=(d($t,rt=Qt),$t);function $t(t,e,n){var i=rt.call(this,t,e,n)||this;return i.tailWidthFactor=.05,i.neckWidthFactor=.1,i.headWidthFactor=.15,i.type=Tt,i.headAngle=Math.PI/4,i.neckAngle=.17741*Math.PI,e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i.set("params",n),i}var te,ee=(d(ne,te=Xt),ne.prototype.generate=function(){try{var t=this.getPointCount();if(t<2)return!1;if(2===t)return this.setCoordinates([this.points]),!1;var e=this.getPoints(),n=[e[0],e[1]],i=n[0],o=n[1];E(e[0],e[1],e[2])&&(i=e[1],o=e[0]);var r=[A(i,o)].concat(e.slice(2)),s=this.getArrowHeadPoints(r,i,o),a=[s[0],s[4]],h=a[0],l=a[1],u=C(i,o),c=y(r),p=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=b(r[1],r[0],0,p,!0);var g=u/c,f=this.getArrowBodyPoints(r,h,l,g),d=f.length,P=[i].concat(f.slice(0,d/2));P.push(h);var m=[o].concat(f.slice(d/2,d));m.push(l),P=S(P),m=S(m),this.setCoordinates([P.concat(s,m.reverse(),[this.swallowTailPnt,P[0]])])}catch(t){console.log(t)}},ne);function ne(t,e,n){var i=te.call(this,t,e,n)||this;return i.type=bt,i.headHeightFactor=.18,i.headWidthFactor=.3,i.neckHeightFactor=.85,i.neckWidthFactor=.15,i.tailWidthFactor=.1,i.headTailFactor=.8,i.swallowTailFactor=1,i.swallowTailPnt=null,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}function ie(t){var e=t&&"object"==typeof t?t:{},t=new l.Style({});return e.geometry&&e.geometry instanceof c.Geometry&&t.setGeometry(e.geometry),e.zIndex&&"number"==typeof e.zIndex&&t.setZIndex(e.zIndex),e.fill&&"object"==typeof e.fill&&t.setFill(this._getFill(e.fill)),e.image&&"object"==typeof e.image&&t.setImage(this._getImage(e.image)),e.stroke&&"object"==typeof e.stroke&&t.setStroke(this._getStroke(e.stroke)),e.text&&"object"==typeof e.text&&t.setText(this._getText(e.text)),t}var oe=function(o){function t(t,e,n){var i=o.call(this,t,e,n)||this;return i.type=Ft,i.headHeightFactor=.18,i.headWidthFactor=.3,i.neckHeightFactor=.85,i.neckWidthFactor=.15,i.tailWidthFactor=.1,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.generate=function(){try{if(this.getPointCount()<2)return!1;var t=this.getPoints(),e=this.getTailPoints(t),n=this.getArrowHeadPoints(t,e[0],e[1]),i=n[0],o=n[4],r=this.getArrowBodyPoints(t,i,o,this.tailWidthFactor),s=r.length,a=[e[0]].concat(r.slice(0,s/2));a.push(i);var h=[e[1]].concat(r.slice(s/2,s));h.push(o),a=S(a),h=S(h),this.setCoordinates([a.concat(n,h.reverse())])}catch(t){console.log(t)}},e.getTailPoints=function(t){var e=y(t)*this.tailWidthFactor;return[b(t[1],t[0],N,e,!1),b(t[1],t[0],N,e,!0)]},t}(Xt),re=function(o){function t(t,e,n){var i=o.call(this,t,e,n)||this;return i.type=_t,i.headHeightFactor=.18,i.headWidthFactor=.3,i.neckHeightFactor=.85,i.neckWidthFactor=.15,i.tailWidthFactor=.1,i.swallowTailFactor=1,i.swallowTailPnt=null,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.generate=function(){try{if(this.getPointCount()<2)return!1;var t=this.getPoints(),e=this.getTailPoints(t),n=this.getArrowHeadPoints(t,e[0],e[2]),i=n[0],o=n[4],r=this.getArrowBodyPoints(t,i,o,this.tailWidthFactor),s=r.length,a=[e[0]].concat(r.slice(0,s/2));a.push(i);var h=[e[2]].concat(r.slice(s/2,s));h.push(o),a=S(a),h=S(h),this.setCoordinates([a.concat(n,h.reverse(),[e[1],a[0]])])}catch(t){console.log(t)}},e.getTailPoints=function(t){var e=y(t)*this.tailWidthFactor,n=b(t[1],t[0],N,e,!1),i=b(t[1],t[0],N,e,!0),e=e*this.swallowTailFactor;return[n,b(t[1],t[0],0,e,!0),i]},t}(Xt),se=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=lt,i.t=.4,i.fixPointCount=3,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){var t=this.getPoints(),e=this.getPointCount();if(t.length<2)return!1;2===e&&(e=A(t[0],t[1]),n=C(t[0],e)/.9,n=b(t[0],e,N,n,!0),t=[t[0],n,t[1]]);var n=A(t[0],t[2]);t.push(n,t[0],t[1]);for(var i=[],o=void 0,r=void 0,s=[],a=0;a<t.length-2;a++)var o=t[a],r=t[a+1],h=t[a+2],l=_(this.t,o,r,h),i=i.concat(l);n=i.length;i=[i[n-1]].concat(i.slice(0,n-1));for(var u=0;u<t.length-2;u++){o=t[u],r=t[u+1],s.push(o);for(var c=0;c<=L;c++){var p=T(c/L,o,i[2*u],i[2*u+1],r);s.push(p)}s.push(r)}this.setCoordinates([s])},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),ae=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=It,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;this.setCoordinates([this.calculatePonits(this.points)])},e.calculatePonits=function(t){var e,n=[];return n=1<t.length?[e=t[0],[(t=t[t.length-1])[0],e[1]],[t[0],(e[1]+t[1])/2],[e[0],(e[1]+t[1])/2],[e[0],t[1]]]:n},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),he=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=kt,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;this.setCoordinates([this.calculatePonits(this.points)])},e.calculatePonits=function(t){var e,n=[];return n=1<t.length?[e=t[0],[(t=t[t.length-1])[0],(e[1]+t[1])/2],[e[0],(e[1]+t[1])/2],[e[0],t[1]]]:n},e.setMap=function(t){if(!(t&&t instanceof s.Map))throw new Error("传入的不是地图对象!");this.map=t},e.getMap=function(){return this.map},e.isPlot=function(){return!0},e.setPoints=function(t){this.points=t||[],1<=this.points.length&&this.generate()},e.getPoints=function(){return this.points.slice(0)},e.getPointCount=function(){return this.points.length},e.updatePoint=function(t,e){0<=e&&e<this.points.length&&(this.points[e]=t,this.generate())},e.updateLastPoint=function(t){this.updatePoint(t,this.points.length-1)},e.finishDrawing=function(){},t}(c.Polygon),le=function(o){function t(t,e,n){var i=o.call(this,[])||this;return i.type=Dt,i.fixPointCount=2,i.set("params",n),e&&0<e.length?i.setPoints(e):t&&0<t.length&&i.setCoordinates(t),i}d(t,o);var e=t.prototype;return e.getPlotType=function(){return this.type},e.generate=function(){if(this.getPointCount()<2)return!1;this.setCoordinates([this.calculatePonits(this.points)])},e.calculatePonits=function(t){var e,n,