/*! * * iclient9-plot-leaflet.(http://iclient.supermap.io) * Copyright© 2000 - 2019 SuperMap Software Co.Ltd * version: v9.1.1 * */!function(t){var e={};function i(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(o,s,function(e){return t[e]}.bind(null,s));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){"use strict";i.r(e);var o=window.SuperMap=window.SuperMap||{},s=o.Plot=o.Plot||{},l=(SuperMap.Plot.ArrowTailType={ARROWTAIL_NONE:0,ARROWTAIL_LINE:1,ARROWTAIL_CURVE:2,ARROWTAIL_COATTAIL:3,ARROWTAIL_COATTAIL_POLYBODY:4},SuperMap.Plot.ArrowHeadType={ARROWHEAD_POLYLINE:0,ARROWHEAD_TRIANGLE:1,ARROWHEAD_COATTAIL:2,ARROWHEAD_TRIANGLE_SOLID:3,ARROWHEAD_WITH_EAR:4,ARROWHEAD_WITHOUT_EAR:5,ARROWHEAD_COATTAIL_HOLLOW:6},SuperMap.Plot.ArrowBodyType={ARROWBODY_POLYLINE:0,ARROWBODY_POLYBEZIER:1,ARROWBODY_PARALLEL:2,ARROWBODY_TRAPEZOID:3,ARROWBODY_MULTIPOLYBEZIER:4,ARROWBODY_COATTAIL:5},SuperMap.Plot.SymbolType={DOTSYMBOL:1,ALGOSYMBOL:2,TEXTSYMBOL:34,ELLIPSESYMBOL:31,CIRCLESYMBOL:29,RECTANGLESYMBOL:26,ARBITRARYPOLYGONSYMBOL:32,POLYLINESYMBOL:24,PARALLELOGRAM:28,ARCSYMBOL:44,REGULARPOLYGON:410,CHORDSYMBOL:370,PIESYMBOL:380,KIDNEY:390,POLYBEZIERSYMBOL:590,PARALLELLINE:48,BRACESYMBOL:400,ANNOFRAMESYMBOL:320,ANNOFRAMESYMBOLM:321,TRAPEZOIDSYMBOL:350,POLYBEZIERCLOSESYMBOL:360,GROUPOBJECT:1e3,LINERELATION:1001,INTERFERENCEBEAM:1002,POLYGONREGION:1003,ARCREGION:1004,AIRROUTE:1005,NAVYROUTE:1006,MISSILEROUTE:1007,NAVYDEPLOYMENT:1008,AIRDEPLOYMENT:1009,SATELLITE:1010,SATELLITETIMEWINDOWS:1011,SYMBOLTEXT:1012,RUNWAY:1013,CURVEEIGHT:1014,ROUTENODE:1015,ARROWLINE:1016,PATHTEXT:1017,LITERATESIGN:1018,CONCENTRICCIRCLE:1019,FLAGGROUP:1020,SYMBOLTEXT1:1021,COMBINATIONALCIRCLE:1022,FREECURVE:1023,SYMBOLTEXTBOX:1024,NODECHAIN:1025,LINEMARKING:1026,AVOIDREGION:1027,WIRE:1028}),n=SuperMap.Plot.LineRelationType={SOLID:0,DASH:1,ARROW:2},a=SuperMap.Plot.AlgoSurroundLineType={NONE:0,INNER:1,OUT:2,ALL:3},r=SuperMap.Plot.RouteNodeType={RENDEZVOUS:"RENDEZVOUS",EXPANDING:"EXPANDING",VOLLEY:"VOLLEY",STANDBY:"STANDBY",SUPPLY:"SUPPLY",TAKEOFF:"TAKEOFF",INITIAL:"INITIAL",VISUALINITAL:"VISUALINITAL",LANCH:"LANCH",TURNING:"TURNING",AIMING:"AIMING",COMMONROUTE:"COMMONROUTE",WEAPONLAUNCH:"WEAPONLAUNCH",TARGET:"TARGET",ATTACK:"ATTACK",SUPPRESS:"SUPPRESS",EIGHTSPIRAL:"EIGHTSPIRAL",HAPPYVALLEY:"HAPPYVALLEY"},p=SuperMap.Plot.RelLineText={ONLINE:0,ONLEFTLINE:1,ONRIGHTLINE:2,ONBOTHLINE:3},u=SuperMap.Plot.RadiusLineType={NONE:0,SOLID:1,ARROW:2},h=SuperMap.Plot.AnnoPosition={LEFTTOP:0,LEFTBOTTOM:1,RIGHTTOP:2,RIGHTBOTTOM:3,TOP:4,BOTTOM:5,LEFT:6,RIGHT:7},y=SuperMap.Plot.ArrowLineType={DOUBLELINE:0,TRIANGLESOLID:1,NONE:2},c=SuperMap.Plot.TextBoxType={WITHTIPBOX:0,RECTBOX:1,LINEBOX:2,NONEBOX:3},S=SuperMap.Plot.PositionOffsetType={LINE:0,GRADIENTLINE:1},P=SuperMap.Plot.AlignType={LEFT:0,RIGHT:1,UP:2,DOWN:3,VERTICALCENTER:4,HORIZONTALCENTER:5},g=SuperMap.Plot.EditMode={ADDCONTROLPOINT:0,EDITCONTROLPOINT:1,EDITCIRCUMRECTANGLE:2,REMOVECONTROLPOINT:3};SuperMap.Plot.EqualLargeType={WIDTH:0,HEIGHT:1,SAME:2},SuperMap.Plot.UniformDistributionType={LEVEL:0,VERTICAL:1};SuperMap.Plot.TransactionType={CREATE:0,EDIT:1,REMOVE:2};var d=SuperMap.Plot.Event=SuperMap.Plot.Event||{};SuperMap.Plot.Event.beforefeatureadded="beforefeatureadded",SuperMap.Plot.Event.featureadded="featureadded",SuperMap.Plot.Event.beforefeaturesselected="beforefeaturesselected",SuperMap.Plot.Event.featuresselected="featuresselected",SuperMap.Plot.Event.beforefeaturesunselected="beforefeaturesunselected",SuperMap.Plot.Event.featuresunselected="featuresunselected",SuperMap.Plot.Event.beforefeaturesmodified="beforefeaturesmodified",SuperMap.Plot.Event.featuresmodified="featuresmodified",SuperMap.Plot.Event.initializecompleted="initializecompleted",SuperMap.Plot.Event.cachecompleted="cachecompleted",SuperMap.Plot.Event.reseteditmarkersvalues="reseteditmarkersvalues",SuperMap.Plot.Event.reseteditmarkers="reseteditmarkers";var f=SuperMap.Plot.GOAnimationType={ANIMATION_UNKNOWN:-1,ANIMATION_WAY:0,ANIMATION_BLINK:1,ANIMATION_ATTRIBUTE:2,ANIMATION_SHOW:3,ANIMATION_ROTATE:4,ANIMATION_SCALE:5,ANIMATION_GROW:6};SuperMap.Plot.BlinkAnimationBlinkStyle={Blink_Frequency:0,Blink_Number:1},SuperMap.Plot.BlinkAnimationReplaceStyle={Replace_NoColor:0,Replace_Color:1},SuperMap.Plot.RotateDirection={ClockWise:0,AntiClockWise:1},SuperMap.Plot.WayPathType={POLYLINE:0,CURVE:1},SuperMap.Plot.GOAnimationState={UNKNOWN:0,PLAYING:1,PAUSE:2,STOP:3,RESET:4};SuperMap.PlotCommonServiceBase=class extends SuperMap.CommonServiceBase{constructor(t,e){super(t,e),this.CLASS_NAME="SuperMap.PlotCommonServiceBase"}destroy(){super.destroy()}_commit(t){"POST"!==t.method&&"PUT"!==t.method||(t.params&&(t.url=SuperMap.Util.urlAppend(t.url,SuperMap.Util.getParameterString(t.params||{}))),t.params=t.data),SuperMap.FetchRequest.commit(t.method,t.url,t.params,{headers:t.headers,withCredentials:t.withCredentials,timeout:t.async?0:null,proxy:t.proxy}).then(function(t){return t.text()}).then(function(e){var i=(new SuperMap.Format.JSON).read(e);i||(i={error:e}),i.error?(t.scope?SuperMap.Function.bind(t.failure,t.scope):t.failure)(i.error):(i.succeed=void 0==i.succeed||i.succeed,(t.scope?SuperMap.Function.bind(t.success,t.scope):t.success)(i))})}};class m{constructor(t){t=t||{},this.method=t.method?t.method:"POST",this.sitData=t.sitData?t.sitData:null,this.smlFileName=t.smlFileName?t.smlFileName:"",this.isCover=!!t.isCover&&t.isCover,this.CLASS_NAME="SuperMap.EditSmlFileParameters"}destroy(){this.method="POST",this.sitData=null,this.isCover=!1,this.smlFileName=""}static toJsonParameters(t){if(t)return SuperMap.Plot.PlottingUtil.toJSON(t.sitData)}}SuperMap.EditSmlFileParameters=m;class M extends SuperMap.PlotCommonServiceBase{constructor(t,e){super(t,e),(e=e||{})&&SuperMap.Util.extend(this,e);var i=this;i.events=new SuperMap.Events(i,null,i.EVENT_TYPES,!0),i.eventListeners instanceof Object&&i.events.on(i.eventListeners),this.CLASS_NAME="SuperMap.EditSmlFileService"}destroy(){super.destroy()}processAsync(t){if(t){var e=this,i=t.method,o=e.url.substr(e.url.length-1,1);e.url+="/"==o?"smlInfos/":"/smlInfos/",e.url+=t.smlFileName+".json",e.url+="?isCover="+t.isCover;var s=null;t.method&&"POST"===t.method&&(s=SuperMap.EditSmlFileParameters.toJsonParameters(t)),e.request({method:i,data:s,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}}SuperMap.EditSmlFileService=M;class b extends SuperMap.PlotCommonServiceBase{constructor(t,e){super(t,e),(e=e||{})&&SuperMap.Util.extend(this,e);var i;i=this.url.substr(this.url.length-1,1),this.url+="/"==i?"symbolLibs.json?":"/symbolLibs.json?",this.CLASS_NAME="SuperMap.GetLibIDsService"}destroy(){super.destroy()}processAsync(){this.request({method:"GET",data:null,scope:this,success:this.serviceProcessCompleted,failure:this.serviceProcessFailed})}}SuperMap.GetLibIDsService=b;class T{constructor(t){t=t||{},this.libID=t.libID,this.CLASS_NAME="SuperMap.GetLibInfoParameter"}destroy(){this.libID=null}}SuperMap.GetLibInfoParameter=T;class v extends SuperMap.PlotCommonServiceBase{constructor(t,e){super(t,e),(e=e||{})&&SuperMap.Util.extend(this,e);var i;i=this.url.substr(this.url.length-1,1),this.url+="/"==i?"symbolLibs/":"/symbolLibs/",this.CLASS_NAME="SuperMap.GetLibInfoService"}destroy(){super.destroy()}processAsync(t){var e=this;t&&null!==t.libID&&(e.libID=t.libID),e.url+=e.libID,e.url+=".json",e.request({method:"GET",data:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}SuperMap.GetLibInfoService=v;class A{constructor(t){t=t||{},this.start=t.start,this.count=t.count?t.count:null,this.CLASS_NAME="SuperMap.GetSMLInfosParameters"}destroy(){this.start=null,this.count=null}static toUrlParameters(t){if(t){var e="";return null!==t.start&&(e="?start="+t.start),!t.count||null===t.count&&0===t.count||(e+="&count="+t.count),e}}}SuperMap.GetSMLInfosParameters=A;class x extends SuperMap.PlotCommonServiceBase{constructor(t,e){super(t,e),(e=e||{})&&SuperMap.Util.extend(this,e);var i,o=this;o.events=new SuperMap.Events(o,null,o.EVENT_TYPES,!0),o.eventListeners instanceof Object&&o.events.on(o.eventListeners),i=o.url.substr(o.url.length-1,1),o.url+="/"==i?"smlInfos":"/smlInfos",o.url+=".json",this.CLASS_NAME="SuperMap.GetSMLInfosService"}destroy(){super.destroy()}processAsync(t){if(t){var e=this;e.url+=SuperMap.GetSMLInfosParameters.toUrlParameters(t),e.request({method:"GET",data:null,scope:e,success:e.serviceProcessCompleted,failure:e.serviceProcessFailed})}}}SuperMap.GetSMLInfosService=x;class _{constructor(t){t=t||{},this.libID=t.libID,this.code=t.code,this.inputPoints=t.inputPoints?t.inputPoints:null,this.symbolRank=t.symbolRank?t.symbolRank:0,this.negativeImage=!!t.negativeImage&&t.negativeImage,this.surroundLineType=t.surroundLineType?t.surroundLineType:0,this.subSymbols=t.subSymbols?t.subSymbols:null,this.scaleValues=t.scaleValues?t.scaleValues:null,this.scalePoints=t.scalePoints?t.scalePoints:null,this.newScalePoint=t.newScalePoint?t.newScalePoint:null,this.newScalePointIndex=t.newScalePointIndex?t.newScalePointIndex:0,this.CLASS_NAME="SuperMap.GetSymbolInfoParameters"}destroy(){var t=this;t.libID=null,t.code=null,t.inputPoints=null,t.symbolRank=null,t.negativeImage=null,t.surroundLineType=null,t.subSymbols=null,t.scaleValues=null,t.scalePoints=null,t.newScalePoint=null,t.newScalePointIndex=null}static toUrlParameters(t){if(t&&null!==t.libID&&null!==t.code){var e="libID="+t.libID+"&code="+t.code;if(t.inputPoints&&null!==t.inputPoints&&0!==t.inputPoints.length){e+="&inputPoints=[";for(let i=0;iMath.abs(e.y-e.y)?Math.abs(t.x-e.x):Math.abs(t.y-e.y)}}}createGradient(){var t=null;if(this.getContext()instanceof CanvasRenderingContext2D){var e=this.calculateObjectByBounds();if("LINEAR"===this.feature.style.fillGradientMode){var i=this.getGradientDirection(this.feature.style.fillAngle);if(t=this.getContext().createLinearGradient(e.ptMinX+e.width*i.x1,e.ptMinY+e.height*i.y1,e.ptMinX+e.width*i.x2,e.ptMinY+e.height*i.y2),0===this.feature.style.fillCenterOffsetX&&0===this.feature.style.fillCenterOffsetY)t.addColorStop(0,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillColor,this.feature.style.fillOpacity)),t.addColorStop(1,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,this.feature.style.fillOpacity));else{var o=this.feature.style.fillAngle;0===o||180===o||90===o||270===o?(t.addColorStop(0,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,this.feature.style.fillOpacity)),0!==o&&180!==o||t.addColorStop(this.feature.style.fillCenterOffsetX,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillColor,this.feature.style.fillOpacity)),90!==o&&270!==o||t.addColorStop(this.feature.style.fillCenterOffsetY,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillColor,this.feature.style.fillOpacity)),t.addColorStop(1,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,this.feature.style.fillOpacity))):(t.addColorStop(0,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,this.feature.style.fillOpacity)),t.addColorStop(this.feature.style.fillCenterOffsetX>=this.feature.style.fillCenterOffsetY?this.feature.style.fillCenterOffsetX:this.feature.style.fillCenterOffsetY*Math.cos(this.feature.style.fillAngle*Math.PI/180),SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillColor,this.feature.style.fillOpacity)),t.addColorStop(1,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,this.feature.style.fillOpacity)))}}if("RADIAL"===this.feature.style.fillGradientMode){var s=this.feature.style.fillCenterOffsetX*e.r,l=this.feature.style.fillCenterOffsetY*e.r,n=e.r/Math.sqrt(2)+Math.abs(s)>e.r/Math.sqrt(2)+Math.abs(l)?e.r/Math.sqrt(2)+Math.abs(s):e.r/Math.sqrt(2)+Math.abs(l);(t=this.getContext().createRadialGradient(e.center.x+s,e.center.y-l,0,e.center.x+s,e.center.y-l,n)).addColorStop(0,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillColor,this.feature.style.fillOpacity)),this.feature.style.fillColor===this.feature.style.fillBackColor?t.addColorStop(1,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,this.feature.style.fillOpacity)):t.addColorStop(1,SuperMap.Plot.PlottingUtil.colorRGBA(this.feature.style.fillBackColor,1))}return t}}createTextureFill(t){if(0!==t.length){var e=document.createElement("canvas");document.body.appendChild(e);var i=e.getContext("2d");e.width=8,e.height=8;var o=e.width,s=e.height,l=SuperMap.Plot.PlottingUtil.colorStringToRGB(t[0].color);i.strokeStyle=`rgba(${l.red},${l.green},${l.blue},${t[0].opacity})`,i.lineWidth=1;var n=SuperMap.Plot.PlottingUtil.colorStringToRGB(t[1].color);switch(i.fillStyle=`rgba(${n.red},${n.green},${n.blue},${t[1].opacity})`,i.fillRect(0,0,e.width,e.height),i.beginPath(),t[0].fillID){case 0:case 1:break;case 2:i.moveTo(0,s),i.lineTo(o,0);break;case 3:i.moveTo(0,0),i.lineTo(o,0),i.moveTo(0,0),i.lineTo(0,s);break;case 4:i.moveTo(0,s),i.lineTo(o,0),i.moveTo(0,0),i.lineTo(o,s);break;case 5:i.moveTo(0,0),i.lineTo(o,s);break;case 6:i.moveTo(0,0),i.lineTo(o,0);break;case 7:i.moveTo(0,0),i.lineTo(0,s)}i.closePath(),i.stroke(),i.fill();var a=i.createPattern(e,"repeat");return document.body.removeChild(e),a}}createFillMode(t){if(void 0!==this.feature.style.fillSymbolID)if(t.fill=this.feature.style.fill,t.fillSymbolID=this.feature.style.fillSymbolID,0===this.feature.style.fillSymbolID||1===this.feature.style.fillSymbolID||!0===this.feature.style.fill||!1===this.feature.style.fill)0===this.feature.style.fillSymbolID?t.fill=!0:1===this.feature.style.fillSymbolID&&(t.fill=!1),t.fillColor=this.feature.style.fillColor,t.fillOpacity=this.feature.style.fillOpacity;else if(this.feature.style.fillColor!==this.feature.style.fillBackColor||this.feature.style.fillBackOpacity>0&&this.feature.style.fillBackOpacity<1){var e=[];e.push({fillID:this.feature.style.fillSymbolID,color:this.feature.style.fillColor,opacity:this.feature.style.fillOpacity},{fillID:this.feature.style.fillSymbolID,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillBackOpacity}),t.fill=!0,t.fillColor=this.createTextureFill(e),t.fillOpacity=this.feature.style.fillColor}else t.fill=!0,t.fillColor=this.feature.style.fillColor,t.fillOpacity=this.feature.style.fillOpacity;else t.fill=this.feature.style.fill,t.fillColor=this.feature.style.fillColor,t.fillOpacity=this.feature.style.fillOpacity}getGradientDirection(t){var e=function(t){return{x:Math.cos(t),y:Math.sin(t)}},i=function(t){return t*Math.PI/180},o=e(i(180-t%360)),s=e(i(360-t%360)),l=Math.pow(2,-52);return(o.x<=0||Math.abs(o.x)<=l)&&(o.x=0),(o.y<=0||Math.abs(o.y)<=l)&&(o.y=0),(s.x<=0||Math.abs(s.x)<=l)&&(s.x=0),(s.y<=0||Math.abs(s.y)<=l)&&(s.y=0),{x1:o.x,y1:o.y,x2:s.x,y2:s.y}}}SuperMap.Plot.CalculateCanvasGradient=Y;class V{constructor(t){this.feature=t}destroy(){this.feature=null}createGradient(){var t=!1;this.feature.layer._renderer._container.defs||(this.feature.layer._renderer._container.defs=L.SVG.create("defs"),t=!0);var e=null;"LINEAR"===this.feature.style.fillGradientMode&&(e=document.getElementById("linearGradient_"+this.feature.uuid)),"RADIAL"===this.feature.style.fillGradientMode&&(e=document.getElementById("radialGradient_"+this.feature.uuid));var i=this.createGradientDirection();for("LINEAR"===this.feature.style.fillGradientMode?((e=null===e?L.SVG.create("linearGradient"):e).setAttributeNS(null,"x1",i.x1),e.setAttributeNS(null,"y1",i.y1),e.setAttributeNS(null,"x2",i.x2),e.setAttributeNS(null,"y2",i.y2)):"RADIAL"===this.feature.style.fillGradientMode&&((e=null===e?L.SVG.create("radialGradient"):e).setAttributeNS(null,"cx",i.cx),e.setAttributeNS(null,"cy",i.cy),e.setAttributeNS(null,"fx",i.fx),e.setAttributeNS(null,"fy",i.fy),e.setAttributeNS(null,"r",i.r));e.hasChildNodes();)e.removeChild(e.firstChild);for(var o=0,s=i.colors.length;o0&&this.feature.style.fillBackOpacity<1){var e=[];e.push({fillID:this.feature.style.fillSymbolID,color:this.feature.style.fillColor,opacity:this.feature.style.fillOpacity},{fillID:this.feature.style.fillSymbolID,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillBackOpacity}),this.feature._map.getRenderer(this.feature.layer)instanceof L.SVG?(t.fillOpacity=1,t.fillColor="url(#"+this.createTextureFill(e)+")",t.fill=t.fillColor):new SuperMap.Plot.CalculateCanvasGradient(this.feature,this.feature.getBounds()).createTextureFill(e)}else t.fill=!0,t.fillColor=this.feature.style.fillColor,t.fillOpacity=this.feature.style.fillOpacity;else t.fill=this.feature.style.fill,t.fillColor=this.feature.style.fillColor,t.fillOpacity=this.feature.style.fillOpacity}createGradientDirection(){var t=[];if("LINEAR"===this.feature.style.fillGradientMode){if(null!==this.feature.style.fillCenterOffsetX&&void 0!==this.feature.style.fillCenterOffsetX&&(0===this.feature.style.fillAngle||180===this.feature.style.fillAngle?(t.push({offset:0,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillOpacity}),t.push({offset:this.feature.style.fillCenterOffsetX,color:this.feature.style.fillColor,opacity:this.feature.style.fillOpacity}),t.push({offset:1,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillOpacity})):90===this.feature.style.fillAngle||270===this.feature.style.fillAngle?(t.push({offset:0,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillOpacity}),t.push({offset:this.feature.style.fillCenterOffsetY,color:this.feature.style.fillColor,opacity:this.feature.style.fillOpacity}),t.push({offset:1,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillOpacity})):(t.push({offset:0,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillOpacity}),t.push({offset:this.feature.style.fillCenterOffsetX/2*(Math.sqrt(2)/2)*Math.abs(Math.sin(this.feature.style.fillAngle*Math.PI/180)),color:this.feature.style.fillColor,opacity:this.feature.style.fillOpacity}),t.push({offset:1,color:this.feature.style.fillBackColor,opacity:this.feature.style.fillOpacity}))),this.feature.style.fillAngle>=360&&(this.feature.style.fillAngle=0),0===this.feature.style.fillAngle)return{x1:0,y1:0,x2:1,y2:0,colors:t};if(90===this.feature.style.fillAngle)return{x1:0,y1:1,x2:0,y2:0,colors:t};if(180===this.feature.style.fillAngle)return{x1:1,y1:0,x2:0,y2:0,colors:t};if(270===this.feature.style.fillAngle)return{x1:0,y1:0,x2:0,y2:1,colors:t};if(0=0||this.feature.style.fillCenterOffsetX<=0&&this.feature.style.fillCenterOffsetX>=-1){if(this.feature.style.fillCenterOffsetY>=0&&this.feature.style.fillCenterOffsetY<=.5||this.feature.style.fillCenterOffsetY>=-.5&&this.feature.style.fillCenterOffsetY<=0)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:.5*Math.sqrt(2),colors:t};if(this.feature.style.fillCenterOffsetY>=.5&&this.feature.style.fillCenterOffsetY<=.8||this.feature.style.fillCenterOffsetY>=-.8&&this.feature.style.fillCenterOffsetY<=-.5)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:.8*Math.sqrt(2),colors:t};if(this.feature.style.fillCenterOffsetY>=.8&&this.feature.style.fillCenterOffsetY<=1||this.feature.style.fillCenterOffsetY>=-1&&this.feature.style.fillCenterOffsetY<=-.8)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:Math.sqrt(2),colors:t}}else if(this.feature.style.fillCenterOffsetX<=.8&&this.feature.style.fillCenterOffsetX>.5||this.feature.style.fillCenterOffsetX<=-.5&&this.feature.style.fillCenterOffsetX>=-.8){if(this.feature.style.fillCenterOffsetY>=0&&this.feature.style.fillCenterOffsetY<=.5||this.feature.style.fillCenterOffsetY>=-.5&&this.feature.style.fillCenterOffsetY<=0)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:.8*Math.sqrt(2),colors:t};if(this.feature.style.fillCenterOffsetY>=.5&&this.feature.style.fillCenterOffsetY<=.8||this.feature.style.fillCenterOffsetY>=-.8&&this.feature.style.fillCenterOffsetY<=-.5)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:.8*Math.sqrt(2),colors:t};if(this.feature.style.fillCenterOffsetY>=.8&&this.feature.style.fillCenterOffsetY<=1||this.feature.style.fillCenterOffsetY>=-1&&this.feature.style.fillCenterOffsetY<=-.8)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:Math.sqrt(2),colors:t}}else if(this.feature.style.fillCenterOffsetX<=1&&this.feature.style.fillCenterOffsetX>.8||this.feature.style.fillCenterOffsetX<=-.8&&this.feature.style.fillCenterOffsetX>=-1){if(this.feature.style.fillCenterOffsetY>=0&&this.feature.style.fillCenterOffsetY<=.5||this.feature.style.fillCenterOffsetY>=-.5&&this.feature.style.fillCenterOffsetY<=0)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:Math.sqrt(2),colors:t};if(this.feature.style.fillCenterOffsetY>=.5&&this.feature.style.fillCenterOffsetY<=.8||this.feature.style.fillCenterOffsetY>=-.8&&this.feature.style.fillCenterOffsetY<=-.5)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:Math.sqrt(2),colors:t};if(this.feature.style.fillCenterOffsetY>=.8&&this.feature.style.fillCenterOffsetY<=1||this.feature.style.fillCenterOffsetY>=-1&&this.feature.style.fillCenterOffsetY<=-.8)return{cx:.5,cy:.5,fx:.5+this.feature.style.fillCenterOffsetX,fy:.5-this.feature.style.fillCenterOffsetY,r:Math.sqrt(2),colors:t}}}}SuperMap.Plot.CalculateSVGGradient=V;var W=SuperMap.Plot.AnalysisSymbol=SuperMap.Plot.AnalysisSymbol||{};SuperMap.Plot.AnalysisSymbol.analysisBasicInfo=function(t){let e=new Object;return e.libID=t.libID,e.code=t.code,e.symbolType=t.symbolType,e.symbolName=t.symbolName,e.textContent=t.textContent,e.minEditPts=t.algoMinEditPts,e.maxEditPts=t.algoMaxEditPts,e.surroundLineType=t.surroundLineType,e},SuperMap.Plot.AnalysisSymbol.analysisDotBasicInfo=function(t){let e=SuperMap.Plot.PlottingUtil.DPI,i=new Object;i.anchorPoint=new SuperMap.Geometry.Point(t.anchorPoint.x,t.anchorPoint.y);let o=0,s=0;return void 0!==t.symbolSizeInLib?(o=Math.round(t.symbolSizeInLib.x*e/25.4/10),s=Math.round(t.symbolSizeInLib.y*e/25.4/10)):(o=Math.round(t.symbolSize.x*e/25.4/10),s=Math.round(t.symbolSize.y*e/25.4/10)),i.symbolSizeInLib=new SuperMap.Size(o,s),i.symbolSizeInLib.w=o,i.symbolSizeInLib.h=s,i.middleMarkBounds=new SuperMap.Bounds(t.middleMarkBounds.leftBottom.x,t.middleMarkBounds.leftBottom.y,t.middleMarkBounds.rightTop.x,t.middleMarkBounds.rightTop.y),i},SuperMap.Plot.AnalysisSymbol.analysisAlgoBasicInfo=function(t,e){let i=new Object;if(i.subSymbols=[],i.scalePoints=[],i.scaleValues=[],e&&t.subSymbols)for(let e=0;ei?e.scaleValues[i]=t.scaleValues[i]:e.scaleValues.push(t.scaleValues[i]);else e.scaleValues=[],e.scaleValues=t.scaleValues;e.visible=t.visible,e.orbitPoints=t.orbitPoints}else if(0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.SATELLITETIMEWINDOWS)e.timeWindows=t.timeWindows;else{let o;o=!0===i?L.Util.latLngsToSuperMapPoints(t.getLatLngs()):t.controlPoints,e.hasOwnProperty("localePoints")||(e.localePoints=[]);let s=o.length;t.symbolType===SuperMap.Plot.SymbolType.ELLIPSESYMBOL&&(s=3);for(let t=0;tt?(e.localePoints[t].x=o[t].x,e.localePoints[t].y=o[t].y,e.localePoints[t].hasOwnProperty("z")||(e.localePoints[t].z=0)):e.localePoints.push({x:o[t].x,y:o[t].y,z:0});if(0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.LINERELATION)e.endAssociatedUuid=t.endAssociatedUuid,e.lineRelationType=t.lineRelationType,e.startAssociatedUuid=t.startAssociatedUuid,e.subSectionCount=t.subSectionCount;else if(t.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL){e.surroundLineType=t.surroundLineType,e.symbolRank=t.symbolRank,e.negativeImage=t.negativeImage,e.space=t.space,e.flagTextSize=t.flagTextSize,e.maxScale=t.maxScale,e.minScale=t.minScale,e.textDisplay=t.textDisplay,e.actualScale=t.actualScale,void 0!==t.fontSize&&(e.fontSize=t.fontSize),void 0!==t.strokeWidth&&(e.strokeWidth=t.strokeWidth);let i=25.4*t.symbolSize.w*10/SuperMap.Plot.PlottingUtil.DPI,o=25.4*t.symbolSize.h*10/SuperMap.Plot.PlottingUtil.DPI;e.symbolSize={x:i,y:o};let s=25.4*t.symbolSizeInLib.w*10/SuperMap.Plot.PlottingUtil.DPI,l=25.4*t.symbolSizeInLib.h*10/SuperMap.Plot.PlottingUtil.DPI;e.symbolSizeInLib={x:s,y:l},e.positionOffset=t.positionOffset,e.positionOffsetType=t.positionOffsetType,e.positionOffsetX=t.positionOffsetX,e.positionOffsetY=t.positionOffsetY,!1===t.widthHeightLimit||!0===t.widthHeightLimit?e.limitWidthHeight=t.widthHeightLimit:e.limitWidthHeight=t.limitWidthHeight}else{if(e.surroundLineType=t.surroundLineType,e.hasOwnProperty("scaleValues"))for(let i=0;ii?e.scaleValues[i]=t.scaleValues[i]:e.scaleValues.push(t.scaleValues[i]);else e.scaleValues=[],e.scaleValues=t.scaleValues;e.subSymbolScaleValue=t.subSymbolScaleValue,e.baseScale=t.baseScale,e.strokeWidth=t.strokeWidth,e.polylineConnectLocationPoint=t.polylineConnectLocationPoint,22===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.ALGOSYMBOL?(e.arrowHeadType=t.arrowHeadType,e.arrowBodyType=t.arrowBodyType,e.arrowTailType=t.arrowTailType):0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.ARROWLINE?e.arrowAngle=t.arrowAngle:0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.COMBINATIONALCIRCLE?e.defaultRadius=t.defaultRadius:0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.CONCENTRICCIRCLE||(0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.LINEMARKING?(e.islocationCircle=t.islocationCircle,e.textBoxType=t.textBoxType):0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.SYMBOLTEXTBOX?(e.roundBox=t.roundBox,e.textBoxType=t.textBoxType):0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.PATHTEXT?(e.isAvoid=t.isAvoid,e.isCurve=t.isCurve,e.relLineText=t.relLineText,e.showPathLine=t.showPathLine,e.textToLineDistance=t.textToLineDistance,e.showPathLineArrow=t.showPathLineArrow):0===t.libID&&t.symbolType===SuperMap.Plot.SymbolType.ARCREGION&&(i?(e.centerPoint={x:t.centerPoint.lng,y:t.centerPoint.lat},e.circlePts=t.circlePts,e.spatialAnalystUrl=t.spatialAnalystUrl):e.centerPoint=t.centerPoint,e.endAngle=t.endAngle,e.radius=t.radius,e.radiusPosAngle=t.radiusPosAngle,e.startAngle=t.startAngle,e.textPosition=t.textPosition,e.radiusLineType=t.radiusLineType,e.radiusText=t.radiusText))}}t.symbolData=e},SuperMap.Plot.AnalysisSymbol.parseSymbolData=function(t,e,i){if(null!=e){if(void 0!==e.isEdit&&(t.isEdit=e.isEdit),e.hasOwnProperty("version")&&(t.version=e.version),t.libID=parseInt(e.libID),t.code=parseInt(e.code),t.maxEditPts=parseInt(e.algoMaxEditPts),t.minEditPts=parseInt(e.algoMinEditPts),t.symbolType=e.symbolType,t.symbolName=e.symbolName,t.textContent=e.textContent,void 0!==e.dScale?t.dScale=e.dScale:void 0!==e.scale2D&&(t.dScale=e.scale2D.x),void 0!==e.dRotate?t.dRotate=e.dRotate:void 0!==e.rotate2D&&(t.dRotate=e.rotate2D.x),void 0!==e.resolution&&(t.resolution=e.resolution),void 0!==e.uuid&&(t.uuid=e.uuid),void 0!==e.associatedUuid&&(t.associatedUuid=e.associatedUuid),void 0!==e.annotationPosition&&(i?t.annotationPosition=e.annotationPosition:t.textPosition=e.annotationPosition),void 0!==e.scaleByMap&&(t.scaleByMap=e.scaleByMap),void 0!==e.isLocked&&(t.isLocked=e.isLocked),void 0!==e.note&&(t.note=e.note),void 0!==e.custom&&(t.custom=e.custom),e.extendProperty)for(let i=0;i255?e++:i++;return e+i/2},SuperMap.Plot.PlottingUtil.toJSON=function(t){var e=t;if(null==e)return null;switch(e.constructor){case String:return e=(e=(e=(e=(e=(e=(e='"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%2525")).replace(/&/g,"%26");case Array:let t=[];for(let i=0,o=e.length;i0?"{"+t.join(",")+"}":"{}"}return e.toString()}},SuperMap.Plot.PlottingUtil.copyFeature=function(t){var e=null;if(null!=t&&t.geometry){let i=t.geometry.clone();e=new SuperMap.Feature.Vector(i),t.style&&(e.style=SuperMap.Plot.PlottingUtil.copyAttributes(e.style,t.style)),i.feature=e,i.calculateParts()}return e},SuperMap.Plot.PlottingUtil.getSurroundLinePts=function(t,e){var i=[],o=[];for(let s=0;s2*i?o.push(n):(o[o.length-1]=e,o.push(n))}else o.push(n)}else o.push(l),o.push(n);(i=[]).push(o[o.length-2]),i.push(o[o.length-1])}if(t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y&&1Math.PI&&(o-=2*Math.PI),o}if(t.length<3)return 1;let i=0,o={x:0,y:0},s={x:0,y:0};for(let l=2;l=0?-1:1},SuperMap.Plot.PlottingUtil.isNear=function(t,e){return e||(e=SuperMap.Plot.PlottingUtil.TORLERANCE_STATIC),t-e},SuperMap.Plot.PlottingUtil.equalFuzzy=function(t,e,i){return i||(i=1e-18),Math.abs(t-e)<=i},SuperMap.Plot.PlottingUtil.intersectLines=function(t,e,i,o){var s={isIntersectLines:!1};if(t.x===e.x&&t.y===e.y||i.x===o.x&&i.y===o.y)return s;let l=e.x-t.x,n=e.y-t.y,a=o.x-i.x,r=o.y-i.y,p=l*r-a*n;if(SuperMap.Plot.PlottingUtil.isNear(p))return s;let u=(l*(t.y-i.y)-n*(t.x-i.x))/p,h=new SuperMap.Geometry.Point(0,0);return h.x=u*a+i.x,h.y=u*r+i.y,s.isIntersectLines=!0,s.intersectPoint=h,s},SuperMap.Plot.PlottingUtil.getEnvelopePoints=function(t){function e(t,e){if(t.length!==e.length)return!1;for(let i=0;i=0;i--)e.push(t[o][i]);t.splice(o,1);let i=s(t,e);if(void 0!==i&&0!==i.length)return i}return e}if(SuperMap.Plot.PlottingUtil.isArray(t)||(t=[t]),0===t.length)return[];if(1===t.length)return t[0];for(let i=0;i2&&a.push(t)}return a},SuperMap.Plot.PlottingUtil.isRight=function(t,e,i){let o=e,s=i,l=e,n=t;return(s.x-o.x)*(n.y-l.y)-(n.x-l.x)*(s.y-o.y)<0},SuperMap.Plot.PlottingUtil.radian=function(t,e){let i,o,s=0;return i=e.x-t.x,o=e.y-t.y,(s=Math.atan2(o,i))<0&&(s+=2*Math.PI),s},SuperMap.Plot.PlottingUtil.findBisectorPoint=function(t,e,i,o){let s=SuperMap.Plot.PlottingUtil.radian(e,t),l=(s+SuperMap.Plot.PlottingUtil.radian(e,i))/2,n=Math.cos(l-s+Math.PI/2),a=o;SuperMap.Plot.PlottingUtil.isNear(n,.15)||(a=o/n);let r=e.x+a*Math.cos(l),p=e.y+a*Math.sin(l);return new SuperMap.Geometry.Point(r,p)},SuperMap.Plot.PlottingUtil.findPoint=function(t,e,i,o){if(t===e||Math.abs(i)<1e-18)return t;let s=SuperMap.Plot.PlottingUtil.radian(t,e)+o*Math.PI/180;var l=t.x+i*Math.cos(s),n=t.y+i*Math.sin(s);return new SuperMap.Geometry.Point(l,n)},SuperMap.Plot.PlottingUtil.isSameQuadrant=function(t,e,i,o){let s=(e.x-t.x)*(o.x-i.x),l=(e.y-t.y)*(o.y-i.y);return!(Math.abs(s)<1e-18&&Math.abs(l)<1e-18)&&((s>0||Math.abs(s)<1e-18)&&(l>0||Math.abs(l)<1e-18))},SuperMap.Plot.PlottingUtil.isCross=function(t,e,i,o){let s=new SuperMap.Geometry.Point(0,0);return!(!SuperMap.Plot.PlottingUtil.intersectLineSegs(t,e,i,o,s)||s==t||s===e||s===i||s==o)},SuperMap.Plot.PlottingUtil.intersectLineSegs=function(t,e,i,o,s){if(SuperMap.Plot.PlottingUtil.equalFuzzy(t.x,e.x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(t.y,e.y))return s.x=t.x,s.y=t.y,!1;if(SuperMap.Plot.PlottingUtil.equalFuzzy(i.x,o.x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(i.y,o.y))return s.x=i.x,s.y=i.y,!1;let l=0,n=0;if(l=t.x>e.x?t.x:e.x,n=t.x1e-16&&o.x-l>1e-16||i.x-n<-1e-16&&o.x-n<-1e-16)return!1;if(l=t.y>e.y?t.y:e.y,n=t.y1e-16&&o.y-l>1e-16||i.y-n<-1e-16&&o.y-n<-1e-16)return!1;let a=e.x-t.x,r=e.y-t.y,p=o.x-i.x,u=o.y-i.y,h=t.x-i.x,y=t.y-i.y,c=a*u-p*r,S=c;if(Math.abs(a)>1e-18&&Math.abs(p)>1e-18&&(S/=a*p),Math.abs(S)<1e-18)return t===i?(s.x=t.x,s.y=t.y,!SuperMap.Plot.PlottingUtil.isSameQuadrant(t,e,i,o)):e===o?(s.x=e.x,s.y=e.y,!SuperMap.Plot.PlottingUtil.isSameQuadrant(t,e,i,o)):t===o?(s.x=t.x,s.y=t.y,SuperMap.Plot.PlottingUtil.isSameQuadrant(t,e,i,o)):e===i&&(s.x=e.x,s.y=e.y,SuperMap.Plot.PlottingUtil.isSameQuadrant(t,e,i,o));let P=(a*y-r*h)/c,g=(p*y-u*h)/c;return!(P<0&&(Math.abs(P*p)>1e-16||Math.abs(P*u)>1e-16))&&(!(P>1&&(Math.abs((P-1)*p)>1e-16||Math.abs((P-1)*u)>1e-16))&&(!(g<0&&(Math.abs(g*a)>1e-16||Math.abs(g*r)>1e-16))&&(!(g>1&&(Math.abs((g-1)*a)>1e-16||Math.abs((g-1)*r)>1e-16))&&(Math.abs(P)<1e-18?(s.x=i.x,s.y=i.y,!0):Math.abs(P-1)<1e-18?(s.x=o.x,s.y=o.y,!0):Math.abs(g)<1e-18?(s.x=t.x,s.y=t.y,!0):Math.abs(g-1)<1e-18?(s.x=e.x,s.y=e.y,!0):!(P<0&&(Math.abs(P*p)>1e-16||Math.abs(P*u)>1e-16))&&(!(P>1&&(Math.abs((P-1)*p)>1e-16||Math.abs((P-1)*u)>1e-16))&&(!(g<0&&(Math.abs(g*a)>1e-16||Math.abs(g*r)>1e-16))&&(!(g>1&&(Math.abs((g-1)*a)>1e-16||Math.abs((g-1)*r)>1e-16))&&(s.x=P*p+i.x,s.y=P*u+i.y,!0))))))))},SuperMap.Plot.PlottingUtil.parallel=function(t,e){let i=[],o=t.length;if(!t||null==t||t.length<2)return i;let s=!1;t.length>3&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y&&(s=!0),s?(i[0]=SuperMap.Plot.PlottingUtil.findBisectorPoint(t[t.length-2],t[0],t[1],e),i[t.length-1]=i[0]):(i[0]=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],e,90),i[t.length-1]=SuperMap.Plot.PlottingUtil.findPoint(t[t.length-1],t[t.length-2],-e,90));let l=t[0],n=t[1],a=t[1];for(let s=1;s1&&(n=1);let a=(i.x-e.x)*n+e.x,r=(i.y-e.y)*n+e.y,p=(a-t.x)*(a-t.x)+(r-t.y)*(r-t.y);return Math.sqrt(p)},SuperMap.Plot.PlottingUtil.isCounterClockwise=function(t,e,i){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)>0},SuperMap.Plot.PlottingUtil.clearSamePts=function(t){let e=t.length;for(let i=0;i=e)continue;let s=t[o].x,l=t[o].y,n=t[o+2].x,a=t[o+2].y,r=t[o+4].x,p=t[o+4].y,u=t[o+3].x,h=t[o+3].y;if(SuperMap.Plot.PlottingUtil.equalFuzzy(s,n,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(l,a,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(r,u,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(p,h,1e-10))i.push(new SuperMap.Geometry.Point(s,l)),i.push(new SuperMap.Geometry.Point(r,p));else for(let t=0;t<=1;t+=.03125){let e,o,y,c,S=t*t,P=S*t;e=1-3*t+3*S-P,o=3*(t-2*S+P),y=3*(S-P),c=P;let g=new SuperMap.Geometry.Point(e*s+o*n+y*r+c*u,e*l+o*a+y*p+c*h);i.push(g)}}return i},SuperMap.Plot.PlottingUtil.computeBeizerPoints=function(t,e,i){let o=SuperMap.Plot.PlottingUtil.polylineDistance(e),s=[],l=[],n=[];if(t){l.push(e[0]);let t=i[0],a=i[1],r=e[0].x+o*t,p=e[0].y+o*a;l.push(new SuperMap.Geometry.Point(r,p)),s.push(new SuperMap.Geometry.Point(r,p));for(let t=1;t0?(u=e+(o-e)*c/y,h=i+(s-i)*c/y):(u=e,h=i),a.x=u+(r-u)*t,a.y=h+(p-h)*t,a},SuperMap.Plot.PlottingUtil.pointIsOnPolyLine=function(t,e,i){if(SuperMap.Plot.PlottingUtil.equalFuzzy(t.x,e.x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(t.y,e.y)||SuperMap.Plot.PlottingUtil.equalFuzzy(t.x,i.x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(t.y,i.y))return!0;let o=t.x-e.x,s=t.y-e.y,l=t.x-i.x,n=t.y-i.y,a=(o*l+s*n)/(Math.sqrt(o*o+s*s)*Math.sqrt(l*l+n*n));return!!SuperMap.Plot.PlottingUtil.equalFuzzy(a,-1,.1)},SuperMap.Plot.PlottingUtil.pointIsOnPolyLines=function(t,e){if(!e||0===e.length)return{isOnPolyLine:!1,index:-1};let i=!1,o=-1;for(let s=0;sr&&(i=r,o=s)}return o&&i<0&&(o=-1),{minDis:i,index:o}},SuperMap.Plot.PlottingUtil.findPointInLine=function(t,e,i){if(t===e||Math.abs(i)<1e-18)return t;let o=e.x-t.x,s=e.y-t.y,l=i/Math.sqrt(o*o+s*s),n=t.x+o*l,a=t.y+s*l;return new SuperMap.Geometry.Point(n,a)},SuperMap.Plot.PlottingUtil.operateControlPoints=function(t){let e=t,i=e.length;if(3==i){let i=new SuperMap.Geometry.Point(0,0);SuperMap.Plot.PlottingUtil.getTrapezoidPoints(1,t[0],t[1],t[2],i),e.push(i)}if(i>4&&(e.splice(4,i-4),i=e.length),SuperMap.Plot.PlottingUtil.pointIsRightToLine(t[0],t[1],e[2])){let t=e[0];e[0]=e[1],e[1]=t}if(!SuperMap.Plot.PlottingUtil.pointIsRightToVerticle(e[0],e[1],e[2])){let t=e[2];e[2]=e[3],e[3]=t}return e},SuperMap.Plot.PlottingUtil.pointIsRightToLine=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(i.x-t.x)*(e.y-t.y)<0},SuperMap.Plot.PlottingUtil.pointIsRightToVerticle=function(t,e,i){let o=new SuperMap.Geometry.Point(.5*(e.x+t.x),.5*(e.y+t.y)),s=new SuperMap.Geometry.Point(e.x-t.x,e.y-t.y),l=new SuperMap.Geometry.Point(i.x-o.x,i.y-o.y);return s.x*l.x+s.y*l.y>0},SuperMap.Plot.PlottingUtil.linePnt=function(t,e,i){let o=SuperMap.Plot.PlottingUtil.distance(t,e);if(0==o)return t;{let s=i/o;return SuperMap.Plot.PlottingUtil.findPointOnLineByRatio(s,t,e)}},SuperMap.Plot.PlottingUtil.findPointOnLineByRatio=function(t,e,i){let o=new SuperMap.Geometry.Point(0,0);return o.x=e.x+(i.x-e.x)*t,o.y=e.y+(i.y-e.y)*t,o},SuperMap.Plot.PlottingUtil.rotateAngle=function(t,e,i){let o=e,s=Math.cos(o),l=Math.sin(o),n=i.x-t.x,a=i.y-t.y;return i.x=n*s-a*l+t.x,i.y=n*l+a*s+t.y,i},SuperMap.Plot.PlottingUtil.resize=function(t,e,i){return i.x=t.x+e*(i.x-t.x),i.y=t.y+e*(i.y-t.y),i},SuperMap.Plot.PlottingUtil.findPointInPolyLine=function(t,e){if(e<0||t.length<2)return{index:-1,pt:null};if(Math.abs(e)<1e-18)return{index:0,pt:t[0]};let i=0;for(let o=0;oe||SuperMap.Plot.PlottingUtil.equalFuzzy(i,e)){let s=i-e,l=t[o+1],n=t[o],a=s/SuperMap.Plot.PlottingUtil.distance(l,n),r=new SuperMap.Geometry.Point(0,0);return r.x=l.x+(n.x-l.x)*a,r.y=l.y+(n.y-l.y)*a,{index:o,pt:r}}return{index:-1,pt:null}},SuperMap.Plot.PlottingUtil.polylineDistance=function(t){if(0===t.length)return 0;let e=0;for(let i=0;i=t.x&&e.y>=t.y?1:e.xt.y?2:e.x<=t.x&&e.y<=t.y?3:4)==(s=i.x>t.x&&i.y>t.y?1:i.xt.y?2:i.xl&&a>l)&&(r=0);else switch(o){case 1:(4==s&&nl)&&(r=0);break;case 2:(1==s&&nl)&&(r=0);break;case 3:(2==s&&nl)&&(r=0);break;case 4:(3==s&&nl)&&(r=0)}let p=new SuperMap.Geometry.Point(0,0);return SuperMap.Plot.PlottingUtil.equalFuzzy(l-1.7976931348623157e308,0)?(p.x=t.x,p.y=e.y):SuperMap.Plot.PlottingUtil.equalFuzzy(l,0)?(p.x=e.x,p.y=t.y):(p.x=(l*(e.y-t.y)+l*l*t.x+e.x)/(l*l+1),p.y=t.y+l*(p.x-t.x)),{isOnline:1===r,projectPoint:p}},SuperMap.Plot.PlottingUtil.coordinateTrans=function(t,e,i){let o=SuperMap.Plot.PlottingUtil.distance(new SuperMap.Geometry.Point(0,0),e),s=SuperMap.Plot.PlottingUtil.radian(new SuperMap.Geometry.Point(0,0),e)+i*Math.PI/180,l=o*Math.cos(s)+t.x,n=o*Math.sin(s)+t.y;return new SuperMap.Geometry.Point(l,n)},SuperMap.Plot.PlottingUtil.triangleHeightAndPartBottomLen=function(t,e,i){let o,s,l=(i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y),n=Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),a=Math.sqrt((t.x-i.x)*(t.x-i.x)+(t.y-i.y)*(t.y-i.y));if(0==a||0==n)o=0,s=0;else if(0==l)o=n,s=0;else{let t=(n*n+a*a-l)/2/n/a,e=0;t>=1?(t=1,e=0):e=Math.sqrt(1-t*t),o=a*t,s=a*e}return{dLen1:o,dLen2:s}},SuperMap.Plot.PlottingUtil.paraLine=function(t,e,i){let o=[];if(2>t.length)return o;if(i){let i=t[1].clone();i=SuperMap.Plot.PlottingUtil.rotateAngle(t[0],Math.PI/2,i),o.push(SuperMap.Plot.PlottingUtil.linePnt(t[0],i,e));for(let s=1;sMath.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);i=t[s+1].clone(),i=SuperMap.Plot.PlottingUtil.rotateAngle(t[s],r,i),o.push(SuperMap.Plot.PlottingUtil.linePnt(t[s],i,p))}i=t[t.length-2].clone(),i=SuperMap.Plot.PlottingUtil.rotateAngle(t[t.length-1],-1*Math.PI/2,i),o.push(SuperMap.Plot.PlottingUtil.linePnt(t[t.length-1],i,e))}else{let i=t[1].clone();i=SuperMap.Plot.PlottingUtil.rotateAngle(t[0],-Math.PI/2,i),o.push(SuperMap.Plot.PlottingUtil.linePnt(t[0],i,e));for(let s=1;sMath.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);i=t[s-1].clone(),i=SuperMap.Plot.PlottingUtil.rotateAngle(t[s],r,i),o.push(SuperMap.Plot.PlottingUtil.linePnt(t[s],i,p))}i=t[t.length-2].clone(),i=SuperMap.Plot.PlottingUtil.rotateAngle(t[t.length-1],Math.PI/2,i),o.push(SuperMap.Plot.PlottingUtil.linePnt(t[t.length-1],i,e))}return o},SuperMap.Plot.PlottingUtil.circlePoint=function(t,e,i,o){o*=Math.PI/180;let s=t.x+e*Math.cos(o),l=t.y+i*Math.sin(o);return new SuperMap.Geometry.Point(s,l)},SuperMap.Plot.PlottingUtil.getPolygonCenterPt=function(t){if(!t||0===t.length)return null;let e=0,i=0;for(let o=0;on.y?l.y:n.y;e.yr||(e.y-l.y)*(n.x-l.x)/(n.y-l.y)+l.x>e.x&&i++}return i%2==1},SuperMap.Plot.PlottingUtil.projectPtOnPolyLine=function(t,e){if(2>e.length)return{index:-1,pt:null};for(let i=0;i0?0:1},SuperMap.Plot.PlottingUtil.isSamePt=function(t,e){return!(!SuperMap.Plot.PlottingUtil.equalFuzzy(t.x,e.x)||!SuperMap.Plot.PlottingUtil.equalFuzzy(t.y,e.y))},SuperMap.Plot.PlottingUtil.getPtsIndexByDistance=function(t,e){let i=SuperMap.Plot.PlottingUtil.findPointInPolyLine(e,t);return{index:i.index,pts:i.pt,bfind:-1!==i.index}},SuperMap.Plot.PlottingUtil.ptInBounds=function(t,e){return t.x>e.left&&t.xe.bottom},SuperMap.Plot.PlottingUtil.InnerAngle=function(t,e,i){if(t==e||t==i)return 0;let o=SuperMap.Plot.PlottingUtil.distance(t,e),s=SuperMap.Plot.PlottingUtil.distance(t,i),l=SuperMap.Plot.PlottingUtil.distance(e,i),n=(o*o+s*s-l*l)/(2*o*s);return n>1&&SuperMap.Plot.PlottingUtil.equalFuzzy(n,1)?n=1:n<1&&SuperMap.Plot.PlottingUtil.equalFuzzy(n,-1)&&(n=-1),Math.acos(n)},SuperMap.Plot.PlottingUtil.plumbLineLen=function(t,e,i){return SuperMap.Plot.PlottingUtil.distance(t,e)*Math.sin(SuperMap.Plot.PlottingUtil.InnerAngle(e,t,i))},SuperMap.Plot.PlottingUtil.paraPolygon=function(t,e,i){let o=[],s=SuperMap.Plot.PlottingUtil.clonePoints(t),l=s.length;if(l<2)return o;let n=new SuperMap.Geometry.Point(0,0);if(i){if(l<3)n=s[1].clone(),SuperMap.Plot.PlottingUtil.rotateAngle(s[0],Math.PI,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[0],n,e));else{let t=SuperMap.Plot.PlottingUtil.radian(s[0],s[1]),i=SuperMap.Plot.PlottingUtil.radian(s[0],s[s.length-1])-t;for(;i<0;)i+=2*Math.PI;let l,a=i/2;l=a>Math.PI/2?a-Math.PI/2:Math.PI/2-a;let r=e/Math.cos(l);n=s[1].clone(),n=SuperMap.Plot.PlottingUtil.rotateAngle(s[0],a,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[0],n,r))}for(let t=1;tMath.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);n=s[t+1].clone(),n=SuperMap.Plot.PlottingUtil.rotateAngle(s[t],r,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[t],n,p))}if(l<3)n=s[l-2].clone(),SuperMap.Plot.PlottingUtil.rotateAngle(s[l-1],0,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[l-1],n,e));else{let t=SuperMap.Plot.PlottingUtil.radian(s[l-1],s[0]),i=SuperMap.Plot.PlottingUtil.radian(s[l-1],s[l-2])-t;for(;i<0;)i+=2*Math.PI;let a,r=i/2;a=r>Math.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);n=s[0].clone(),n=SuperMap.Plot.PlottingUtil.rotateAngle(s[l-1],r,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[l-1],n,p))}}else{if(l<3){let t=s[1].clone();SuperMap.Plot.PlottingUtil.rotateAngle(s[0],0,t),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[0],t,e))}else{let t=SuperMap.Plot.PlottingUtil.radian(s[0],s[1]),i=SuperMap.Plot.PlottingUtil.radian(s[0],s[l-1])-t;for(;i<0;)i+=2*Math.PI;let a,r=Math.PI-i/2;a=r>Math.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);n=s[l-1].clone(),n=SuperMap.Plot.PlottingUtil.rotateAngle(s[0],r,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[0],n,p))}for(let t=1;tMath.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);n=s[t-1].clone(),n=SuperMap.Plot.PlottingUtil.rotateAngle(s[t],r,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[t],n,p))}if(l<3)n=s[l-2].clone(),SuperMap.Plot.PlottingUtil.rotateAngle(s[l-1],Math.PI,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[l-1],n,e));else{let t=SuperMap.Plot.PlottingUtil.radian(s[l-1],s[0]),i=SuperMap.Plot.PlottingUtil.radian(s[l-1],s[l-2])-t;for(;i<0;)i+=2*Math.PI;let a,r=Math.PI-i/2;a=r>Math.PI/2?r-Math.PI/2:Math.PI/2-r;let p=e/Math.cos(a);n=s[l-2].clone(),n=SuperMap.Plot.PlottingUtil.rotateAngle(s[l-1],r,n),o.push(SuperMap.Plot.PlottingUtil.linePnt(s[l-1],n,p))}}return o},SuperMap.Plot.PlottingUtil.getOutRectangleDis=function(t){if(2>t.length)return 0;let e=t[0].x,i=t[0].x,o=t[0].y,s=t[0].y;for(let l=1;lt[l].x&&(i=t[l].x),ot[l].y&&(s=t[l].y);return SuperMap.Plot.PlottingUtil.distance(new SuperMap.Geometry.Point(e,o),new SuperMap.Geometry.Point(i,s))},SuperMap.Plot.PlottingUtil.clonePoints=function(t){let e=[];if(void 0===t||null===t)return e;if(SuperMap.Plot.PlottingUtil.isArray(t)||(t=[t]),t&&null!=t)for(let i=0;i1e-12&&--P>0;){var g=Math.sin(c),d=Math.cos(c),f=Math.sqrt(y*g*(y*g)+(u*h-p*y*d)*(u*h-p*y*d));if(0==f)return 0;var m=p*h+u*y*d,M=Math.atan2(f,m),b=Math.asin(u*y*g/f),T=Math.cos(b)*Math.cos(b),v=m-2*p*h/T,A=r/16*T*(4+r*(4-3*T));S=c,c=i+(1-A)*r*Math.sin(b)*(M+A*f*(v+A*m*(2*v*v-1)))}if(0==P)return NaN;var x=T*(n*n-a*a)/(a*a),_=x/1024*(256+x*(x*(74-47*x)-128));return(a*(1+x/16384*(4096+x*(x*(320-175*x)-768)))*(M-_*f*(v+_/4*(m*(2*v*v-1)-_/6*v*(4*f*f-3)*(4*v*v-3))))).toFixed(3)/1e3},SuperMap.Plot.PlottingUtil.destinationVincenty=function(t,e,i){var o,s,l=SuperMap.Plot.PlottingUtil,n=l.VincentyConstants,a=n.a,r=n.b,p=n.f;"undefined"!=typeof L&&void 0!==L.LatLng&&t instanceof L.LatLng?(o=t.lng,s=t.lat):(o=t.lon,s=t.lat);for(var u=i,h=l.rad(e),y=Math.sin(h),c=Math.cos(h),S=(1-p)*Math.tan(l.rad(s)),P=1/Math.sqrt(1+S*S),g=S*P,d=Math.atan2(S,c),f=P*y,m=1-f*f,M=m*(a*a-r*r)/(r*r),b=1+M/16384*(4096+M*(M*(320-175*M)-768)),T=M/1024*(256+M*(M*(74-47*M)-128)),v=u/(r*b),A=2*Math.PI;Math.abs(v-A)>1e-12;){var x=Math.cos(2*d+v),_=Math.sin(v),O=Math.cos(v);A=v,v=u/(r*b)+T*_*(x+T/4*(O*(2*x*x-1)-T/6*x*(4*_*_-3)*(4*x*x-3)))}var w=g*_-P*O*c,I=Math.atan2(g*O+P*_*c,(1-p)*Math.sqrt(f*f+w*w)),D=p/16*m*(4+p*(4-3*m)),E=Math.atan2(_*y,P*O-g*_*c)-(1-D)*p*f*(v+D*_*(x+D*O*(2*x*x-1)));return"undefined"!=typeof L&&void 0!==L.LatLng&&t instanceof L.LatLng?L.latLng(l.deg(I),o+l.deg(E)):new SuperMap.LonLat(o+l.deg(E),l.deg(I))};var H=SuperMap.Plot.Primitives=SuperMap.Plot.Primitives||{};SuperMap.Plot.Primitives={nSegmentCount:72,initialize:function(t){t&&t.nSegmentCount&&(this.nSegmentCount=t.nSegmentCount)},polyline:function(t){return t},parallelline:function(t){if(t&&t.length>=3){let e=SuperMap.Plot.PlottingUtil.distance(t[0],t[1]);SuperMap.Plot.PlottingUtil.isRight(t[0],t[1],t[2])&&(e=-e);let i=[];for(let e=1;e=3){let e=t[0].x+(t[2].x-t[1].x),i=t[0].y+(t[2].y-t[1].y),o=new SuperMap.Geometry.Point(e,i),s=[];return s.push.apply(s,t),s.push(o),s.push(s[0]),s}},polygon:function(t){if(t&&t.length>2)return t},circle:function(t){if(t&&2===t.length){let e=t[0],i=t[1],o=[],s=Math.sqrt((i.x-e.x)*(i.x-e.x)+(i.y-e.y)*(i.y-e.y)),l=360/this.nSegmentCount;for(let t=0;t=3){let e=this.getArcInfo(t[0],t[1],t[2]);e.dStartAngle*=Math.PI/180,e.dEndAngle*=Math.PI/180;let i=(e.dEndAngle-e.dStartAngle)/this.nSegmentCount,o=this.getArcSpatialData(e.pntCenter,e.dRadius,e.dRadius,0,e.dStartAngle,e.dEndAngle,i);if(o.push(e.pntCenter),0!==o.length)return o}},lune:function(t){if(t&&t.length>=3){let e=this.getArcInfo(t[0],t[1],t[2]);e.dStartAngle*=Math.PI/180,e.dEndAngle*=Math.PI/180;let i=(e.dEndAngle-e.dStartAngle)/this.nSegmentCount,o=this.getArcSpatialData(e.pntCenter,e.dRadius,e.dRadius,0,e.dStartAngle,e.dEndAngle,i);if(0!==o.length)return o}},arc:function(t){if(t&&t.length>=3){let e=this.getArcInfo(t[0],t[1],t[2]);e.dStartAngle*=Math.PI/180,e.dEndAngle*=Math.PI/180;let i=(e.dEndAngle-e.dStartAngle)/this.nSegmentCount,o=this.getArcSpatialData(e.pntCenter,e.dRadius,e.dRadius,0,e.dStartAngle,e.dEndAngle,i);if(0!==o.length)return o}},ellipse:function(t,e,i,o,s){if(!0===i){if((!o||null==o)&&t&&t.length>=3&&(o=SuperMap.Plot.PlottingUtil.distance(t[0],t[1])),(!s||null==s)&&t&&t.length>=3){let e=SuperMap.Plot.PlottingUtil.projectPoint(t[2],t[0],t[1]);s=SuperMap.Plot.PlottingUtil.distance(e,t[2])}}else s=SuperMap.Plot.PlottingUtil.distance(t[0],t[2]),o=SuperMap.Plot.PlottingUtil.distance(t[0],t[1]);if(e&&null!=e?e*=Math.PI/180:e=SuperMap.Plot.PlottingUtil.radian(t[0],t[1]),t&&t.length>0){let l=0,n=2*Math.PI,a=n/this.nSegmentCount,r=this.getArcSpatialData(t[0],o,s,e,l,n,a);if(!0===i){let i=Math.sin(e),o=Math.cos(e);t[2].x>t[1].x?(t[2].x=t[0].x-s*i,t[2].y=t[0].y+s*o):(t[2].x=t[0].x+s*i,t[2].y=t[0].y-s*o)}return r}},getArcSpatialData:function(t,e,i,o,s,l,n){let a=[];if(Math.abs(n)<1e-9)return a;for(;ls+2*Math.PI;)s+=2*Math.PI;let r=Math.cos(o)*e,p=Math.sin(o)*e,u=Math.cos(o)*i,h=Math.sin(o)*i,y=this.calcEllipseRadian(s,e,i),c=this.calcEllipseRadian(l,e,i);c-y<1e-5&&(c+=2*Math.PI);let S=Math.round(Math.abs((c-y)/n)+1);if(S<2)return a;for(var P=0;Pa.length&&(a[a.length-1].x=t.x+r*Math.cos(c)-h*Math.sin(c),a[a.length-1].y=t.y+p*Math.cos(c)+u*Math.sin(c)),a},getArcInfo:function(t,e,i){let o={};o.pntCenter=new SuperMap.Geometry.Point(0,0),o.dRadius=0,o.dStartAngle=0,o.dEndAngle=0;let s=e.x-t.x,l=e.y-t.y;if(Math.abs(s)<1e-9){let s={},l={};s.x=(e.x+t.x)/2,s.y=(e.y+t.y)/2,l.x=(e.x+i.x)/2,l.y=(e.y+i.y)/2;let n=0;Math.abs(i.x-e.x)>=1e-9&&(n=(i.y-e.y)/(i.x-e.x)),o.pntCenter.y=s.y,Math.abs(n)<1e-9?o.pntCenter.x=l.x:o.pntCenter.x=l.x-n*(s.y-l.y)}else{let n={},a={};n.x=(e.x+t.x)/2,n.y=(e.y+t.y)/2,a.x=(e.x+i.x)/2,a.y=(e.y+i.y)/2;let r=l/s,p=1;Math.abs(r)<1e-9?(o.pntCenter.x=n.x,Math.abs(i.x-e.x<1e-9)?o.pntCenter.y=a.y:o.pntCenter.y=-(i.x-e.x)/(i.y-e.y)*(o.pntCenter.x-a.x)+a.y):Math.abs(i.x-e.x)<1e-9?(o.pntCenter.y=a.y,o.pntCenter.x=-r*(o.pntCenter.y-n.y)+n.x):(p=(i.y-e.y)/(i.x-e.x),o.pntCenter.x=(r*p*(n.y-a.y)+p*n.x-r*a.x)/(p-r),o.pntCenter.y=(a.x-n.x+p*a.y-r*n.y)/(p-r))}let n=Math.atan2(t.y-o.pntCenter.y,t.x-o.pntCenter.x),a=Math.atan2(i.y-o.pntCenter.y,i.x-o.pntCenter.x);if(SuperMap.Plot.PlottingUtil.isCounterClockwise(t,e,i)){for(;n>=2*Math.PI;)n-=2*Math.PI;for(;n<0;)n+=2*Math.PI;for(;a>2*Math.PI;)a-=2*Math.PI;for(;a=2*Math.PI;)a-=2*Math.PI;for(;a<0;)a+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;for(;a>n;)n+=2*Math.PI;let t=n;n=a,a=t}return o.dRadius=Math.sqrt((o.pntCenter.x-t.x)*(o.pntCenter.x-t.x)+(o.pntCenter.y-t.y)*(o.pntCenter.y-t.y)),o.dEndAngle=180*a/Math.PI,o.dStartAngle=180*n/Math.PI,o},calcEllipseRadian:function(t,e,i){let o=t,s=e*Math.sin(t),l=i*Math.cos(t),n=Math.atan2(s,l);if(t>Math.PI)for(;o>Math.PI;)o-=2*Math.PI,n+=2*Math.PI;else if(t<-Math.PI)for(;o<-Math.PI;)o+=2*Math.PI,n-=2*Math.PI;return n},getKendyShapePts:function(t){let e=[];if(2>(t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length)return e;let i=this.calcShapePoints(t);if(12!=i.length)return e;i.push(i[0]),i.push(i[1]),i.splice(0,1);for(let t=0;t=l&&n>=a){let t=i.clone();i=s.clone(),s=t.clone()}else if(a>=l&&a>=n){let t=s.clone();s=o.clone(),o=t.clone()}if(!SuperMap.Plot.PlottingUtil.isRight(s,i,o)){let t=i.clone();i=o.clone(),o=t.clone()}e[0]=i,e[1]=o,e[2]=s}return e},GetPtsByTriangle:function(t,e,i,o,s){let l=new SuperMap.Geometry.Point(0,0),n=0,a=0;return n=SuperMap.Plot.PlottingUtil.distance(s,i),a=SuperMap.Plot.PlottingUtil.distance(o,s),1==e&&(n*=2),2==e&&(a*=2),l.x=(n*o.x+a*i.x)/(n+a),l.y=(n*o.y+a*i.y)/(n+a),{pl:this.GetWhichPtOfNormal(t,i,l,s),pr:this.GetWhichPtOfNormal(t,o,l,s)}},GetWhichPtOfNormal:function(t,e,i,o){let s,l=0,n=0;n=SuperMap.Plot.PlottingUtil.distance(o,e)/t;let a=this.GetPointsOfNormal(n,i,o);return s=(l=SuperMap.Plot.PlottingUtil.distance(e,a.pt4))>=(n=SuperMap.Plot.PlottingUtil.distance(e,a.pt3))?a.pt3:a.pt4},getBezierPtsWithScalePts:function(t,e,i,o){let s=[],l=t.x,n=t.y,a=e.x,r=e.y,p=i.x,u=i.y,h=o.x,y=o.y;if(SuperMap.Plot.PlottingUtil.equalFuzzy(l,a,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(n,r,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(p,h,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(u,y,1e-10))s.push(new SuperMap.Geometry.Point(l,n)),s.push(new SuperMap.Geometry.Point(p,u));else for(let t=0;t<=1;t+=.03125){let e,i,o,c,S=t*t,P=S*t;e=1-3*t+3*S-P,i=3*(t-2*S+P),o=3*(S-P),c=P;let g=new SuperMap.Geometry.Point(e*l+i*a+o*p+c*h,e*n+i*r+o*u+c*y);s.push(g)}return s},getSpatialData:function(t,e,i,o){switch(null==o&&(o=!0),t){case 24:return this.polyline(e);case 390:return this.kidney(e,o);case 590:return this.bezier(e,o);case 360:return this.loopbezier(e,o);case 28:return this.parallelogram(e);case 32:return this.polygon(e);case 29:return this.circle(e);case 26:return this.rectangle(e);case 380:return this.sector(e);case 370:return this.lune(e);case 44:return this.arc(e);case 31:return this.ellipse(e,i,o);case 48:return this.parallelline(e);default:return e}}};var X=SuperMap.Plot.RouteNodePrimitives=SuperMap.Plot.RouteNodePrimitives||{};SuperMap.Plot.RouteNodePrimitives={initialize:function(){},rendezvousPoint:function(){let t=[],e=new Object;e.type=SuperMap.Plot.SymbolType.CIRCLESYMBOL,e.positionPoints=[],e.positionPoints.push(new SuperMap.Geometry.Point(0,0)),e.positionPoints.push(new SuperMap.Geometry.Point(0,30)),e.style={surroundLineFlag:!1,fillLimit:!0,fill:!1};let i=new Object;return i.type=SuperMap.Plot.SymbolType.TEXTSYMBOL,i.positionPoints=[],i.positionPoints.push(new SuperMap.Geometry.Point(0,0)),i.textContent="会",i.style={surroundLineFlag:!1,fontSize:14,fontSizeLimit:!0},i.style.labelAlign="cm",t.push(i),t.push(e),t},expandingPoint:function(){let t=[],e=new Object;e.type=SuperMap.Plot.SymbolType.CIRCLESYMBOL,e.positionPoints=[],e.positionPoints.push(new SuperMap.Geometry.Point(0,0)),e.positionPoints.push(new SuperMap.Geometry.Point(0,30)),e.style={surroundLineFlag:!1,fillLimit:!0,fill:!1};let i=new Object;return i.type=SuperMap.Plot.SymbolType.TEXTSYMBOL,i.positionPoints=[],i.positionPoints.push(new SuperMap.Geometry.Point(0,0)),i.textContent="展",i.style={surroundLineFlag:!1,fontSize:14,fontSizeLimit:!0},i.style.labelAlign="cm",t.push(i),t.push(e),t},volleyPoint:function(){let t=[],e=new Object;e.type=SuperMap.Plot.SymbolType.CIRCLESYMBOL,e.positionPoints=[],e.positionPoints.push(new SuperMap.Geometry.Point(0,0)),e.positionPoints.push(new SuperMap.Geometry.Point(0,30)),e.style={surroundLineFlag:!1,fillLimit:!0,fill:!1};let i=new Object;return i.type=SuperMap.Plot.SymbolType.TEXTSYMBOL,i.positionPoints=[],i.positionPoints.push(new SuperMap.Geometry.Point(0,0)),i.textContent="齐",i.style={surroundLineFlag:!1,fontSize:14,fontSizeLimit:!0},i.style.labelAlign="cm",t.push(i),t.push(e),t},standbyPoint_Outer:function(t,e){let i=[],o=new SuperMap.Geometry.Point(0,0),s=new SuperMap.Geometry.Point(0,30);t||(t=90);let l=new Object;l.type=SuperMap.Plot.SymbolType.POLYLINESYMBOL,l.positionPoints=[];for(let e=t+10;e<170+t;e+=10){let t=SuperMap.Plot.PlottingUtil.findPoint(o,s,30,e);l.positionPoints.push(t)}l.style={surroundLineFlag:!1,fillLimit:!0,fill:!1},i.push(l);let n=l.positionPoints[l.positionPoints.length-1],a=l.positionPoints[l.positionPoints.length-2],r=SuperMap.Plot.PlottingUtil.findPoint(n,a,9,22.5),p=SuperMap.Plot.PlottingUtil.findPoint(n,a,9,-22.5),u=new Object;u.type=SuperMap.Plot.SymbolType.POLYLINESYMBOL,u.positionPoints=[],u.positionPoints.push(r),u.positionPoints.push(n.clone()),u.positionPoints.push(p),u.style={surroundLineFlag:!1,fillLimit:!0,fill:!1},i.push(u);let h=new Object;h.type=SuperMap.Plot.SymbolType.POLYLINESYMBOL,h.positionPoints=[];for(let e=190+t;e<350+t;e+=10){let t=SuperMap.Plot.PlottingUtil.findPoint(o,s,30,e);h.positionPoints.push(t)}h.style={surroundLineFlag:!1,fillLimit:!0,fill:!1},i.push(h);let y=h.positionPoints[h.positionPoints.length-1],c=h.positionPoints[h.positionPoints.length-2],S=SuperMap.Plot.PlottingUtil.findPoint(y,c,9,22.5),P=SuperMap.Plot.PlottingUtil.findPoint(y,c,9,-22.5),g=new Object;g.type=SuperMap.Plot.SymbolType.POLYLINESYMBOL,g.positionPoints=[],g.positionPoints.push(S),g.positionPoints.push(y.clone()),g.positionPoints.push(P),g.style={surroundLineFlag:!1,fillLimit:!0,fill:!1},i.push(g);for(let t=0;t1&&t.push(s),s=[],e=n.GetX(),i=n.GetY(),s.push(new SuperMap.Geometry.Point(e,i));break;case 1:e=n.GetX(),i=n.GetY(),s.push(new SuperMap.Geometry.Point(e,i));break;case 2:if(3!=o.elements[M+1].GetType()||3!=o.elements[M+1].GetType())break;var a=o.elements[M-1].GetX(),r=o.elements[M-1].GetY(),p=n.GetX(),u=n.GetY(),h=o.elements[M+1].GetX(),y=o.elements[M+1].GetY(),c=o.elements[M+2].GetX(),S=o.elements[M+2].GetY();for(let t=0;t<=1;t+=.03125){var P=t*t,g=P*t,d=1-3*t+3*P-g,f=3*(t-2*P+g),m=3*(P-g),L=g;s.push(new SuperMap.Geometry.Point(d*a+f*p+m*h+L*c,d*r+f*u+m*y+L*S))}M+=2}}return s.length>1&&t.push(s),!0}ensureData(){null==this.m_pData&&this.ensureData_helper()}ensureData_helper(){var t=new SuperMap.Plot.Path2DData,e=new SuperMap.Plot.Element(0,0,0);t.elements.push(e),null==this.m_pData||this.mtDeRef(this.m_pData.ref)||(this.m_pData=null),this.m_pData=t}detach(){1!=this.m_pData.ref&&this.detach_helper(),this.setBoundsDirty(!0)}detach_helper(){var t=new SuperMap.Plot.Path2DData;null==this.m_pData||this.mtDeRef(this.m_pData.ref)||(this.m_pData=null),this.m_pData=t}setBoundsDirty(t){this.getDataPtr().isBoundsDirty=t}getDataPtr(){return this.m_pData}IsEmpty(){if(null==this.m_pData)return!0;var t=this.m_pData.elements.length;return 0==t||1==t&&0==this.m_pData.elements[0].GetType()}GetElementCount(){return null!=this.m_pData?this.m_pData.elements.length:0}static mtRef(t){return 0!=++t}static mtDeRef(t){return 0!=--t}};SuperMap.Plot.Element=class{constructor(t,e,i){this.m_x=t,this.m_y=e,this.m_type=i,this.CLASS_NAME="SuperMap.Plot.Element"}GetX(){return this.m_x}GetY(){return this.m_y}GetType(){return this.m_type}GetPosition(){return SuperMap.Geometry.Point(this.m_x,this.m_y)}SetPosition(t,e){this.m_x=t,this.m_y=e}SetType(t){this.m_type=t}IsCurveTo(){return 2==this.m_type}IsLineTo(){return 1==this.m_type}IsMoveTo(){return 0==this.m_type}Equal(t){return SuperMap.Plot.PlottingUtil.equalFuzzy(this.m_x,t.m_x,1e-10)&&SuperMap.Plot.PlottingUtil.equalFuzzy(this.m_y,t.m_y,1e-10)&&this.m_type==t.m_type}clone(){return new SuperMap.Plot.Path2D.Element(this.m_x,this.m_y,this.m_type)}};SuperMap.Plot.Path2DData=class{constructor(t){if(t){this.cStart=t.cStart,this.fillRule=t.fillRule,this.require_StartNewFigure=t.require_StartNewFigure,this.isBoundsDirty=t.isBoundsDirty,this.bounds=new SuperMap.Bounds(t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top),this.ref=1,this.elements=[];for(let e=0;e2){var r=t.length;t.splice(2,r-2)}var p=SuperMap.Plot.PlottingUtil.polylineDistance(t);o.arrowTouLen=p*s;var u=SuperMap.Plot.PlottingUtil.findPointInPolyLine(t,p-o.arrowTouLen).pt,h=[],y=o.arrowTouLen*n,c=o.arrowTouLen*l,S=t.length-1;for(let e=0;et.length)return s;var l,n=SuperMap.Plot.PlottingUtil.polylineDistance(t),a=SuperMap.Plot.PlottingUtil.equalFuzzy(e,0);switch(i){case SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_POLYLINE:s=s.concat(t),o&&!a&&SuperMap.Plot.PlottingUtil.distance(t[t.length-1],t[t.length-2])>e&&(l=SuperMap.Plot.PlottingUtil.findPointInPolyLine(t,n-e),s.splice(s.length-1,1),s.push(l.pt));break;case SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_POLYBEZIER:if(2==t.length)s=s.concat(t),o&&!a&&SuperMap.Plot.PlottingUtil.distance(t[t.length-1],t[t.length-2])>e&&(l=SuperMap.Plot.PlottingUtil.findPointInPolyLine(t,n-e),s.splice(s.length-1,1),s.push(l.pt));else{var r=SuperMap.Plot.PlottingUtil.generateBeizerPointsNoCtrlPt(t);if(a)s=s.concat(r);else{var p=r[r.length-1];if(!a&&(e1;u--){if(!(e>SuperMap.Plot.PlottingUtil.distance(p,r[u]))){var h=SuperMap.Plot.PlottingUtil.findPoint(p,r[u],e,0);r.push(h),s=r;break}r.splice(u,1)}o||s.push(p)}else s=s.concat(r)}}break;case SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_COATTAIL:var y=e;if(y>n)return s;var c,S,P=Math.ceil(n/(1.4*y)),g=0,d=[];for(let e=0;et.length)return o;switch(i){case SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_POLYLINE:{let i=t[0],s=t[1],l=SuperMap.Plot.PlottingUtil.distance(i,s);if(SuperMap.Plot.PlottingUtil.equalFuzzy(l,e,1e-7)||l>e){let l=SuperMap.Plot.PlottingUtil.findPoint(i,s,e,0),n=e*Math.tan(.125*Math.PI),a=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(n,t[0],l);o.push(a.pntLeft),o.push(t[0]),o.push(a.pntRight)}break}case SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_TRIANGLE:break;case SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_TRIANGLE_SOLID:{let i=t[0],s=t[1],l=SuperMap.Plot.PlottingUtil.distance(i,s);if(SuperMap.Plot.PlottingUtil.equalFuzzy(l,e,1e-7)||l>e){let l=e*Math.tan(.125*Math.PI),n=SuperMap.Plot.PlottingUtil.findPoint(i,s,e,0),a=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(l,t[0],n);o.push(a.pntLeft),o.push(i),o.push(a.pntRight),o.push(a.pntLeft)}break}case SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_COATTAIL:{let i=t[0],s=2*Math.sqrt(e*e/3),l=SuperMap.Plot.PlottingUtil.distance(t[0],t[1]);if(SuperMap.Plot.PlottingUtil.equalFuzzy(s/2,l,1e-7)||l>s/2){let e=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],s,20),l=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],s,-20),n=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],s/2,0);o.push(i),o.push(e),o.push(n),o.push(l),o.push(i)}break}case SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_COATTAIL_HOLLOW:{var s=[];let i=t[0],h=2*Math.sqrt(e*e/3),y=SuperMap.Plot.PlottingUtil.distance(t[0],t[1]);if(SuperMap.Plot.PlottingUtil.equalFuzzy(h/1.4,y,1e-7)||y>h/1.4){let e=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],h,20),y=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],h,-20),c=SuperMap.Plot.PlottingUtil.findPoint(t[0],t[1],h/1.4,0);s.push(i),s.push(e),s.push(c),s.push(y),s.push(i);var l=new SuperMap.Geometry.Point((s[0].x+s[1].x)/2,(s[0].y+s[1].y)/2),n=new SuperMap.Geometry.Point((s[3].x+s[4].x)/2,(s[3].y+s[4].y)/2),a=new SuperMap.Geometry.Point((l.x+n.x)/2,(l.y+n.y)/2),r=.75*SuperMap.Plot.PlottingUtil.distance(l,n)/2,p=SuperMap.Plot.PlottingUtil.findPointInLine(a,l,r),u=SuperMap.Plot.PlottingUtil.findPointInLine(a,n,r);o.push(s[0]),o.push(p),o.push(s[1]),o.push(s[2]),o.push(s[3]),o.push(u),o.push(s[4])}break}}return o},SuperMap.Plot.ArrowToolkit.generateArrowTailShapePts=function(t,e,i,o){var s=e.length,l=[],n=0;for(let e=0;e0&&g>0){var f=1/(c-t[2].x),m=-1/(S-t[2].y),L=1*t[2].y/(S-t[2].y)-1*t[2].x/(c-t[2].x);d=Math.abs(f*t[0].x+m*t[0].y+L)/Math.sqrt(f*f+m*m)}else g<=1e-4?d=Math.abs(S-t[1].y):P<=1e-4&&(d=Math.abs(c-t[1].x));var M=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(d,t[2],new SuperMap.Geometry.Point(c,S)),b=SuperMap.Plot.PlottingUtil.pointIsRightToLine(t[1],t[2],t[0]);b?(l[1]=t[1],n[1]=t[0]):(l[1]=t[0],n[1]=t[1]),t[1]=new SuperMap.Geometry.Point((t[0].x+t[1].x)/2,(t[0].y+t[1].y)/2);var T=Math.sqrt((M.pntLeft.x-M.pntRight.x)*(M.pntLeft.x-M.pntRight.x)+(M.pntLeft.y-M.pntRight.y)*(M.pntLeft.y-M.pntRight.y))*SuperMap.Plot.ArrowToolkit.ConstValue.sv_AtWidthDivAwWidth,v=(s=T*SuperMap.Plot.ArrowToolkit.ConstValue.sv_AtLenDivAtWidth)*y;SuperMap.Plot.PlottingUtil.equalFuzzy(h,0)||(v=(s=o*h)*y);var A,x,_=SuperMap.Plot.PlottingUtil.distance(t[e],t[e-1]),O=2*s;_0&&(t[e]=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(s,t[e],C)),D=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(v,t[e+1],t[e]),(b=SuperMap.Plot.PlottingUtil.pointIsRightToLine(t[e],t[e+1],D.pntLeft))?(n[e]=new SuperMap.Geometry.Point(D.pntLeft.x,D.pntLeft.y),l[e]=new SuperMap.Geometry.Point(D.pntRight.x,D.pntRight.y)):(n[e]=new SuperMap.Geometry.Point(D.pntRight.x,D.pntRight.y),l[e]=new SuperMap.Geometry.Point(D.pntLeft.x,D.pntLeft.y)),w=2;w=2&&this.controlPoints.length=this.minEditPts){var e={textContent:this.textContent,type:this.symbolType,surroundLineFlag:!1,positionPoints:t,style:{}};if(e.type===SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL&&e.positionPoints.push(e.positionPoints[0]),this.symbolType===SuperMap.Plot.SymbolType.PARALLELLINE){if(this.controlPoints&&this.controlPoints.length>=3){var i=!1;void 0!==this.controlPoints[0].z&&(i=!0);var o=SuperMap.Plot.PlottingUtil.distance(this.controlPoints[0],this.controlPoints[1]);SuperMap.Plot.PlottingUtil.isRight(this.controlPoints[0],this.controlPoints[1],this.controlPoints[2])&&(o=-o);var s=[];for(let t=1;t=r){var u=s.split("");s="";var h=1,y=0;this.style.weight?y=parseFloat(this.style.fontSize)+2*this.style.weight+.2*parseFloat(this.style.fontSize)+h:this.style.strokeWidth&&(y=parseFloat(this.style.fontSize)+2*this.style.strokeWidth+.2*parseFloat(this.style.fontSize)+h);var c="";for(let t=0,e=u.length;t=r){var S=u[t];if(u[t]="\n",h++,this.style.weight?y=parseFloat(this.style.fontSize)*h+h+2*this.style.weight+.2*parseFloat(this.style.fontSize):this.style.strokeWidth&&(y=parseFloat(this.style.fontSize)*h+h+2*this.style.strokeWidth+.2*parseFloat(this.style.fontSize)),!(y.5)return o.startIndex=0,o.startPt=t[0],o.endIndex=t.length-1,o.endPt=t[t.length-1],o;null==i&&(i=.5);var s=SuperMap.Plot.PlottingUtil.polylineDistance(t),l=SuperMap.Plot.PlottingUtil.getPtsIndexByDistance(s*(i-e),t),n=SuperMap.Plot.PlottingUtil.getPtsIndexByDistance(s*(i+e),t);return o.startIndex=l.index,o.startPt=l.pts,o.endIndex=n.index,o.endPt=n.pts,o}computeDashLine(t,e,i){var o=[],s=SuperMap.Plot.PlottingUtil.polylineDistance(i);if(s<=0)return[];for(var l,n=i[0],a=1,r=0,p=!0,u=!0;r2){var r=-1;for(let e=t.length-2;e>=0;e--)if(i1){SuperMap.Plot.PlottingUtil.distance(t[t.length-1],t[t.length-2])>a&&(l=SuperMap.Plot.PlottingUtil.getPtsIndexByDistance(a,[t[t.length-1],t[t.length-2]])).bfind&&(t.splice(t.length-1,1),t.push(l.pts)),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,t);var p=t[t.length-1],u=n,h=i;if(void 0===p)return t;var y=SuperMap.Plot.PlottingUtil.radian(p,u)*SuperMap.Plot.PlottingUtil.RTOD,c=SuperMap.Plot.PlottingUtil.circlePoint(u,h,h,y+157.5),S=SuperMap.Plot.PlottingUtil.circlePoint(u,h,h,y+202.5),P={surroundLineFlag:!1,fillLimit:!0,fillColorLimit:!1,fill:!0,lineTypeLimit:!0,surroundLineLimit:!0,surroundLineType:SuperMap.Plot.AlgoSurroundLineType.NONE};this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,[c,n,S],P)}else this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,s)}addDovetailArrow(t,e){if(t.length<2)return t;var i,o=SuperMap.Plot.PlottingUtil.polylineDistance(this.controlPoints);void 0===e&&(this.isEdit,e=.5*this.getSubSymbolScaleValue()),i=o*e;var s=t[t.length-1];if(t.length>2){var l=-1;for(let e=t.length-2;e>=0;e--)if(ie||o<=0)&&(o=e),o}computeSubSymbol(t,e,i,o,s,l){if(null==t.symbolData||null==t.symbolData.innerCells)return null;void 0===s&&(s=0),void 0===l&&(l=0);var n=SuperMap.Plot.AnalysisSymbol.analysisSymbolCells(t.symbolData,!0),a=0,r=0,p=0,u=0;for(let t=0;th[t].x&&(p=h[t].x),u>h[t].y&&(u=h[t].y)}var y=new SuperMap.Geometry.Point(a,r),c=new SuperMap.Geometry.Point(p,u),S=(y.y-c.y)/i,P=(y.x-c.x)/i,g=P>S?P:S,d=new SuperMap.Geometry.Point(.5*(y.x+c.x),.5*(y.y+c.y));d.x+=s*(y.x-c.x),d.y+=l*(y.y-c.y);for(let t=0,i=n.length;t=l)return i.z;if(a>=l)return e.z}return s.x!=e.x&&e.x!=i.x?e.z+(s.x-e.x)/(e.x-i.x)*(e.z-i.z):s.y!=e.y&&e.y!=i.y?e.z+(s.y-e.y)/(e.y-i.y)*(e.z-i.z):0==(n=SuperMap.Plot.PlottingUtil.distance(e,s))?e.z:e.z-(e.z-i.z)*(n/l)}ComputeBeizerZValueByDis(t,e,i){if(t.length<2)return!1;var o=[];for(let e=0;e2?SuperMap.Plot.PlottingUtil.radian(e[e.length-1],e[e.length-2]):SuperMap.Plot.PlottingUtil.radian(e[1],e[0]))-l,a=e[e.length-1].x+s*Math.cos(n),r=e[e.length-1].y+s*Math.sin(n),p=new SuperMap.Geometry.Point(a,r),u=o+l,h=e[e.length-1].x+s*Math.cos(u),y=e[e.length-1].y+s*Math.sin(u),c=new SuperMap.Geometry.Point(h,y),S=[];S.push(p),S.push(e[e.length-1].clone()),S.push(c);var P={surroundLineFlag:!1,fillLimit:!0,lineTypeLimit:!0},g=SuperMap.Plot.PlottingUtil.radian(e[0],e[1]);n=g-l,a=e[0].x+s*Math.cos(n),r=e[0].y+s*Math.sin(n),p=new SuperMap.Geometry.Point(a,r),u=g+l,h=e[0].x+s*Math.cos(u),y=e[0].y+s*Math.sin(u),c=new SuperMap.Geometry.Point(h,y);var d=[];d.push(p),d.push(e[0].clone()),d.push(c);var f=this.scaleValues[1]===SuperMap.Plot.ArrowLineType.DOUBLELINE?SuperMap.Plot.SymbolType.POLYLINESYMBOL:SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,m=this.scaleValues[2]===SuperMap.Plot.ArrowLineType.DOUBLELINE?SuperMap.Plot.SymbolType.POLYLINESYMBOL:SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL;this.scaleValues[1]===SuperMap.Plot.ArrowLineType.DOUBLELINE?this.addCell(f,d,P):this.scaleValues[1]===SuperMap.Plot.ArrowLineType.TRIANGLESOLID&&this.addCell(f,d,P),this.scaleValues[2]===SuperMap.Plot.ArrowLineType.DOUBLELINE?this.addCell(m,S,P):this.scaleValues[2]===SuperMap.Plot.ArrowLineType.TRIANGLESOLID&&this.addCell(m,S,P),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,e),this.finish()}}};SuperMap.Plot.RegularPolygon=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&this.scaleValues.push(1),this.CLASS_NAME="SuperMap.Plot.RegularPolygon"}calculateParts(){if(this.init(),!(this.controlPoints.length0&&t<.4&&(this.scaleValues[0]=t)}else if(1==t){var s=new SuperMap.Geometry.Point((i[0].x+i[1].x)/2,(i[0].y+i[1].y)/2);let t=SuperMap.Plot.PlottingUtil.distance(e,s)/o;0t&&(this.scaleValues[1]=t)}}this.calculateParts()}};SuperMap.Plot.Trapezoid=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.CLASS_NAME="SuperMap.Plot.Trapezoid"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length>=2&&t.lengthi.x&&a.xi.y&&a.yo.x||a.yo.y)&&(e[0]=l,e[3]=i),4==e.length&&this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,e)}}GetPointsByTrapezoid(t,e,i,o,s){var l=e.x,n=e.y,a=i.x,r=i.y,p=o.x,u=o.y,h=0,y=0,c=0,S=0;if(SuperMap.Plot.PlottingUtil.equalFuzzy(Math.abs(n-r),0))h=l+a-p,y=u;else if(SuperMap.Plot.PlottingUtil.equalFuzzy(Math.abs(l-a),0))h=p,y=n+r-u;else{var P=1*(n-r)/(l-a),g=u-P*p;y=P*(h=((r+n)/2+(l+a)/(2*P)-g)/(P+1/P))+g,h=2*h-p,y=2*y-u}var d=Math.sqrt(1*(l-a)*(l-a)+1*(n-r)*(n-r)),f=Math.sqrt(1*(l-h)*(l-h)+1*(n-y)*(n-y));d>0?(c=l+(a-l)*f/d,S=n+(r-n)*f/d):(c=l,S=n);var m=c+(h-c)*t,L=S+(y-S)*t;s.x=m,s.y=L}};SuperMap.Plot.GeoTooltipBox=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&this.scaleValues.push(.126),this.CLASS_NAME="SuperMap.Plot.GeoTooltipBox"}destroy(){super.destroy()}calculateParts(){this.init();var t=this.scaleValues[0];if(!(t<0||t>1)){if(t=(1-t)/2,this.controlPoints.length>=this.minEditPts){var e,i,o,s,l,n;this.controlPoints[2]&&(this.controlPoints[2].isFixedPos=!0),this.controlPoints[0].xi?Math.abs((n-i)/(l-e))>r?2:1:nr?4:1:l>o?n>i?Math.abs((n-i)/(l-o))>r?2:3:nr?4:3:n>i?2:no?Math.abs((a-o)/(n-i))>p?2:1:ap?4:1:n>s?a>o?Math.abs((a-o)/(n-s))>p?2:3:ap?4:3:a>o?2:ao&&(h=o),h<(o+l)/2&&(h=(o+l)/2),u=1-2*(o-h)/(o-l);break;case 2:case 4:var y=r.x+(e.x-r.x);y>s&&(y=s),y<(i+s)/2&&(y=(i+s)/2),u=1-2*(s-y)/(s-i)}u<0&&(u=0),u>1&&(u=1),this.scaleValues[0]=u}this.calculateParts()}};SuperMap.Plot.GeoTooltipBoxM=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&(this.scaleValues.push(0),this.scaleValues.push(0),this.scaleValues.push(0),this.scaleValues.push(0)),this.CLASS_NAME="SuperMap.Plot.GeoTooltipBoxM"}destroy(){super.destory()}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length>=this.minEditPts){var e,i,o,s;t[0].xo?Math.abs((e-o)/(t-i))>n?2:1:en?4:1:t>s?e>o?Math.abs((e-o)/(t-s))>n?2:3:en?4:3:e>o?2:e1)){if(t=(1-t)/2,this.controlPoints.length>=this.minEditPts){var e,i,o,s;this.scalePoints=[];var l=[];this.controlPoints[0].x=2&&this.controlPoints.lengtho?Math.abs((a-o)/(n-i))>p?2:1:ap?4:1:n>s?a>o?Math.abs((a-o)/(n-s))>p?2:3:ap?4:3:a>o?2:ao&&(h=o),h<(o+l)/2&&(h=(o+l)/2),u=1-2*(o-h)/(o-l);break;case 2:case 4:var y=r.x+(e.x-r.x);y>s&&(y=s),y<(i+s)/2&&(y=(i+s)/2),u=1-2*(s-y)/(s-i)}u<0&&(u=0),u>1&&(u=1),this.scaleValues[0]=u}this.calculateParts()}calculateArc(t,e,i,o,s,l){(!s||1!=s&&-1!=s)&&(s=-1),l||(l=360);var n=Math.PI/l/2,a=n*s,r=Math.abs(o-i),p=[];for(let o=i,s=0;s2*Math.PI?o-2*Math.PI:o}return p}getAction(t,e,i,o,s,l){var n=(o-l)/(s-i);return to?Math.abs((e-o)/(t-i))>n?2:1:en?4:1:t>s?e>o?Math.abs((e-o)/(t-s))>n?2:3:en?4:3:e>o?2:e360;)this.scaleValues[0]-=360;for(;this.scaleValues[0]<0;)this.scaleValues[0]+=360;for(;this.scaleValues[1]>360;)this.scaleValues[1]-=360;for(;this.scaleValues[1]<0;)this.scaleValues[1]+=360;for(;this.scaleValues[1]<=this.scaleValues[0];)this.scaleValues[1]+=360;var e=SuperMap.Plot.PlottingUtil.distance(t[0],t[1]),i=SuperMap.Plot.PlottingUtil.distance(t[0],t[2]),o=[],s=[],l=Math.PI/180,n=(this.scaleValues[1]-this.scaleValues[0])/72;for(let h=this.scaleValues[0];h=0;t--)h.push(s[t]);this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,h,{surroundLineFlag:!1,lineWidthLimit:!0,weight:0,strokeWidth:0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,o),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,s);var y=t[0].x+e/2*Math.cos(this.scaleValues[0]*l),c=t[0].y+e/2*Math.sin(this.scaleValues[0]*l),S=t[0].x+i/2*Math.cos(this.scaleValues[1]*l),P=t[0].y+i/2*Math.sin(this.scaleValues[1]*l),g=new SuperMap.Geometry.Point(y,c);g.isScalePoint=!0,g.tag=0,this.addScalePoint(g);var d=new SuperMap.Geometry.Point(S,P);d.isScalePoint=!0,d.tag=1,this.addScalePoint(d)}}modifyPoint(t,e){if(!0===e.isScalePoint){for(var i=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints),o=180*SuperMap.Plot.PlottingUtil.radian(i[0],e)/Math.PI;o>360;)o-=360;for(;o<0;)o+=360;0==t?this.scaleValues[0]=o:1==t&&(this.scaleValues[1]=o)}this.calculateParts()}};SuperMap.Plot.CombinationalCircle=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.angleRange=[],this.defaultRadius=t.defaultRadius?t.defaultRadius:60,this.CLASS_NAME="SuperMap.Plot.CombinationalCircle"}calculateParts(){if(this.init(),this.controlPoints=SuperMap.Plot.PlottingUtil.clearSamePts(this.controlPoints),!(null==this.controlPoints||this.controlPoints.length<1)){var t=this.getCircleLonLat(this.controlPoints[0],this.defaultRadius);this.angleRange=[];for(let e=0;eMath.abs(this.scaleValues[t]-this.scaleValues[p]))for(let u=0;u<2;u++){var o,s,l;0==u?(l=t,o=SuperMap.Plot.PlottingUtil.radian(e[t],e[p])*SuperMap.Plot.PlottingUtil.RTOD,s=Math.acos((i*i+this.scaleValues[t]*this.scaleValues[t]-this.scaleValues[p]*this.scaleValues[p])/(2*i*this.scaleValues[t]))*SuperMap.Plot.PlottingUtil.RTOD):(l=p,o=SuperMap.Plot.PlottingUtil.radian(e[p],e[t])*SuperMap.Plot.PlottingUtil.RTOD,s=Math.acos((i*i+this.scaleValues[p]*this.scaleValues[p]-this.scaleValues[t]*this.scaleValues[t])/(2*i*this.scaleValues[p]))*SuperMap.Plot.PlottingUtil.RTOD);var n=o-s,a=o+s,r=n<0&&a>0||n>360||a>360;n=this.adjustAngle(n),a=this.adjustAngle(a);for(let t=this.angleRange[l].length-1;t>=0;t--)if(r){if(a>this.angleRange[l][t].End||SuperMap.Plot.PlottingUtil.equalFuzzy(a,this.angleRange[l][t].End)){this.angleRange[l].splice(t,1);continue}if(a>this.angleRange[l][t].Start&&(this.angleRange[l][t].Start=a),nthis.angleRange[l][t].End)this.angleRange[l].splice(t,1);else if(n>this.angleRange[l][t].Start&&athis.angleRange[l][t].End)continue;if(n>this.angleRange[l][t].Start&&(this.angleRange[l][t].End=n),a=0;i--){for(var u=this.adjustAngle(this.angleRange[t][i].Start),h=this.adjustAngle(this.angleRange[t][i].End);h=0;t--)for(let e=0;e=0;i--)e.push(t[s][i]);if(t.splice(s,1),void 0!==(i=this.generatePolygon(t,e))&&0!==i.length)return i}}modifyPoint(t,e){if(!0===e.isScalePoint){if(t<0||t>=this.controlPoints.length)return;var i=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints),o=SuperMap.Plot.PlottingUtil.distance(i[t],e);this.scaleValues[t]=o}this.calculateParts()}adjustAngle(t){for(;t>360;)t-=360;for(;t<0;)t+=360;return t}getCircleLonLat(t,e){return null===this.map?2*this.getDefaultSubSymbolSize():this.map&&"undefined"!=typeof L&&void 0!==L.Map&&this.map instanceof L.Map?((i=this.map.latLngToLayerPoint(L.latLng(t.y,t.x))).x+=e,this.map.layerPointToLatLng(L.point(i.x,i.y)).lng-t.x):this.map&&"undefined"!=typeof SuperMap&&void 0!==SuperMap.Map&&this.map instanceof SuperMap.Map?((i=this.map.getPixelFromLonLat(new SuperMap.LonLat(t.x,t.y))).x+=e,this.map.getLonLatFromPixel(new SuperMap.Pixel(i.x,i.y)).lon-t.x):void 0;var i}};SuperMap.Plot.FreeCurve=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.CLASS_NAME="SuperMap.Plot.FreeCurve"}calculateParts(){if(this.init(),!(null==this.controlPoints||this.controlPoints.length2*this.controlPoints.length-1)return;var i=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if(2>i.length)return;var o=SuperMap.Plot.PlottingUtil.polylineDistance(i),s=-1;s=t%2==0?Math.floor(t/2):Math.floor((t+1)/2);var l=(e.x-i[s].x)/o,n=(e.y-i[s].y)/o;this.scaleValues[2*t]=l,this.scaleValues[2*t+1]=n}this.calculateParts()}reSample(t,e){var i=[];if(null==t||e<0)return i;var o=t.length;if(o>2){var s=new SuperMap.Geometry.Point(0,0),l=0,n=0,a=0,r=2*Math.PI;s=t[0],i.push(s);var p=!1,u=!1,h=!1;for(let P=1;P0||SuperMap.Plot.PlottingUtil.equalFuzzy(0,c)?Math.acos(y):2*Math.PI-Math.acos(y),r>2*Math.PI&&l+2*Math.PIa&&(l-=2*Math.PI,r>2*Math.PI&&(r-=2*Math.PI)),l>a&&ll+S&&(r=l+S):(h=!0,r=l+S),p=!0}else s=t[P-1],P--,i.push(s),a=0,r=2*Math.PI,p=!1,u=!1,h=!1}return i.push(t[o-1]),i}return i}reSampleByAngle(t,e){var i=[],o=t.length;if(null==t||o<=0||e<=0)return i;for(var s=t,l=o,n=!1;SuperMap.Plot.PlottingUtil.equalFuzzy(s[0].x,s[l-1].x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(s[0].y,s[l-1].y);){if((l-=1)<=0)return i;n=!0}var a,r,p=[];for(a=0;a1e-10&&SuperMap.Plot.PlottingUtil.distance(s[r],s[a+1])>1e-10){var u=180*SuperMap.Plot.PlottingUtil.InnerAngle(s[a],s[r],s[a+1])/Math.PI;u>e&&u<180-e&&(p[a]=1,r++)}var h=0;for(a=0;a0){for(n&&h++,i=[],r=0,a=0;a0)for(let e=0;e=this.minEditPts){var t=this.controlPoints[0],e=this.controlPoints[1],i=SuperMap.Plot.PlottingUtil.distance(t,e),o=this.scaleValues[0]*i,s=SuperMap.Plot.PlottingUtil.parallel(this.controlPoints,o/2),l=SuperMap.Plot.PlottingUtil.parallel(this.controlPoints,-o/2),n=180*SuperMap.Plot.PlottingUtil.radian(t,e)/Math.PI,a=[];for(let e=n+90;e<=n+270;e+=10){var r=SuperMap.Plot.PlottingUtil.circlePoint(t,o/2,o/2,e);a.push(r)}var p=[];for(let t=n-90;t<=n+90;t+=10){var u=SuperMap.Plot.PlottingUtil.circlePoint(e,o/2,o/2,t);p.push(u)}var h=[];(h=(h=(h=(h=h.concat(a)).concat(l)).concat(p)).concat(s)).push(h[0]),this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,h);var y=new SuperMap.Geometry.Point(a[0].x,a[0].y);this.addScalePoint(y)}}modifyPoint(t,e){if(!0===e.isScalePoint&&0==t){var i=SuperMap.Plot.PlottingUtil.distance(e,this.controlPoints[0]),o=SuperMap.Plot.PlottingUtil.distance(this.controlPoints[0],this.controlPoints[1]);this.scaleValues[0]=2*i/o}this.calculateParts()}};SuperMap.Plot.CurveEight=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.CLASS_NAME="SuperMap.Plot.CurveEight"}destroy(){super.destroy()}calculateParts(){if(this.init(),this.controlPoints&&null!==this.controlPoints&&!(this.minEditPts>this.controlPoints.length))if(2===this.controlPoints.length){let t=this.controlPoints[0].clone(),e=this.controlPoints[1].clone(),i=SuperMap.Plot.PlottingUtil.distance(t,e)/2,o=180*SuperMap.Plot.PlottingUtil.radian(t,e)/Math.PI,s=new SuperMap.Geometry.Point((t.x+e.x)/2,(t.y+e.y)/2),l=SuperMap.Plot.PlottingUtil.circlePoint(s,i,i,o+90),n=SuperMap.Plot.PlottingUtil.circlePoint(s,3*i,3*i,o+90);this.addCell(SuperMap.Plot.SymbolType.CIRCLESYMBOL,[l,new SuperMap.Geometry.Point(l.x+i,l.y)]),this.addCell(SuperMap.Plot.SymbolType.CIRCLESYMBOL,[n,new SuperMap.Geometry.Point(n.x+i,n.y)])}else{let n=this.controlPoints[0].clone(),a=this.controlPoints[1].clone(),r=this.controlPoints[2].clone(),p=0;p=SuperMap.Plot.PlottingUtil.isRight(r,n,a)?180*SuperMap.Plot.PlottingUtil.radian(a,n)/Math.PI+90:180*SuperMap.Plot.PlottingUtil.radian(n,a)/Math.PI+90;let u=SuperMap.Plot.PlottingUtil.distance(n,a)/2,h=new SuperMap.Geometry.Point((n.x+a.x)/2,(n.y+a.y)/2),y=SuperMap.Plot.PlottingUtil.circlePoint(h,u,u,p),c=SuperMap.Plot.PlottingUtil.plumbLineLen(r,n,a);if(c<=4*u){var t=SuperMap.Plot.PlottingUtil.circlePoint(h,3*u,3*u,p);this.addCell(SuperMap.Plot.SymbolType.CIRCLESYMBOL,[y,new SuperMap.Geometry.Point(y.x+u,y.y)]),this.addCell(SuperMap.Plot.SymbolType.CIRCLESYMBOL,[t,new SuperMap.Geometry.Point(t.x+u,t.y)])}else{let t=SuperMap.Plot.PlottingUtil.circlePoint(h,c-u,c-u,p),n=180*Math.acos(u/(c-2*u))/Math.PI,a=p-n,r=p-180+n,S=p-180-n+360;var e=[];for(let t=p+n-360;t<=a;t+=4){let i=SuperMap.Plot.PlottingUtil.circlePoint(y,u,u,t);e.push(i)}var i=SuperMap.Plot.PlottingUtil.circlePoint(y,u,u,a);e.push(i);var o=[];for(let e=r;e=0;t--)l.push(o[t]);this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,l)}}}};SuperMap.Plot.PathText=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.relLineText=t.relLineText?t.relLineText:0,this.showPathLine=!t.showPathLine||t.showPathLine,this.showPathLineArrow=!!t.showPathLineArrow&&t.showPathLineArrow,this.isCurve=!!t.isCurve&&t.isCurve,this.isAvoid=!!t.isAvoid&&t.isAvoid,this.textToLineDistance=t.textToLineDistance?t.textToLineDistance:0,this.CLASS_NAME="SuperMap.Plot.PathText"}calculateParts(){if(this.init(),null!==this.controlPoints&&0!==this.controlPoints.length&&!(this.controlPoints.length1?this.computeText(o,this.textContent[1],t):this.computeText(o,this.textContent[0],t),this.relLineText=SuperMap.Plot.RelLineText.ONBOTHLINE,this.showPathLine=i}else{var s=[];s=this.relLineText===SuperMap.Plot.RelLineText.ONRIGHTLINE?this.getTextPathPts(t,!1):this.relLineText===SuperMap.Plot.RelLineText.ONLEFTLINE?this.getTextPathPts(t,!0):t,this.computeText(s,this.textContent[0],t)}this.finish()}}getTextPathPts(t,e){t=SuperMap.Plot.PlottingUtil.clearSamePts(t);var i=this.getLonLatDistanceFromPixel(this.textToLineDistance);if(0>=i)return SuperMap.Plot.PlottingUtil.clonePoints(t);var o=SuperMap.Plot.PlottingUtil.paraLine(t,i,e);return SuperMap.Plot.PlottingUtil.clearSamePts(o)}computeText(t,e,i){if(!(t.length<2)){var o=e.length,s=t,l=s.length,n=0;for(let t=0;t180&&(T-=360),T<-180&&(T+=360),T>90&&T<=180?(m=-180,d=!0,f=!0):T>-180&&T<-90&&(m=180,d=!0,f=!0),0!=m?this.relLineText===SuperMap.Plot.RelLineText.ONLINE||(c=this.relLineText===SuperMap.Plot.RelLineText.ONLEFTLINE?"lt":"lb"):this.relLineText===SuperMap.Plot.RelLineText.ONLINE||(c=this.relLineText===SuperMap.Plot.RelLineText.ONLEFTLINE?"lb":"lt");for(let t=0;tn);t++){var v=t;for(f&&(v=o-t-1),L=(g=S[v]).getWidth(),d&&(r+=L);p<=r&&u=0){var w=[];for(let t=0;t<=b.index;t++)w.push(i[t]);w.push(b.pt),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,w)}if(O.index>=0){var I=[];I.push(O.pt);for(let t=O.index+1;t2){var o=-1;for(let s=t.length-2;s>=0;s--)if(e1)){if(t=(1-t)/2,this.controlPoints.length>=this.minEditPts){var e,i,o,s;this.scalePoints=[];var l=[];this.controlPoints[0].x=2&&this.controlPoints.lengtho?Math.abs((e-o)/(t-i))>n?2:1:en?4:1:t>s?e>o?Math.abs((e-o)/(t-s))>n?2:3:en?4:3:e>o?2:e=this.minEditPts&&this.computeLine(t)}computeLine(t){this.components=[];var e=t[0],i=t[t.length-1];this.subSectionCount<=1&&(this.subSectionCount=10);var o=SuperMap.Plot.PlottingUtil.distance(e,i)/(2*this.subSectionCount-1);if(this.lineRelationType===SuperMap.Plot.LineRelationType.SOLID)this.addCell(24,t,{surroundLineFlag:!1});else if(this.lineRelationType===SuperMap.Plot.LineRelationType.DASH)for(let t=0;t=this.minEditPts){if(this.addCell(32,t,{surroundLineFlag:!1}),this.textContent&&null!=this.textContent&&this.textContent.length>0){var e=[];this.scaleValues[1]>t.length&&(this.scaleValues[1]=0);var i={labelRotation:0,surroundLineFlag:!1,labelAlign:"lt"};if(0===this.scaleValues[1])e=[SuperMap.Plot.PlottingUtil.getPolygonCenterPt(t)];else{var o=null,s=null;this.scaleValues[1]===t.length?(o=t[t.length-1],s=t[0]):(o=t[this.scaleValues[1]-1],s=t[this.scaleValues[1]]),i.labelRotation=-SuperMap.Plot.PlottingUtil.radian(o,s)/Math.PI*180;var l=this.scaleValues[0]*SuperMap.Plot.PlottingUtil.distance(o,s);e=[SuperMap.Plot.PlottingUtil.findPoint(o,s,l,0)]}this.addCell(34,e,i,this.textContent);var n=new SuperMap.Geometry.Point(e[0].x,e[0].y);n.isScalePoint=!0,n.tag=0,this.scalePoints=[],this.addScalePoint(n)}}else this.controlPoints.length>=2&&this.controlPoints.lengthi);t++){var a=SuperMap.Plot.PlottingUtil.findPointInPolyLine(l,s+o*t);if(-1!==a.index){var r=new SuperMap.Geometry.Point(a.pt.x,a.pt.y),p=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(o/2,e[a.index],r);this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[p.pntLeft,p.pntRight])}}this.finish()}}};SuperMap.Plot.AlgoSymbol1001=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&(this.scaleValues.push(.1),this.scaleValues.push(.2),this.scaleValues.push(0),this.scaleValues.push(.3),this.scaleValues.push(.08)),this.CLASS_NAME="SuperMap.Plot.AlgoSymbol1001"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints),e=(t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length;if(e>=this.minEditPts){this.scalePoints=[];var i=SuperMap.Plot.PlottingUtil.clonePoints(t),o=!1;void 0!==i[0].z&&(o=!0);var s=SuperMap.Plot.ArrowToolkit.generateArrowBodyShapePts(t,this.scaleValues,SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_PARALLEL),l=s.arrowTouLen,n=s.leftBodyPts,a=s.rightBodyPts,r=[];r.push(n[n.length-1]),r.push(a[a.length-1]);var p=[];p.push(this.scaleValues[3]),p.push(this.scaleValues[4]),p.push(this.scaleValues[0]),p.push(this.scaleValues[1]);var u=SuperMap.Plot.ArrowToolkit.generateArrowHeadShapePts(t,r,p,l,SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_WITHOUT_EAR),h=[];if(o){var y=[],c=[],S=[];for(let t=0;t=0;t--)h.push(S[t]);let t=new SuperMap.Geometry.Point((r[0].x+r[1].x)/2,(r[0].y+r[1].y)/2),o=new SuperMap.Geometry.Point(t.x,t.y);o.isScalePoint=!0,o.tag=0,this.addScalePoint(o);let s=new SuperMap.Geometry.Point(n[n.length-1].x,n[n.length-1].y);s.isScalePoint=!0,s.tag=1,this.addScalePoint(s);let l=new SuperMap.Geometry.Point(u[0].x,u[0].y);l.isScalePoint=!0,l.tag=2,this.addScalePoint(l);for(let t=0;t=0;t--)h.push(a[t]);let t=new SuperMap.Geometry.Point((r[0].x+r[1].x)/2,(r[0].y+r[1].y)/2),e=new SuperMap.Geometry.Point(t.x,t.y);e.isScalePoint=!0,e.tag=0,this.addScalePoint(e);let i=new SuperMap.Geometry.Point(n[n.length-1].x,n[n.length-1].y);i.isScalePoint=!0,i.tag=1,this.addScalePoint(i);let o=new SuperMap.Geometry.Point(u[0].x,u[0].y);o.isScalePoint=!0,o.tag=2,this.addScalePoint(o)}this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,h,{surroundLineFlag:!1,lineWidthLimit:!0,strokeWidth:0,weight:0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,h)}}modifyPoint(t,e){if(!0===e.isScalePoint){var i=new SuperMap.Geometry.Point(this.scalePoints[0].x,this.scalePoints[0].y),o=new SuperMap.Geometry.Point(this.scalePoints[1].x,this.scalePoints[1].y),s=new SuperMap.Geometry.Point(this.scalePoints[2].x,this.scalePoints[2].y),l=this.scaleValues[0],n=SuperMap.Plot.PlottingUtil.polylineDistance(this.controlPoints),a=n*l;if(0==t){let t=SuperMap.Plot.PlottingUtil.pointProjectToSegment(e,this.controlPoints[this.controlPoints.length-2],this.controlPoints[this.controlPoints.length-1]),i=t.projectPoint;if(t.isOnline){let t=SuperMap.Plot.PlottingUtil.distance(i,this.controlPoints[this.controlPoints.length-1]);this.scaleValues[0]=t/n}}else if(1==t){let t=SuperMap.Plot.PlottingUtil.pointProjectToSegment(e,o,s).projectPoint,l=SuperMap.Plot.PlottingUtil.distance(t,i);this.scaleValues[1]=l/a}else if(2==t){let t=SuperMap.Plot.PlottingUtil.pointProjectToSegment(e,this.controlPoints[1],s).projectPoint,o=SuperMap.Plot.PlottingUtil.pointProjectToSegment(t,i,this.controlPoints[1]),l=o.projectPoint,n=SuperMap.Plot.PlottingUtil.distance(l,i);!0===o.inOnline?this.scaleValues[4]=-n/a:this.scaleValues[4]=n/a}}this.calculateParts()}};SuperMap.Plot.AlgoSymbol1002=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.MIN_GEOPT_COUNT=2,this.MAX_GEOPT_COUNT=1024,this.SV1_defaultATLenDivABLen=0,this.SV2_defaultAYPosScale=.65,this.SV_AJCtrl=.6,this.SV_ArrowWoCtrl=.6,this.SV2_DefaultAJWidDiviedByATLen=.148,this.SV3_DefaultAEWidDividedByATLen=.4,this.SV4_DefaultAELenDividedByATLen=.3,this.SV_ATScaleParameter=1.25,this.SV_ATLenDividedByATWid=1.35,this.SV_ATWidDividedByArrowWeiWid=.5,this.AB_VERTEX_COUNT=4,this.MIN_PTCOUNT_PERARROW=3,this.ATL_DIV_AWW=.7,this.ATL_DIV_ABL=.12,this.ATL_DIV_ABL_1=.18,this.DEFAULT_ARROW_TAIL_POS=.12,this.DUOJIANTOU_TAIL_RATE_1=8,this.DUOJIANTOU_TAIL_RATE_2=3,this.DUOJIANTOU_TAIL_RATE_3=.6,this.AB_CTRLPT_RATE1=0,this.AB_CTRLPT_RATE2=3,this.AB_CTRLPT_RATE3=.5,this.MIN_SCALEVALUE=.1,this.MAX_SCALEVALUE=1,this.m_scalePoints=null,this.CLASS_NAME="SuperMap.Plot.AlgoSymbol1002"}calculateParts(){this.init(),this.m_scalePoints=[];var t=SuperMap.Plot.PlottingUtil.clearSamePts(this.controlPoints);if((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length>=2&&t.length2*o-1){for(let t=0;ty[t].length)){var d=p[t][p[t].length-1],f=u[t][0],m=new SuperMap.Geometry.Point(.5*(d.x+f.x),.5*(d.y+f.y)),L=y[t][y[t].length-1],M=y[t][y[t].length-2],b=this.ComputeZValue(m,L,M),T={x:m.x,y:m.y,z:b},v=[],A=[];for(let e=0;e=0;e--)if(t==o-1)x.push(y[t][e]);else{let i={x:y[t][e].x,y:y[t][e].y,z:.5*(y[t][e].z+y[t+1][e].z)};x.push(i)}this.ComputeBeizerZValueByDis(x,u[t],v),P.push(v),v=[];var _=h[t];for(let t=0;t<_.length;t++){let e=this.ComputeZValue(_[t],L,M);v.push({x:_[t].x,y:_[t].y,z:e})}g.push(v)}var O=[];for(let t=0;t0&&this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,O,{surroundLineFlag:!1}),this.scalePoints=this.scalePoints.concat(this.m_scalePoints),!0}n.shapePts.length>0&&(this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,n.shapePts,{surroundLineFlag:!1,lineWidthLimit:!0,strokeWidth:0,weight:0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,n.shapePts,{surroundLineFlag:!1})),this.scalePoints=[];for(let t=0;tthis.MAX_SCALEVALUE?l=this.MAX_SCALEVALUE:l3){var n=o-1;for(let t=0,i=n;t3){var l=o-1;for(let t=0,i=l;t0)if(1==t)i.push(0);else{var o=SuperMap.Plot.PlottingUtil.distance(e[0],e[this.MIN_PTCOUNT_PERARROW]);i.push(o);for(var s=1,l=this.MIN_PTCOUNT_PERARROW;sL&&(m=.5*L);var M=m*y;P.push(P[u].clone());var b,T=0;b=g-m;var v=[],A=0;for(A=2;A<=u;A++)T+=SuperMap.Plot.PlottingUtil.distance(P[A-1],P[A-2]),SuperMap.Plot.PlottingUtil.equalFuzzy(b,0,1e-14)?v[A]=0:SuperMap.Plot.PlottingUtil.equalFuzzy(b-T,0,1e-14)?v[A]=M:v[A]=M+(d-M)*Math.pow((b-T)/b,this.SV_ATScaleParameter);v[u+1]=M;var x=new SuperMap.Geometry.Point(0,0),_=new SuperMap.Geometry.Point(0,0),O=new SuperMap.Geometry.Point(0,0);for(A=2;A<=u;A++){SuperMap.Plot.PlottingUtil.getTrianglePoints(this.AB_CTRLPT_RATE1,this.AB_CTRLPT_RATE2,P[A-2],P[A-1],P[A],_,O),u==A&&SuperMap.Plot.PlottingUtil.getTrapezoidPoints(this.AB_CTRLPT_RATE3,P[u],P[u-1],O,x);let t=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(v[A],_,P[A-1]);l[A]=t.pntLeft,s[A]=t.pntRight}var w,I,D=x.clone();if(SuperMap.Plot.PlottingUtil.distance(P[u],D)>0){var E=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(m,P[u],x);P[u]=E.clone()}for(f=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(M,P[u+1],P[u]),s[u+1]=f.pntLeft,l[u+1]=f.pntRight,A=2;A<=u;A++)SuperMap.Plot.PlottingUtil.getTrianglePoints(this.AB_CTRLPT_RATE2,this.AB_CTRLPT_RATE2,s[A-1],s[A],s[A+1],_,O),n[A]=_.clone(),a[A]=O.clone(),SuperMap.Plot.PlottingUtil.getTrianglePoints(this.AB_CTRLPT_RATE2,this.AB_CTRLPT_RATE2,l[A-1],l[A],l[A+1],_,O),r[A]=_.clone(),p[A]=O.clone();SuperMap.Plot.PlottingUtil.getTrapezoidPoints(this.AB_CTRLPT_RATE3,s[1],s[2],n[2],x),a[1]=x.clone(),SuperMap.Plot.PlottingUtil.getTrapezoidPoints(this.AB_CTRLPT_RATE3,l[1],l[2],r[2],x),p[1]=x.clone(),I=SuperMap.Plot.PlottingUtil.distance(s[u+1],s[u])*(1/3),(w=SuperMap.Plot.PlottingUtil.getExcentrePointOnSegmentByScale(I,P[u],P[u+1])).x+=s[u+1].x-P[u].x,w.y+=s[u+1].y-P[u].y,I=(d-M)*Math.pow(I/b,this.SV_ATScaleParameter+.3),f=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(I,s[u+1],w),n[u+1]=f.pntLeft.clone(),I=SuperMap.Plot.PlottingUtil.distance(l[u+1],l[u])*(1/3),(w=SuperMap.Plot.PlottingUtil.getExcentrePointOnSegmentByScale(I,P[u],P[u+1])).x+=l[u+1].x-P[u].x,w.y+=l[u+1].y-P[u].y,I=(d-M)*Math.pow(I/b,this.SV_ATScaleParameter+.3),f=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(I,l[u+1],w),r[u+1]=f.pntRight.clone();var C=[],N=m*S,U=SuperMap.Plot.PlottingUtil.getExcentrePointOnSegmentByScale(N,P[u],P[u+1]);this.m_scalePoints.push(U.clone()),N=m*c,f=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(N,P[u+1],U),C.push(f.pntRight),C.push(P[u+1]),C.push(f.pntLeft);var R=[];for(R.push(s[u+1]),A=u;A>=1;A--)R.push(n[A+1]),R.push(a[A]),R.push(s[A]);var B=[];for(A=1;A<=u;A++)B.push(l[A]),B.push(p[A]),B.push(r[A+1]);B.push(l[u+1]),o.push.apply(o,B),o.push.apply(o,C),o.push.apply(o,R),i=m/g;var G=[];for(A=R.length-1;A>=0;A--)G.push(R[A]);return{dATLenDivABLen:i,arrowBodyPts:o}}generateAYPts(t,e,i,o,s){var l=new SuperMap.Geometry.Point(.5*(t[2].x+i[2].x),.5*(t[2].y+i[2].y)),n=new SuperMap.Geometry.Point(.5*(t[1].x+i[1].x),.5*(t[1].y+i[1].y)),a=new SuperMap.Geometry.Point(.5*(t[0].x+i[0].x),.5*(t[0].y+i[0].y)),r=SuperMap.Plot.PlottingUtil.distance(l,n),p=SuperMap.Plot.PlottingUtil.distance(a,n),u=s*(r+p),h=new SuperMap.Geometry.Point(0,0),y=new SuperMap.Geometry.Point(0,0),c=new SuperMap.Geometry.Point(0,0);if(u>r){u=r+p-u,h=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(u,a,n);var S=SuperMap.Plot.PlottingUtil.distance(t[1],t[0]),P=SuperMap.Plot.PlottingUtil.distance(i[1],i[0]);S=S*u/p,y=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(S,t[0],t[1]),P=P*u/p,c=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(P,i[0],i[1])}else{h=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(u,l,n);var g=SuperMap.Plot.PlottingUtil.distance(t[1],t[2]),d=SuperMap.Plot.PlottingUtil.distance(i[1],i[2]);g=g*u/r,y=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(g,t[2],t[1]),d=d*u/r,c=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(d,i[2],i[1])}this.m_scalePoints.push(h.clone());var f=this.SV_ArrowWoCtrl*SuperMap.Plot.PlottingUtil.distance(h,y),m=this.SV_ArrowWoCtrl*SuperMap.Plot.PlottingUtil.distance(h,c),L=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(f,h,y),M=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(m,h,c),b=e[11].clone(),T=e[10].clone(),v=o[5].clone(),A=o[6].clone(),x=SuperMap.Plot.PlottingUtil.intersectLines(T,b,h,y),_=SuperMap.Plot.PlottingUtil.distance(x.intersectPoint,T),O=SuperMap.Plot.PlottingUtil.distance(T,h);_=_>O?this.SV_AJCtrl*O:this.SV_AJCtrl*_;var w=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(_,T,b);b=w.clone(),e[11]=w.clone(),x=SuperMap.Plot.PlottingUtil.intersectLines(A,v,h,c),_=(_=SuperMap.Plot.PlottingUtil.distance(x.intersectPoint,A))>(O=SuperMap.Plot.PlottingUtil.distance(A,h))?this.SV_AJCtrl*O:this.SV_AJCtrl*_,v=(w=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(_,A,v)).clone(),o[5]=w.clone();var I=[];I.push(T),I.push(b),I.push(L),I.push(h);var D=[];return D.push(h),D.push(M),D.push(v),D.push(A),{arrowLeftYaoPts:I,arrowRightYaoPts:D}}};SuperMap.Plot.AlgoSymbol1003=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&(this.scaleValues.push(.3),this.scaleValues.push(.28),this.scaleValues.push(.433333),this.scaleValues.push(.53),this.scaleValues.push(0)),this.CLASS_NAME="SuperMap.Plot.AlgoSymbol1003"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints),e=(t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length;if(e>=this.minEditPts){if(SuperMap.Plot.PlottingUtil.equalFuzzy(this.controlPoints[0].x,this.controlPoints[1].x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(this.controlPoints[0].y,this.controlPoints[1].y))return;var i=SuperMap.Plot.PlottingUtil.clonePoints(t),o=!1;void 0!==i[0].z&&(o=!0);var s=SuperMap.Plot.ArrowToolkit.generateArrowBodyShapePts(t,this.scaleValues,SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_TRAPEZOID),l=s.arrowTouLen,n=s.leftBodyPts,a=s.rightBodyPts,r=[];r.push(n[n.length-1]),r.push(a[a.length-1]);var p=[];p.push(this.scaleValues[3]),p.push(this.scaleValues[4]),p.push(0),p.push(0);var u=SuperMap.Plot.ArrowToolkit.generateArrowHeadShapePts(t,r,p,l,SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_WITHOUT_EAR),h=[];h=(h=h.concat(n)).concat(u);for(let t=a.length-1;t>=0;t--)h.push(a[t]);if(h.push(n[0]),o){var y=[],c={x:i[1].x,y:i[1].y,z:i[1].z},S={x:i[0].x,y:i[0].y,z:i[0].z};for(let t=0;t=2&&t.length=2;t--)h.push(i[t]);h.push({x:y.x,y:y.y,z:g});var f=[];this.ComputeBeizerZValueByDis(h,n,f);var m=[];for(let t=0;t0&&f.length>0&&m.length>0){p=(p=(p=(p=[]).concat(d)).concat(m)).concat(f),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,p,{surroundLineFlag:!1});var M=[];for(let t=0;t=0;t--)e.push(p[t]),o.push(p[t])}return{shapePts:e,leftBodyPts:i,rightBodyPts:o,arrowHeadPts:s}}updateScalePoints(t){var e=t.length,i=[];if(!(e<3)){var o=SuperMap.Plot.PlottingUtil.polylineDistance(t);if(!SuperMap.Plot.PlottingUtil.equalFuzzy(o,0)){var s=this.operateCtrlPts(t);e=s.length,e--;var l=[];for(let t=0;t0&&f>0){var L=1/(P-S[2].x),M=-1/(g-S[2].y),b=1*S[2].y/(g-S[2].y)-1*S[2].x/(P-S[2].x);m=Math.abs(L*S[0].x+M*S[0].y+b)/Math.sqrt(L*L+M*M)}else f<=1e-4?m=Math.abs(g-S[1].y):d<=1e-4&&(m=Math.abs(P-S[1].x));var T=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(m,S[2],new SuperMap.Geometry.Point(P,g)),v=SuperMap.Plot.PlottingUtil.pointIsRightToLine(S[1],S[2],S[0]);v?(n[1]=S[1],a[1]=S[0]):(n[1]=S[0],a[1]=S[1]),S[1]=new SuperMap.Geometry.Point((S[0].x+S[1].x)/2,(S[0].y+S[1].y)/2);var A=Math.sqrt((T.pntLeft.x-T.pntRight.x)*(T.pntLeft.x-T.pntRight.x)+(T.pntLeft.y-T.pntRight.y)*(T.pntLeft.y-T.pntRight.y))*this.sv_AtWidthDivAwWidth,x=(o=A*this.sv_AtLenDivAtWidth)*l;SuperMap.Plot.PlottingUtil.equalFuzzy(s,0)||(x=(o=t*s)*l);var _,O,w=SuperMap.Plot.PlottingUtil.distance(S[y],S[y-1]),I=2*o;w0&&(S[y]=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(o,S[y],U)),C=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(x,S[y+1],S[y]),(v=SuperMap.Plot.PlottingUtil.pointIsRightToLine(S[y],S[y+1],C.pntLeft))?(a[y]=new SuperMap.Geometry.Point(C.pntLeft.x,C.pntLeft.y),n[y]=new SuperMap.Geometry.Point(C.pntRight.x,C.pntRight.y)):(a[y]=new SuperMap.Geometry.Point(C.pntRight.x,C.pntRight.y),n[y]=new SuperMap.Geometry.Point(C.pntLeft.x,C.pntLeft.y)),D=2;D0&&this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,s)}}};SuperMap.Plot.AlgoSymbol1006=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.QIANJI_RATE1=9,this.QIANJI_RATE2=20,this.QIANJI_RATE4=5,this.QIANJI_RATE3=1/3,this.QIANJI_TAIL_RATE1=8,this.QIANJI_TAIL_RATE2=3,this.QIANJI_TAIL_RATE3=.6,this.SV1_Default=.25,this.SV1_MinValue=0,this.SV1_MaxValue=.5,this.DEFAULT_ARROW_TAIL_POS=.4,this.SCALE_VALUE_COUNT=1,this.MIN_LEN_LeftToRightCenter=1e-7,this.SCALE_AT=1/3,this.SCALE_ATAJ=1/7,this.SCALE_ATAE=1/3,this.SCALE_AW=2/3,this.SCALE_ATAJctrlDefSide=.8,this.SCALE_ATAJctrlSameSide=2/3,this.SCALE_MM_LEFT=.25,this.SCALE_MM_RIGHT=.75,this.BEZIER_K1=1/3,this.QIANJI_OPERATE_RATE1=1,0===this.scaleValues.length&&this.scaleValues.push(this.SV1_Default),this.m_dMaxDis=0,this.m_bIsAnimation=!1,this.CLASS_NAME="SuperMap.Plot.AlgoSymbol1006"}calculateParts(){this.init(),this.m_scalePoints=[];var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length>=2&&t.length0&&this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,y,{surroundLineFlag:!1}),this.m_scalePoints.length>0&&(this.m_scalePoints[0]={x:this.m_scalePoints[0].x,y:this.m_scalePoints[0].y,z:L});for(let t=0;t0&&(this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,_,{surroundLineFlag:!1,lineWidthLimit:!0,strokeWidth:0,weight:0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,_,{surroundLineFlag:!1})),this.scalePoints=[];for(let t=0;tthis.SV1_MaxValue&&(i=this.SV1_MaxValue)}else i=SuperMap.Plot.PlottingUtil.distance(n.projectPoint,s)0&&this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,r,e)}else{this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,o);let t={surroundLineFlag:!1,fillLimit:!0,fillColorLimit:!1,fill:!0};l.length>0&&this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,l,t)}}}};SuperMap.Plot.AlgoSymbol1008=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&this.scaleValues.push(.1),this.CLASS_NAME="SuperMap.Plot.AlgoSymbol1008"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if(!((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length0&&this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,l,{surroundLineFlag:!1,fillLimit:!0,fill:!0})}}};SuperMap.Plot.AlgoSymbol1009=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&this.scaleValues.push(.1),this.CLASS_NAME="SuperMap.Plot.AlgoSymbol1009"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if(!((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length=2&&t.length=0;t--)e.push(h[t]),o.push(h[t]);for(let t=1;t=0;t--)e.push(p[t]),o.push(p[t])}return{shapePts:e,leftBodyPts:i,rightBodyPts:o,arrowHeadPts:s}}updateScalePoints(t){var e=t.length,i=[];if(!(e<3)){var o=SuperMap.Plot.PlottingUtil.polylineDistance(t);if(!SuperMap.Plot.PlottingUtil.equalFuzzy(o,0)){var s=this.operateCtrlPts(t);e=s.length,e--;var l=[];for(let t=0;t0&&f>0){var L=1/(P-S[2].x),M=-1/(g-S[2].y),b=1*S[2].y/(g-S[2].y)-1*S[2].x/(P-S[2].x);m=Math.abs(L*S[0].x+M*S[0].y+b)/Math.sqrt(L*L+M*M)}else f<=1e-4?m=Math.abs(g-S[1].y):d<=1e-4&&(m=Math.abs(P-S[1].x));var T=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(m,S[2],new SuperMap.Geometry.Point(P,g)),v=SuperMap.Plot.PlottingUtil.pointIsRightToLine(S[1],S[2],S[0]);v?(n[1]=S[1],a[1]=S[0]):(n[1]=S[0],a[1]=S[1]),S[1]=new SuperMap.Geometry.Point((S[0].x+S[1].x)/2,(S[0].y+S[1].y)/2);var A=Math.sqrt((T.pntLeft.x-T.pntRight.x)*(T.pntLeft.x-T.pntRight.x)+(T.pntLeft.y-T.pntRight.y)*(T.pntLeft.y-T.pntRight.y))*this.sv_AtWidthDivAwWidth,x=(o=A*this.sv_AtLenDivAtWidth)*l;SuperMap.Plot.PlottingUtil.equalFuzzy(s,0)||(x=(o=t*s)*l);var _,O,w=SuperMap.Plot.PlottingUtil.distance(S[y],S[y-1]),I=2*o;w0&&(S[y]=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(o,S[y],U)),C=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(x,S[y+1],S[y]),(v=SuperMap.Plot.PlottingUtil.pointIsRightToLine(S[y],S[y+1],C.pntLeft))?(a[y]=new SuperMap.Geometry.Point(C.pntLeft.x,C.pntLeft.y),n[y]=new SuperMap.Geometry.Point(C.pntRight.x,C.pntRight.y)):(a[y]=new SuperMap.Geometry.Point(C.pntRight.x,C.pntRight.y),n[y]=new SuperMap.Geometry.Point(C.pntLeft.x,C.pntLeft.y)),D=2;D1)if(this.arrowBodyType!==SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_COATTAIL)this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,i);else for(var u=0,h=i.length-1;u1&&this.addCell(m,p,e),r.length>1&&this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,r)}}};SuperMap.Plot.AlgoSymbol1017=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&(this.scaleValues.push(.1),this.scaleValues.push(.2),this.scaleValues.push(0),this.scaleValues.push(.3),this.scaleValues.push(.3)),this.CLASS_NAME="SuperMap.Geometry.AlgoSymbol1017"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length>=this.minEditPts){this.scalePoints=[];var e=SuperMap.Plot.PlottingUtil.clonePoints(t);this.isEdit||(this.scaleValues[0]=1.5*this.getSubSymbolScaleValue());var i=SuperMap.Plot.ArrowToolkit.generateArrowBodyShapePts(e,this.scaleValues,SuperMap.Plot.ArrowToolkit.ArrowBodyType.ARROWBODY_PARALLEL),o=i.arrowTouLen,s=i.leftBodyPts,l=i.rightBodyPts,n=[];n.push(s[s.length-1]),n.push(l[l.length-1]);var a=[];a.push(this.scaleValues[3]),a.push(this.scaleValues[4]),a.push(this.scaleValues[0]),a.push(this.scaleValues[1]);var r=SuperMap.Plot.ArrowToolkit.generateArrowHeadShapePts(e,n,a,o,SuperMap.Plot.ArrowToolkit.ArrowHeadType.ARROWHEAD_WITHOUT_EAR),p=[];p=(p=p.concat(s)).concat(r);for(let t=l.length-1;t>=0;t--)p.push(l[t]);p.push(p[0]),this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,p,{lineWidthLimit:!0,strokeWidth:0,weight:0,surroundLineFlag:!1});var u=SuperMap.Plot.PlottingUtil.clonePoints(s),h=[];for(let t=l.length-1;t>=0;t--)h.push(l[t]);h=h.concat(u),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,h);var y=SuperMap.Plot.PlottingUtil.clonePoints(r);y.push(l[l.length-1]),y.splice(0,0,s[s.length-1]),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,y,{lineTypeLimit:!0});var c=new SuperMap.Geometry.Point((n[0].x+n[1].x)/2,(n[0].y+n[1].y)/2),S=new SuperMap.Geometry.Point(c.x,c.y);S.isScalePoint=!0,S.tag=0,this.scalePoints.push(S);var P=new SuperMap.Geometry.Point(s[s.length-1].x,s[s.length-1].y);P.isScalePoint=!0,P.tag=1,this.scalePoints.push(P);var g=new SuperMap.Geometry.Point(r[0].x,r[0].y);g.isScalePoint=!0,g.tag=2,this.scalePoints.push(g),this.finish()}}modifyPoint(t,e){if(!0===e.isScalePoint){var i=new SuperMap.Geometry.Point(this.scalePoints[0].x,this.scalePoints[0].y),o=new SuperMap.Geometry.Point(this.scalePoints[1].x,this.scalePoints[1].y),s=new SuperMap.Geometry.Point(this.scalePoints[2].x,this.scalePoints[2].y),l=this.scaleValues[0],n=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);n=SuperMap.Plot.PlottingUtil.clearSamePts(n);var a=SuperMap.Plot.PlottingUtil.polylineDistance(n),r=a*l;if(0==t){let t=SuperMap.Plot.PlottingUtil.pointProjectToSegment(e,n[n.length-2],n[n.length-1]),i=t.projectPoint;if(t.isOnline){let t=SuperMap.Plot.PlottingUtil.distance(i,n[n.length-1]);this.scaleValues[0]=t/a}}else if(1==t){let t=SuperMap.Plot.PlottingUtil.pointProjectToSegment(e,o,s).projectPoint,l=SuperMap.Plot.PlottingUtil.distance(t,i);this.scaleValues[1]=l/r}else if(2==t){let t=SuperMap.Plot.PlottingUtil.pointProjectToSegment(e,n[1],s).projectPoint,o=SuperMap.Plot.PlottingUtil.pointProjectToSegment(t,i,n[1]),l=o.projectPoint,a=SuperMap.Plot.PlottingUtil.distance(l,i);!1===o.isOnline&&(this.scaleValues[4]=a/r)}}this.calculateParts()}};SuperMap.Plot.AlgoSymbol1018=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),this.MAX_ARRAY_SIZE=128,this.sv1_DefaultAtLenDivAbLen=0,this.sv2_DefaultAjWidthDivAtLen=.148,this.sv3_DefaultAeWidthDivAtLen=.4,this.sv4_DefaultAeLenDivAtLen=.312,this.sv_AtScaleParameter=1.5,this.sv_AtLenDivAtWidth=1.35,this.sv_AtWidthDivAwWidth=.5,this.sv_defaultAwLenDivAbLen=.15,0===this.scaleValues.length&&(this.scaleValues.push(this.sv1_DefaultAtLenDivAbLen),this.scaleValues.push(this.sv2_DefaultAjWidthDivAtLen),this.scaleValues.push(this.sv3_DefaultAeWidthDivAtLen),this.scaleValues.push(this.sv4_DefaultAeLenDivAtLen)),this.CLASS_NAME="SuperMap.Geometry.AlgoSymbol1018"}calculateParts(){this.init(),this.applyUse()}applyUse(){var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length>=2&&t.length=0;t--)e.push(p[t]),o.push(p[t])}return{shapePts:e,leftBodyPts:i,rightBodyPts:o,arrowHeadPts:s}}updateScalePoints(t){var e=t.length,i=[];if(!(e<3)){var o=SuperMap.Plot.PlottingUtil.polylineDistance(t);if(!SuperMap.Plot.PlottingUtil.equalFuzzy(o,0)){var s=this.operateCtrlPts(t);e=s.length,e--;var l=[];for(let t=0;t0&&f>0){var L=1/(P-S[2].x),M=-1/(g-S[2].y),b=1*S[2].y/(g-S[2].y)-1*S[2].x/(P-S[2].x);m=Math.abs(L*S[0].x+M*S[0].y+b)/Math.sqrt(L*L+M*M)}else f<=1e-4?m=Math.abs(g-S[1].y):d<=1e-4&&(m=Math.abs(P-S[1].x));var T=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(m,S[2],new SuperMap.Geometry.Point(P,g)),v=SuperMap.Plot.PlottingUtil.pointIsRightToLine(S[1],S[2],S[0]);v?(n[1]=S[1],a[1]=S[0]):(n[1]=S[0],a[1]=S[1]),S[1]=new SuperMap.Geometry.Point((S[0].x+S[1].x)/2,(S[0].y+S[1].y)/2);var A=Math.sqrt((T.pntLeft.x-T.pntRight.x)*(T.pntLeft.x-T.pntRight.x)+(T.pntLeft.y-T.pntRight.y)*(T.pntLeft.y-T.pntRight.y))*this.sv_AtWidthDivAwWidth,x=(o=A*this.sv_AtLenDivAtWidth)*l;SuperMap.Plot.PlottingUtil.equalFuzzy(s,0)||(x=(o=t*s)*l);var _,O,w=SuperMap.Plot.PlottingUtil.distance(S[y],S[y-1]),I=2*o;w0&&(S[y]=SuperMap.Plot.PlottingUtil.getIncentrePointOnSegmentByScale(o,S[y],U)),C=SuperMap.Plot.PlottingUtil.getSidePointsOfLine(x,S[y+1],S[y]),(v=SuperMap.Plot.PlottingUtil.pointIsRightToLine(S[y],S[y+1],C.pntLeft))?(a[y]=new SuperMap.Geometry.Point(C.pntLeft.x,C.pntLeft.y),n[y]=new SuperMap.Geometry.Point(C.pntRight.x,C.pntRight.y)):(a[y]=new SuperMap.Geometry.Point(C.pntRight.x,C.pntRight.y),n[y]=new SuperMap.Geometry.Point(C.pntLeft.x,C.pntLeft.y)),D=2;D=0;--t)L.push(f[t]);this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,L,{lineWidthLimit:!0,strokeWidth:0,weight:0,surroundLineFlag:!1}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[L[2],L[1],L[7],L[6]],{surroundLineFlag:!1}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[L[6],L[5],L[4],L[3],L[2]],{lineTypeLimit:!0,surroundLineFlag:!1}),this.scalePoints=[];var M=f[0].clone();M.isScalePoint=!0,M.tag=0,this.scalePoints.push(M);var b=f[1].clone();b.isScalePoint=!0,b.tag=1,this.scalePoints.push(b);var T=f[2].clone();T.isScalePoint=!0,T.tag=2,this.scalePoints.push(T),this.finish()}}modifyPoint(t,e){if(e.isScalePoint&&(t>=0||t<3)){var i=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);i=SuperMap.Plot.PlottingUtil.clearSamePts(i);var o=SuperMap.Plot.PlottingUtil.distance(i[0],i[1]),s=i[0].clone(),l=i[1].clone(),n=e.clone();if(0==t){var a=SuperMap.Plot.PlottingUtil.distance(n,s)/o;this.scaleValues[0]=a}else if(1==t){let t=SuperMap.Plot.PlottingUtil.projectPoint(n,s,l),e=SuperMap.Plot.PlottingUtil.distance(t,n)/o;this.scaleValues[1]=e;let i=SuperMap.Plot.PlottingUtil.distance(t,l)/o;this.scaleValues[3]=i}else if(2==t){let t=SuperMap.Plot.PlottingUtil.projectPoint(n,s,l),e=SuperMap.Plot.PlottingUtil.distance(t,n)/o;this.scaleValues[2]=e;let i=SuperMap.Plot.PlottingUtil.distance(t,l)/o;this.scaleValues[4]=i}}this.calculateParts()}};SuperMap.Plot.AlgoSymbol1020=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&(this.scaleValues.push(.5),this.scaleValues.push(.222222),this.scaleValues.push(.5),this.scaleValues.push(.5),this.scaleValues.push(.5)),this.CLASS_NAME="SuperMap.Geometry.AlgoSymbol1020"}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if(!((t=SuperMap.Plot.PlottingUtil.clearSamePts(t)).length=0;--t)x.push(v[t]);var _=SuperMap.Plot.PlottingUtil.clonePoints(x);_.push(_[0]),this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,_,{lineWidthLimit:!0,strokeWidth:0,weight:0,surroundLineFlag:!1}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[x[0],x[1]]),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[x[2],x[3]]),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[x[3],x[4],x[5],x[6],x[7]],{lineTypeLimit:!0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[x[7],x[8]]),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,[x[9],x[10]]),this.scalePoints=[];var O=v[0].clone();O.isScalePoint=!0,O.tag=0,this.scalePoints.push(O);var w=v[3].clone();w.isScalePoint=!0,w.tag=1,this.scalePoints.push(w);var I=v[4].clone();I.isScalePoint=!0,I.tag=2,this.scalePoints.push(I),this.finish()}}modifyPoint(t,e){if(e.isScalePoint&&(t>=0||t<3)){var i=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);i=SuperMap.Plot.PlottingUtil.clearSamePts(i);var o=SuperMap.Plot.PlottingUtil.distance(i[0],i[1]),s=i[0].clone(),l=i[1].clone(),n=e.clone();if(0==t){let t=SuperMap.Plot.PlottingUtil.distance(n,s)/o;this.scaleValues[0]=t}else if(1==t){let t=SuperMap.Plot.PlottingUtil.projectPoint(n,s,l),e=SuperMap.Plot.PlottingUtil.distance(t,n)/o;this.scaleValues[1]=e;let i=SuperMap.Plot.PlottingUtil.distance(t,l)/o;this.scaleValues[3]=i}else if(2==t){let t=SuperMap.Plot.PlottingUtil.projectPoint(n,s,l),e=SuperMap.Plot.PlottingUtil.distance(t,n)/o;this.scaleValues[2]=e;let i=SuperMap.Plot.PlottingUtil.distance(t,l)/o;this.scaleValues[4]=i}}this.calculateParts()}};SuperMap.Plot.AlgoSymbol1021=class extends SuperMap.Plot.AlgoSymbol{constructor(t){super(t),0===this.scaleValues.length&&this.scaleValues.push(.25),this.CLASS_NAME="SuperMap.Geometry.AlgoSymbol1021",this.QIANJI_RATE1=9,this.QIANJI_RATE2=20,this.QIANJI_RATE4=5,this.QIANJI_RATE3=1/3,this.QIANJI_TAIL_RATE1=8,this.QIANJI_TAIL_RATE2=3,this.QIANJI_TAIL_RATE3=.6,this.SV1_Default=.25,this.SV1_MinValue=0,this.SV1_MaxValue=.5,this.DEFAULT_ARROW_TAIL_POS=.4,this.SCALE_VALUE_COUNT=1,this.MIN_LEN_LeftToRightCenter=1e-7,this.SCALE_AT=1/3,this.SCALE_ATAJ=1/7,this.SCALE_ATAE=1/3,this.SCALE_AW=2/3,this.SCALE_ATAJctrlDefSide=.8,this.SCALE_ATAJctrlSameSide=2/3,this.SCALE_MM_LEFT=.25,this.SCALE_MM_RIGHT=.75,this.BEZIER_K1=1/3,this.QIANJI_OPERATE_RATE1=1,this.m_dMaxDis=0,this.m_bIsAnimation=!1}calculateParts(){this.init();var t=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints);if(t=SuperMap.Plot.PlottingUtil.clearSamePts(t),this.components=[],this.m_scalePoints=[],t.length>=2&&t.length0&&(this.addCell(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,i.shapePts,{strokeWidth:0,weight:0,lineWidthLimit:!0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,l),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,n),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,i.LeftArowHead,{lineTypeLimit:!0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,i.LeftArowRightBody),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,u),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,h),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,i.RightArowHead,{lineTypeLimit:!0}),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,P),this.addCell(SuperMap.Plot.SymbolType.POLYLINESYMBOL,g)),this.scalePoints=[];for(let t=0;tthis.SV1_MaxValue&&(o=this.SV1_MaxValue)}else o=SuperMap.Plot.PlottingUtil.distance(a.projectPoint,l)=2&&t.length.7&&(P=.7),this.scaleValues[2]=P}}}};var q=SuperMap.Plot.BasicAlgoSymbolFactory=SuperMap.Plot.BasicAlgoSymbolFactory||{};SuperMap.Plot.BasicAlgoSymbolFactory.getAlgoSymbol=function(t,e,i){if(0===t)switch(e){case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL:return new SuperMap.Plot.GeoTooltipBox(i);case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOLM:return new SuperMap.Plot.GeoTooltipBoxM(i);case SuperMap.Plot.SymbolType.PATHTEXT:return new SuperMap.Plot.PathText(i);case SuperMap.Plot.SymbolType.ARROWLINE:return new SuperMap.Plot.ArrowLine(i);case SuperMap.Plot.SymbolType.CURVEEIGHT:return new SuperMap.Plot.CurveEight(i);case SuperMap.Plot.SymbolType.RUNWAY:return new SuperMap.Plot.Runway(i);case SuperMap.Plot.SymbolType.CONCENTRICCIRCLE:return new SuperMap.Plot.ConcentricCircle(i);case SuperMap.Plot.SymbolType.COMBINATIONALCIRCLE:return new SuperMap.Plot.CombinationalCircle(i);case SuperMap.Plot.SymbolType.FREECURVE:return new SuperMap.Plot.FreeCurve(i);case SuperMap.Plot.SymbolType.REGULARPOLYGON:return new SuperMap.Plot.RegularPolygon(i);case SuperMap.Plot.SymbolType.BRACESYMBOL:return new SuperMap.Plot.Brace(i);case SuperMap.Plot.SymbolType.TRAPEZOIDSYMBOL:return new SuperMap.Plot.Trapezoid(i);case SuperMap.Plot.SymbolType.SYMBOLTEXTBOX:return new SuperMap.Plot.SymbolTextBox(i);case SuperMap.Plot.SymbolType.NODECHAIN:return new SuperMap.Plot.NodeChain(i);case SuperMap.Plot.SymbolType.LINERELATION:return new SuperMap.Plot.LineRelation(i);case SuperMap.Plot.SymbolType.LINEMARKING:return new SuperMap.Plot.LineMarking(i);case SuperMap.Plot.SymbolType.POLYGONREGION:return new SuperMap.Plot.PolygonRegion(i);case SuperMap.Plot.SymbolType.WIRE:return new SuperMap.Plot.Wire(i);default:return new SuperMap.Plot.AlgoSymbol(i)}else if(22===t)switch(e){case 1001:return new SuperMap.Plot.AlgoSymbol1001(i);case 1002:return new SuperMap.Plot.AlgoSymbol1002(i);case 1003:return new SuperMap.Plot.AlgoSymbol1003(i);case 1004:return new SuperMap.Plot.AlgoSymbol1004(i);case 1005:return new SuperMap.Plot.AlgoSymbol1005(i);case 1006:return new SuperMap.Plot.AlgoSymbol1006(i);case 1007:return new SuperMap.Plot.AlgoSymbol1007(i);case 1008:return new SuperMap.Plot.AlgoSymbol1008(i);case 1009:return new SuperMap.Plot.AlgoSymbol1009(i);case 1010:return new SuperMap.Plot.AlgoSymbol1010(i);case 1011:return new SuperMap.Plot.AlgoSymbol1011(i);case 1012:return new SuperMap.Plot.AlgoSymbol1012(i);case 1013:return new SuperMap.Plot.AlgoSymbol1013(i);case 1014:return new SuperMap.Plot.AlgoSymbol1014(i);case 1015:return new SuperMap.Plot.AlgoSymbol1015(i);case 1016:return new SuperMap.Plot.AlgoSymbol1016(i);case 1017:return new SuperMap.Plot.AlgoSymbol1017(i);case 1018:return new SuperMap.Plot.AlgoSymbol1018(i);case 1019:return new SuperMap.Plot.AlgoSymbol1019(i);case 1020:return new SuperMap.Plot.AlgoSymbol1020(i);case 1021:return new SuperMap.Plot.AlgoSymbol1021(i);case 1022:return new SuperMap.Plot.AlgoSymbol1022(i);default:return null}else{if(421!==t)return null;switch(e){case 311:return new SuperMap.Plot.AlgoSymbol1004(i);case 315:return new SuperMap.Plot.AlgoSymbol315(i);case 317:return new SuperMap.Plot.AlgoSymbol1006(i);case 318:return new SuperMap.Plot.AlgoSymbol1002(i);case 319:return new SuperMap.Plot.AlgoSymbol15200(i);default:return null}}},SuperMap.Plot.BasicAlgoSymbolFactory.getSymbolWayType=function(t,e){if(0===t)switch(e){case SuperMap.Plot.SymbolType.POLYLINESYMBOL:case SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL:return SuperMap.Plot.AddPoint_WayType.POLYLINE;case SuperMap.Plot.SymbolType.POLYBEZIERSYMBOL:case SuperMap.Plot.SymbolType.POLYBEZIERCLOSESYMBOL:return SuperMap.Plot.AddPoint_WayType.CURVE;default:return SuperMap.Plot.AddPoint_WayType.UNKNOWN}else if(22===t)switch(e){case 1005:case 1008:case 1012:case 1014:return SuperMap.Plot.AddPoint_WayType.CURVE;case 1007:case 1009:case 1013:case 1015:case 1017:return SuperMap.Plot.AddPoint_WayType.POLYLINE;default:return SuperMap.Plot.AddPoint_WayType.UNKNOWN}},SuperMap.Plot.BasicAlgoSymbolFactory.isAccessServer=function(t,e){if(0===t||22===t)return!1;if(421!==t)return!0;switch(e){case 311:case 317:case 318:case 315:case 319:return!1;default:return!0}},SuperMap.Plot.BasicAlgoSymbolFactory.getDefaultSubSymbols=function(){return[]},SuperMap.Plot.BasicAlgoSymbolFactory.getMinEditPts=function(t,e){if(0===t)switch(e){case SuperMap.Plot.SymbolType.TEXTSYMBOL:case SuperMap.Plot.SymbolType.COMBINATIONALCIRCLE:return 1;case SuperMap.Plot.SymbolType.CIRCLESYMBOL:case SuperMap.Plot.SymbolType.RECTANGLESYMBOL:case SuperMap.Plot.SymbolType.POLYLINESYMBOL:case SuperMap.Plot.SymbolType.POLYBEZIERSYMBOL:case SuperMap.Plot.SymbolType.KIDNEY:case SuperMap.Plot.SymbolType.ARROWLINE:case SuperMap.Plot.SymbolType.BRACESYMBOL:case SuperMap.Plot.SymbolType.CURVEEIGHT:case SuperMap.Plot.SymbolType.FREECURVE:case SuperMap.Plot.SymbolType.LINEMARKING:case SuperMap.Plot.SymbolType.LINERELATION:case SuperMap.Plot.SymbolType.NODECHAIN:case SuperMap.Plot.SymbolType.PATHTEXT:case SuperMap.Plot.SymbolType.REGULARPOLYGON:case SuperMap.Plot.SymbolType.RUNWAY:case SuperMap.Plot.SymbolType.SYMBOLTEXTBOX:case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOLM:case SuperMap.Plot.SymbolType.CONCENTRICCIRCLE:case SuperMap.Plot.SymbolType.WIRE:return 2;case SuperMap.Plot.SymbolType.ARCSYMBOL:case SuperMap.Plot.SymbolType.CHORDSYMBOL:case SuperMap.Plot.SymbolType.PIESYMBOL:case SuperMap.Plot.SymbolType.ELLIPSESYMBOL:case SuperMap.Plot.SymbolType.PARALLELOGRAM:case SuperMap.Plot.SymbolType.PARALLELLINE:case SuperMap.Plot.SymbolType.POLYBEZIERCLOSESYMBOL:case SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL:case SuperMap.Plot.SymbolType.POLYGONREGION:case SuperMap.Plot.SymbolType.TRAPEZOIDSYMBOL:case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL:return 3}else if(22===t)switch(e){case 1001:case 1003:case 1005:case 1007:case 1008:case 1009:case 1011:case 1012:case 1013:case 1014:case 1015:case 1016:case 1017:case 1019:case 1020:case 1022:return 2;case 1002:case 1004:case 1006:case 1010:case 1018:case 1021:return 3}else if(421===t)switch(e){case 319:return 2;case 311:case 315:case 317:case 318:return 3}},SuperMap.Plot.BasicAlgoSymbolFactory.getMaxEditPts=function(t,e){if(0===t)switch(e){case SuperMap.Plot.SymbolType.TEXTSYMBOL:return 1;case SuperMap.Plot.SymbolType.CIRCLESYMBOL:case SuperMap.Plot.SymbolType.RECTANGLESYMBOL:case SuperMap.Plot.SymbolType.BRACESYMBOL:case SuperMap.Plot.SymbolType.LINEMARKING:case SuperMap.Plot.SymbolType.LINERELATION:case SuperMap.Plot.SymbolType.RUNWAY:case SuperMap.Plot.SymbolType.SYMBOLTEXTBOX:case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOLM:return 2;case SuperMap.Plot.SymbolType.ARCSYMBOL:case SuperMap.Plot.SymbolType.CHORDSYMBOL:case SuperMap.Plot.SymbolType.PIESYMBOL:case SuperMap.Plot.SymbolType.ELLIPSESYMBOL:case SuperMap.Plot.SymbolType.PARALLELOGRAM:case SuperMap.Plot.SymbolType.KIDNEY:case SuperMap.Plot.SymbolType.CONCENTRICCIRCLE:case SuperMap.Plot.SymbolType.CURVEEIGHT:case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL:case SuperMap.Plot.SymbolType.TRAPEZOIDSYMBOL:return 3;case SuperMap.Plot.SymbolType.POLYLINESYMBOL:case SuperMap.Plot.SymbolType.POLYBEZIERSYMBOL:case SuperMap.Plot.SymbolType.PARALLELLINE:case SuperMap.Plot.SymbolType.POLYBEZIERCLOSESYMBOL:case SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL:case SuperMap.Plot.SymbolType.ARROWLINE:case SuperMap.Plot.SymbolType.COMBINATIONALCIRCLE:case SuperMap.Plot.SymbolType.FREECURVE:case SuperMap.Plot.SymbolType.NODECHAIN:case SuperMap.Plot.SymbolType.PATHTEXT:case SuperMap.Plot.SymbolType.POLYGONREGION:case SuperMap.Plot.SymbolType.REGULARPOLYGON:case SuperMap.Plot.SymbolType.WIRE:return 9999}else if(22===t)switch(e){case 1003:case 1019:case 1020:case 1022:return 2;case 1006:case 1021:return 4;case 1001:case 1002:case 1004:case 1005:case 1007:case 1008:case 1009:case 1010:case 1011:case 1012:case 1013:case 1014:case 1015:case 1016:case 1017:case 1018:return 99999}else if(421===t)switch(e){case 317:return 4;case 311:case 315:case 318:case 319:return 99999}},SuperMap.Plot.BasicAlgoSymbolFactory.getDefaultStyle=function(){return{}},SuperMap.Plot.BasicAlgoSymbolFactory.zoomInCalSymbol=function(){if(22!==libID)return!1;switch(code){case 1012:case 1013:case 1014:case 1015:return!0;default:return!1}},SuperMap.Plot.BasicAlgoSymbolFactory.zoomCalSymbol=function(){return!1},SuperMap.Plot.BasicAlgoSymbolFactory.getSymbolName=function(t,e){var i="";if(0===t)switch(e){case SuperMap.Plot.SymbolType.TEXTSYMBOL:i="文本";break;case SuperMap.Plot.SymbolType.CIRCLESYMBOL:i="圆";break;case SuperMap.Plot.SymbolType.RECTANGLESYMBOL:i="矩形";break;case SuperMap.Plot.SymbolType.ARCSYMBOL:i="弧线";break;case SuperMap.Plot.SymbolType.CHORDSYMBOL:i="弓形";break;case SuperMap.Plot.SymbolType.PIESYMBOL:i="扇形";break;case SuperMap.Plot.SymbolType.ELLIPSESYMBOL:i="椭圆";break;case SuperMap.Plot.SymbolType.PARALLELOGRAM:i="平行四边形";break;case SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL:i="多边形";break;case SuperMap.Plot.SymbolType.POLYLINESYMBOL:i="折线";break;case SuperMap.Plot.SymbolType.POLYBEZIERSYMBOL:i="贝赛尔曲线";break;case SuperMap.Plot.SymbolType.POLYBEZIERCLOSESYMBOL:i="闭合贝塞尔曲线";break;case SuperMap.Plot.SymbolType.PARALLELLINE:i="平行线";break;case SuperMap.Plot.SymbolType.KIDNEY:i="集结地";break;case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL:i="注记指示框";break;case SuperMap.Plot.SymbolType.ARROWLINE:i="箭头线";break;case SuperMap.Plot.SymbolType.COMBINATIONALCIRCLE:i="组合圆";break;case SuperMap.Plot.SymbolType.CONCENTRICCIRCLE:i="同心圆";break;case SuperMap.Plot.SymbolType.CURVEEIGHT:i="八字形";break;case SuperMap.Plot.SymbolType.FREECURVE:i="自由线";break;case SuperMap.Plot.SymbolType.ANNOFRAMESYMBOLM:i="多角标注框";break;case SuperMap.Plot.SymbolType.LINEMARKING:i="线型标注";break;case SuperMap.Plot.SymbolType.LINERELATION:i="对象间连线";break;case SuperMap.Plot.SymbolType.NODECHAIN:i="节点链";break;case SuperMap.Plot.SymbolType.PATHTEXT:i="沿线注记";break;case SuperMap.Plot.SymbolType.POLYGONREGION:i="多边形区域管理";break;case SuperMap.Plot.SymbolType.RUNWAY:i="跑道线";break;case SuperMap.Plot.SymbolType.SYMBOLTEXTBOX:i="标注框";break;case SuperMap.Plot.SymbolType.REGULARPOLYGON:i="正多边形";break;case SuperMap.Plot.SymbolType.BRACESYMBOL:i="大括号";break;case SuperMap.Plot.SymbolType.TRAPEZOIDSYMBOL:i="梯形";break;case SuperMap.Plot.SymbolType.WIRE:i="铁丝网"}return i};var Z=SuperMap.Plot.AlgoSymbolFactory=SuperMap.Plot.AlgoSymbolFactory||{};SuperMap.Plot.AlgoSymbolFactory.getAlgoSymbol=function(t){var e=t.libID,i=t.code;return 0!==e&&22!==e&&421!==e||void 0===SuperMap.Plot.BasicAlgoSymbolFactory?100===e&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.getAlgoSymbol(e,i,t):123===e&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.getAlgoSymbol(e,i,t):999===e&&void 0!==SuperMap.Plot.YJAlgoSymbolFactory?SuperMap.Plot.YJAlgoSymbolFactory.getAlgoSymbol(e,i,t):null:SuperMap.Plot.BasicAlgoSymbolFactory.getAlgoSymbol(e,i,t)},SuperMap.Plot.AlgoSymbolFactory.getSymbolWayType=function(t,e){if(0===t)switch(e){case SuperMap.Plot.SymbolType.POLYLINESYMBOL:case SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL:return SuperMap.Plot.AddPoint_WayType.POLYLINE;case SuperMap.Plot.SymbolType.POLYBEZIERSYMBOL:case SuperMap.Plot.SymbolType.POLYBEZIERCLOSESYMBOL:return SuperMap.Plot.AddPoint_WayType.CURVE;default:return SuperMap.Plot.AddPoint_WayType.UNKNOWN}if(22===t)switch(e){case 1005:case 1008:case 1012:case 1014:return SuperMap.Plot.AddPoint_WayType.CURVE;case 1007:case 1009:case 1013:case 1015:return SuperMap.Plot.AddPoint_WayType.POLYLINE;default:return SuperMap.Plot.AddPoint_WayType.UNKNOWN}if(100===t)switch(e){case 15200:case 15201:case 16203:case 17703:case 17704:case 21400:case 21401:case 21500:case 21501:case 21502:case 21503:case 21504:case 21600:case 21900:case 22e3:case 22103:case 23800:case 24700:case 25201:case 25400:case 25601:case 25801:case 25901:case 26500:case 26501:case 26502:case 26503:case 26600:case 28900:case 29e3:case 29003:case 29903:case 3e4:case 30001:case 30002:case 30100:case 30102:case 30200:case 30201:case 30800:case 31803:case 33400:case 34900:case 34901:case 34902:case 35e3:case 36400:case 44200:case 3010102:case 3010103:case 3010104:case 3010105:case 3010106:case 3010107:case 3010108:case 3010301:case 3010302:case 3010303:case 3010304:case 16500:case 17400:case 17401:case 17500:case 17501:case 23400:case 23500:case 23600:case 23700:case 27300:case 28200:case 28300:case 28400:case 37600:case 37601:case 37700:case 39e3:case 40100:case 40101:case 42400:case 2350001:case 3032e3:case 4010800:case 4010801:case 4011100:case 4011101:case 4022100:case 4022101:case 4022102:case 39101:case 44300:case 22200:case 27701:return SuperMap.Plot.AddPoint_WayType.CURVE;case 12500:case 12502:case 16100:case 20300:case 25501:case 25502:case 25503:case 32900:case 34700:case 35200:case 36401:case 41200:case 41201:case 41202:case 42700:case 44400:return SuperMap.Plot.AddPoint_WayType.POLYLINE;default:return SuperMap.Plot.AddPoint_WayType.UNKNOWN}if(123===t)switch(e){case 21003:case 21207:case 2120701:case 2121503:case 21218:case 30008:case 3000801:case 3000802:case 3000803:case 3000804:case 3000805:case 3000806:case 3000807:case 3000808:case 3000809:case 30009:case 5021803:case 5022001:case 5022002:case 40301:case 4030101:case 4030102:case 4030103:case 4030104:case 40303:case 4030301:case 4030302:case 4030303:case 50101:case 5010101:case 50102:case 5010201:case 5010202:case 5010203:case 5010204:case 50103:case 5010301:case 5010302:case 5010303:case 5010304:case 50107:case 5010701:case 50210:case 50220:case 50221:case 50225:case 5030102:case 50303:case 5030301:case 50309:case 50320:case 5032001:case 5032002:case 5032003:case 50321:case 5032101:case 5032102:case 50322:case 5032201:case 50330:case 5033001:case 5034203:case 5035201:case 5035204:case 60205:case 90105:return SuperMap.Plot.AddPoint_WayType.CURVE;case 20915:case 2091502:case 2092101:case 2120702:case 21216:case 2121601:case 2121602:case 21605:case 30010:case 30011:case 3001101:case 3001102:case 3001103:case 3001104:case 3001105:case 30012:case 30020:case 3002001:case 3002002:case 3002005:case 30025:case 3002501:case 30026:case 40104:case 40302:case 4030201:case 4030202:case 4030203:case 4030204:case 50227:case 5035205:case 60301:case 6030101:case 6030102:case 6030103:case 6030104:case 6030105:case 6030106:case 6030107:case 70202:case 7020201:case 7020202:case 90107:return SuperMap.Plot.AddPoint_WayType.POLYLINE;default:return SuperMap.Plot.AddPoint_WayType.UNKNOWN}},SuperMap.Plot.AlgoSymbolFactory.isAccessServer=function(t,e){return 0!==t&&22!==t&&421!==t||void 0===SuperMap.Plot.BasicAlgoSymbolFactory?100===t&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.isAccessServer(t,e):123===t&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.isAccessServer(t,e):999!==t||void 0===SuperMap.Plot.YJAlgoSymbolFactory||SuperMap.Plot.YJAlgoSymbolFactory.isAccessServer(t,e):SuperMap.Plot.BasicAlgoSymbolFactory.isAccessServer(t,e)},SuperMap.Plot.AlgoSymbolFactory.getDefaultSubSymbols=function(t,e){return 100===t&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.getDefaultSubSymbols(t,e):123===t&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.getDefaultSubSymbols(t,e):999===t&&void 0!==SuperMap.Plot.YJAlgoSymbolFactory?SuperMap.Plot.YJAlgoSymbolFactory.getDefaultSubSymbols(t,e):[]},SuperMap.Plot.AlgoSymbolFactory.getMinEditPts=function(t,e){return 0!==t&&22!==t&&421!==t||void 0===SuperMap.Plot.BasicAlgoSymbolFactory?100===t&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.getMinEditPts(t,e):123===t&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.getMinEditPts(t,e):999===t&&void 0!==SuperMap.Plot.YJAlgoSymbolFactory?SuperMap.Plot.YJAlgoSymbolFactory.getMinEditPts(t,e):0:SuperMap.Plot.BasicAlgoSymbolFactory.getMinEditPts(t,e)},SuperMap.Plot.AlgoSymbolFactory.getMaxEditPts=function(t,e){return 0!==t&&22!==t&&421!==t||void 0===SuperMap.Plot.BasicAlgoSymbolFactory?100===t&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.getMaxEditPts(t,e):123===t&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.getMaxEditPts(t,e):999===t&&void 0!==SuperMap.Plot.YJAlgoSymbolFactory?SuperMap.Plot.YJAlgoSymbolFactory.getMaxEditPts(t,e):0:SuperMap.Plot.BasicAlgoSymbolFactory.getMaxEditPts(t,e)},SuperMap.Plot.AlgoSymbolFactory.getDefaultStyle=function(t,e){return 100===t&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.getDefaultStyle(t,e):123===t&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.getDefaultStyle(t,e):999===t&&void 0!==SuperMap.Plot.YJAlgoSymbolFactory?SuperMap.Plot.YJAlgoSymbolFactory.getDefaultStyle(t,e):{}},SuperMap.Plot.AlgoSymbolFactory.getSymbolName=function(t,e){return 0!==t&&22!==t&&421!==t||void 0===SuperMap.Plot.BasicAlgoSymbolFactory?"":SuperMap.Plot.BasicAlgoSymbolFactory.getSymbolName(t,e)},SuperMap.Plot.AlgoSymbolFactory.canPolylineConnect=function(t,e){if(100!==t)return!1;switch(e){case 16500:case 17400:case 17401:case 17500:case 17501:case 23400:case 23500:case 23600:case 23700:case 27300:case 28200:case 28300:case 28400:case 37600:case 37601:case 37700:case 39e3:case 40100:case 40101:case 42200:case 42400:case 2350001:case 3032e3:case 4010800:case 4010801:case 4011100:case 4011101:case 4022100:case 4022101:case 4022102:return!0;default:return!1}},SuperMap.Plot.AlgoSymbolFactory.zoomInCalSymbol=function(t,e){return 0!==t&&22!==t&&421!==t||void 0===SuperMap.Plot.BasicAlgoSymbolFactory?100===t&&void 0!==SuperMap.Plot.JBAlgoSymbolFactory?SuperMap.Plot.JBAlgoSymbolFactory.zoomInCalSymbol(t,e):123===t&&void 0!==SuperMap.Plot.WJAlgoSymbolFactory?SuperMap.Plot.WJAlgoSymbolFactory.zoomInCalSymbol(t,e):999===t&&void 0!==SuperMap.Plot.YJAlgoSymbolFactory?SuperMap.Plot.YJAlgoSymbolFactory.zoomInCalSymbol(t,e):0:SuperMap.Plot.BasicAlgoSymbolFactory.zoomInCalSymbol(t,e)},SuperMap.Plot.AlgoSymbolFactory.zoomCalSymbol=function(t,e){if((0===t||22===t||421===t)&&void 0!==SuperMap.Plot.BasicAlgoSymbolFactory)return SuperMap.Plot.BasicAlgoSymbolFactory.zoomCalSymbol(t,e);if(100===t)switch(e){case 28e3:case 28100:case 28200:case 28201:case 32300:return!0;default:return!1}else{if(123!==t||void 0===SuperMap.Plot.WJAlgoSymbolFactory)return!1;switch(e){case 50312:case 50313:case 50314:case 50348:return!0;default:return!1}}},L.supermap.plotting=L.supermap.plotting||{};var K=L.Path.extend({options:{text:"",labelAlign:"cm",labelRotation:0,fontColor:"#000000",fontSize:14,fontOpacity:1,fontFamily:"微软雅黑",fontWeight:"normal",fontStyle:"",fontSpace:0,fontPercent:100,fontStroke:!1,fontStrokeColor:"#ff0000",fontStrokeWidth:2,fontBackground:!1,fontBackgroundColor:"#ff0000",fontShadow:!1,fontShadowColor:"#ff0000",fontShadowOffsetX:0,fontShadowOffsetY:0,interactive:!0},_textNode:null,_backgroundTextNode:null,_shadowTextNode:null,_tspanNodeObj:null,initialize:function(t,e){L.setOptions(this,e),this._latlng=L.latLng(t[0]),this._text=this.options.text,this._tspanNodeObj={}},onAdd:function(){L.Path.prototype.onAdd.call(this)},onRemove:function(){this._removeNode(),L.Path.prototype.onRemove.call(this)},_removeNode:function(){this._textNode&&this._textNode.parentNode&&(L.DomUtil.remove(this._textNode),this.removeInteractiveTarget(this._textNode),delete this._textNode,this._textNode=null),this._backgroundTextNode&&this._backgroundTextNode.parentNode&&(this._renderer._rootGroup.removeChild(this._backgroundTextNode),delete this._backgroundTextNode,this._backgroundTextNode=null),this._shadowTextNode&&this._shadowTextNode.parentNode&&(this._renderer._rootGroup.removeChild(this._shadowTextNode),delete this._shadowTextNode,this._shadowTextNode=null),this._tspanNodeObj={},this._textNode&&(L.DomUtil.remove(this._textNode),this.removeInteractiveTarget(this._textNode),delete this._textNode,this._textNode=null),this._backgroundTextNode&&(delete this._backgroundTextNode,this._backgroundTextNode=null),this._shadowTextNode&&(delete this._shadowTextNode,this._shadowTextNode=null)},setLatLngs:function(t){return this._latlng=L.latLng(t[0]),this.redraw(),this.fire("move",{latlng:this._latlng})},getLatLngs:function(){return[this._latlng]},setText:function(t){return this.options.text=this._text=t,this.redraw()},getText:function(){return this._text},setStyle:function(t){var e=t&&t.text||this._text;return L.Path.prototype.setStyle.call(this,t),this.setText(e),this},getBounds:function(){return this._updateBounds(),this._bounds},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},getPxBounds:function(t){var e=1;this.options.fontPercent&&100!==this.options.fontPercent&&(e=this.options.fontPercent/100);var i=0,o=0,s=this.options.text.split("\n"),l=s.length;if(this._renderer instanceof L.Canvas){var n=[this.options.fontStyle?this.options.fontStyle:"normal","normal",this.options.fontWeight?this.options.fontWeight:"normal",this.options.fontSize?this.options.fontSize+"px":"1em",this.options.fontFamily?this.options.fontFamily:"sans-serif"].join(" ");this._renderer._ctx.font=n,this.options.fontSize=parseFloat(this.options.fontSize);let t=L.Canvas.LABEL_FACTOR[this.options.labelAlign[1]];null==t&&(t=-.5);let a=this._renderer._ctx.measureText("Mg").height||this._renderer._ctx.measureText("xx").width;o=a*t*(l-1)+a*l;for(let t=0;t0?p+=this.options.fontShadowOffsetX:a+=this.options.fontShadowOffsetX,this.options.fontShadowOffsetY>0?u+=this.options.fontShadowOffsetY:r+=this.options.fontShadowOffsetY),this._eventParents)if(this._eventParents[y].symbolType===SuperMap.Plot.SymbolType.TEXTSYMBOL&&0===this.options.fontPercent&&0===this.options.fontPercent){var c=p-a,S=(c+this.options.fontSpace*(this.options.text.length-1))*this.options.fontPercent/100-c;switch(h){case"lt":case"lm":case"lb":p+=S;break;case"rt":case"rm":case"rb":a-=S;break;case"ct":case"cm":case"cb":a-=S/2,p+=S/2}}var P=new L.Bounds;if(this.options.labelRotation&&0!==this.options.labelRotation){var g=[];g.push(L.point(a,r)),g.push(L.point(a,u)),g.push(L.point(p,r)),g.push(L.point(p,u));var d=this.options.labelRotation*(Math.PI/180);for(let t=0;t=1?t.touches[0]:t,i=this._plottingObject._map.mouseEventToLatLng(e);if("touchmove"===t.type&&!this._plottingObject._dragMoved){var o=this._plottingObject._map.latLngToLayerPoint(this._dragStartPoint),s=this._plottingObject._map.mouseEventToContainerPoint(e);if(o.distanceTo(s)<=this._plottingObject._map.options.tapTolerance)return}var l=i.lat,n=i.lng,a=l-this._startPoint.lat,r=n-this._startPoint.lng;(a||r)&&(this._plottingObject._dragMoved||(this._plottingObject._dragMoved=!0,this._plottingObject.fire("dragstart",t)),this._startPoint.lat=l,this._startPoint.lng=n,this._plottingObject.fire("predrag",t),t.dLat=a,t.dLng=r,this._plottingObject.fire("drag",t))},_onDragEnd:function(t){var e,i,o,s,l=this._plottingObject._map.mouseEventToLatLng(t),n=this.moved();if(n&&L.DomEvent.stop(t),L.DomEvent.off(document,"mousemove touchmove",this._onDrag,this),L.DomEvent.off(document,"mouseup touchend",this._onDragEnd,this),n){this._plottingObject.fire("dragend",{distance:(e=this._dragStartPoint,i=l,o=e.x-i.x,s=e.y-i.y,Math.sqrt(o*o+s*s))});var a=this._plottingObject._containsPoint;this._plottingObject._containsPoint=L.Util.falseFn,L.Util.requestAnimFrame(function(){L.DomEvent.skipped({type:"click"}),this._plottingObject._containsPoint=a},this)}this._startPoint=null,this._dragStartPoint=null,this._plottingObject._dragMoved=!1,this._mapDraggingWasEnabled&&(n&&L.DomEvent.fakeStop({type:"click"}),this._plottingObject._map.dragging.enable()),n&&(this._plottingObject.moveend=!0)}}),lt=L.Evented.extend({dragging:null,uuid:null,libID:null,code:null,minEditPts:1,maxEditPts:1,symbolType:null,symbolName:null,isSelected:!1,enableEdit:!0,note:"",extendProperty:null,custom:null,symbolData:null,dRotate:null,dScale:null,textContent:null,annotationPosition:4,subSymbols:null,fromZoom:null,style:null,isLocked:!1,anchorPoint:null,avoidRegions:null,ownerGroup:null,geoSymbolTexts:null,isEdit:!1,components:null,options:{},_defaultStyle:{display:"display",color:"#ff0000",lineSymbolID:0,opacity:"1.00",weight:2,strokelinecap:"square",strokelinejoin:"square",surroundLineColor:"#ffff00",surroundLineColorOpacity:"1.00",surroundLineWidth:4,fillSymbolID:1,fillColor:"#ff0000",fillOpacity:"0.31",fillBackColor:"#ff0000",fillBackOpacity:"1.00",fillGradientMode:"NONE",fontColor:"#000000",fontFamily:"Microsoft YaHei",fontSize:"12",fontStroke:!1,fontStrokeColor:"#ff0000",fontStrokeWidth:"2px",fontBackground:!1,fontBackgroundColor:"#ff0000",fontShadow:!1,fontShadowColor:"#ff0000",fontShadowOffsetX:0,fontShadowOffsetY:0,fontSpace:0,fontPercent:100,sizeFixed:!0,labelAlign:"lt",labelRotation:-0,labelXOffset:0,labelYOffset:0,fillAngle:0,fillCenterOffsetX:0,fillCenterOffsetY:0},initialize:function(t,e,i,o){this.components=[],this.libID=t,this.code=e,this.extendProperty=new SuperMap.Plot.ExtendProperty,this.avoidRegions=[],this.subSymbols=[],this.geoSymbolTexts=[],this.dRotate=0,this.dScale=1,this.textContent="",this.associatedUuid="",o&&o.symbolData&&(this._removeRedundancySymbolData(o.symbolData),this.symbolData=SuperMap.Plot.PlottingUtil.cloneObject(o.symbolData),SuperMap.Plot.AnalysisSymbol.parseSymbolData(this,this.symbolData,!0),SuperMap.Util.applyDefaults(this.style,this._defaultStyle),delete o.symbolData),this._mergeDefaultStyle(),SuperMap.Util.extend(this,o),null===this.uuid&&(this.uuid=SuperMap.Plot.PlottingUtil.generateUuid()),null===this.style?this.style=SuperMap.Plot.PlottingUtil.cloneObject(this._defaultStyle):this.style.fontSize=this._defaultStyle.fontSize;for(var s=0;s9?this.symbolType===SuperMap.Plot.SymbolType.REGULARPOLYGON?(t.handlePoints.push(this.getLatLngs()[0].clone()),t.handlePoints.push(this.getLatLngs()[this.getLatLngs().length-1].clone())):t.handlePoints=L.Util.cloneLatLngs(this.getLatLngs()):t.handlePoints=this._getHandlePointsByBounds(e);for(var i=0;ithis.symbolSizeInLib.w&&(e=this.symbolSizeInLib.h),0===e||0===t.dotSymbolSize)0!==this.symbolSize.w&&0!==this.symbolSize.h||(this.symbolSize.w=this.symbolSizeInLib.w,this.symbolSize.h=this.symbolSizeInLib.h);else{var i=t.dotSymbolSize/e;this.symbolSize.w=i*this.symbolSizeInLib.w,this.symbolSize.h=i*this.symbolSizeInLib.h}}-1!==t.dotTextSpace&&(this.space=t.dotTextSpace),-1!==t.flagTextSize&&(this.flagTextSize=t.flagTextSize)}this.symbolType!==SuperMap.Plot.SymbolType.DOTSYMBOL&&this.symbolType!==SuperMap.Plot.SymbolType.ALGOSYMBOL||(-1!==t.maxScale&&(this.maxScale=t.maxScale),-1!==t.minScale&&(this.minScale=t.minScale)),-1!==t.scaleByMap&&(this.scaleByMap=t.scaleByMap)}},_removeRedundancySymbolData:function(t){null!==t&&(t.hasOwnProperty("center")&&delete t.center,t.hasOwnProperty("id")&&delete t.id,t.hasOwnProperty("parts")&&delete t.parts,t.hasOwnProperty("points")&&delete t.points,t.hasOwnProperty("position")&&delete t.position,t.hasOwnProperty("prjCoordSys")&&delete t.prjCoordSys,t.hasOwnProperty("rotationX")&&delete t.rotationX,t.hasOwnProperty("rotationY")&&delete t.rotationY,t.hasOwnProperty("rotationZ")&&delete t.rotationZ,t.hasOwnProperty("scaleX")&&delete t.scaleX,t.hasOwnProperty("scaleY")&&delete t.scaleY,t.hasOwnProperty("scaleZ")&&delete t.scaleZ)},destroy:function(){this.dragging=null,this.uuid=null,this.libID=null,this.code=null,this.minEditPts=0,this.maxEditPts=0,this.symbolType=null,this.symbolName=null,this.isSelected=!1,this.enableEdit=!1,this.note="",this.extendProperty=null,this.custom=null,this.symbolData=null,this.dScale=null,this.textContent=null,this.annotationPosition=null,this.subSymbols=null,this.fromZoom=null,this.style=null,this.isLocked=!1,this.anchorPoint=null,this.avoidRegions=null,this.ownerGroup=null,this.geoSymbolTexts=null,this.isEdit=null,this.layer.removeFeatures(this),this._render=null,this.layer=null},toGeoJsonStr:function(){return this.getSymbolData(),SuperMap.Plot.PlottingUtil.toJSON(this.symbolData)}});L.supermap.plotting.PlottingObject=lt,lt.prototype._containsPoint=function(t){if(this.symbolType!==SuperMap.Plot.SymbolType.TEXTSYMBOL)return!1;for(var e in this.components)if(this.components[e]._containsPoint(t))return!0;return!1},L.supermap.plotting.PlottingObject.createSymbol=function(t,e,i,o,s,l){o||(o={}),o.custom=l;var n=null;if(o&&o.symbolData&&o.symbolData.textStyle2D&&(o.symbolData.textStyle2D.sizeFixed=!0),0===t)switch(e){case SuperMap.Plot.SymbolType.ARCREGION:n=L.supermap.plotting.arcRegion(t,e,i,o);break;case SuperMap.Plot.SymbolType.MISSILEROUTE:n=L.supermap.plotting.missileRoute(t,e,i,o);break;case SuperMap.Plot.SymbolType.NAVYROUTE:n=L.supermap.plotting.navyRoute(t,e,i,o);break;case SuperMap.Plot.SymbolType.AIRROUTE:n=L.supermap.plotting.airRoute(t,e,i,o);break;case SuperMap.Plot.SymbolType.LITERATESIGN:n=L.supermap.plotting.literateSign(t,e,i,o);break;case SuperMap.Plot.SymbolType.ROUTENODE:n=L.supermap.plotting.routeNode(t,e,i,o);break;case SuperMap.Plot.SymbolType.PATHTEXT:n=L.supermap.plotting.pathText(t,e,i,o);break;case SuperMap.Plot.SymbolType.LINERELATION:n=L.supermap.plotting.lineRelation(t,e,i,o);break;case SuperMap.Plot.SymbolType.GROUPOBJECT:n=L.supermap.plotting.groupObject(t,e,i,o);break;case SuperMap.Plot.SymbolType.INTERFERENCEBEAM:n=L.supermap.plotting.interferenceBeam(t,e,i,o);break;case SuperMap.Plot.SymbolType.SATELLITE:n=L.supermap.plotting.satellite(t,e,i,o);break;case SuperMap.Plot.SymbolType.SATELLITETIMEWINDOWS:n=L.supermap.plotting.satelliteTimeWindows(t,e,i,o);break;case SuperMap.Plot.SymbolType.SYMBOLTEXT:n=L.supermap.plotting.symbolText(t,e,i,o);break;case SuperMap.Plot.SymbolType.SYMBOLTEXT1:n=L.supermap.plotting.symbolText1(t,e,i,o);break;case SuperMap.Plot.SymbolType.FLAGGROUP:n=L.supermap.plotting.flagGroup(t,e,i,o);break;case SuperMap.Plot.SymbolType.NAVYDEPLOYMENT:n=L.supermap.plotting.navyDeployment(t,e,i,o);break;case SuperMap.Plot.SymbolType.AIRDEPLOYMENT:n=L.supermap.plotting.airDeployment(t,e,i,o);break;case SuperMap.Plot.SymbolType.AVOIDREGION:return L.supermap.plotting.avoidRegion(t,e,i,o);default:n=L.supermap.plotting.algoSymbol(t,e,i,o)}else n=o.symbolData&&o.symbolData.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL?L.supermap.plotting.dotSymbol(t,e,i,o):L.supermap.plotting.algoSymbol(t,e,i,o);var a=L.supermap.plotting.getControl().getDefaultStyle();return SuperMap.Plot.AnalysisSymbol.mergeDefaultStyleToFeature(n,a,!0),s&&SuperMap.Util.extend(n.style,s),i&&null!==i&&(SuperMap.Util.isArray(i)||(i=[i]),i.length>n.maxEditPts&&(i=i.slice(0,n.maxEditPts)),n.latLngs=L.Util.cloneLatLngs(i)),n};var nt=lt.extend({subObjects:[],initialize:function(t,e,i,o){this.subObjects=[],this.symbolName="组合对象",this.libID=0,this.code=SuperMap.Plot.SymbolType.GROUPOBJECT,this.symbolType=SuperMap.Plot.SymbolType.GROUPOBJECT,lt.prototype.initialize.call(this,t,e,i,o)},_addComponents:function(t){lt.prototype._addComponents.call(this,t),t.layer=this.layer,t.isEdit=!0,st&&(t.dragging||(t.dragging=new st(t))),null===t.fromZoom&&(t.fromZoom=this._map.getZoom()),this._map&&this._map.getPlotEditControl()&&t.enableEdit&&this._map.getPlotEditControl().enableEditFeatures(t)},_clearComponents:function(){this._map&&this._map.getPlotEditControl()&&this._map.getPlotEditControl().disableEditFeatures(this.components),lt.prototype._clearComponents.call(this)},_reView:function(){for(var t in this.components)this.components[t]._reView();this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)},move:function(t,e){for(var i in this.subObjects)this.subObjects[i].move(t,e)},redraw:function(){if("none"!==this.style.display){if(0!==this.subObjects.length&&0===this.components.length)for(var t=0,e=this.subObjects.length;t0&&(this.latLngs=L.Util.isArray(i)?i:[i]),SuperMap.Util.extend(this,o),void 0!==this.uuid&&null!==this.uuid||(this.uuid=SuperMap.Plot.PlottingUtil.generateUuid())},destroy:function(){this.libID=null,this.code=null,this.symbolType=null,this.symbolName=null,this.uuid=null,this.associatedUuid=null,this.minEditPts=null,this.maxEditPts=null,this.latLngs=null,this.components=[]},onAdd:function(t){this.layer=t,this._renderer=t._renderer,this._map=t._map,this.redraw(),st&&(this.dragging||(this.dragging=new st(this)))},_clearComponents:function(){for(var t=0;t=this.minEditPts){let t=new L.Polygon(this.getLatLngs(),{smoothFactor:.05});this._addComponents(t),t.setStyle(this.style)}else if(this.getLatLngs().length>=2&&this.getLatLngs().length=p&&s<=h||p>h&&s<=p&&s>=h)){S=-1;break}y<=o||r!==u&&(yMath.max(r,u))||(p=p&&sh&&s=h)&&++S}else if(s===p&&(r<=u&&o>=r&&o<=u||r>=u&&o<=r&&o>=u)){S=-1;break}return-1===S?1:!!(1&S)},_relationToLayer:function(t){var e=2,i=[];if(t instanceof L.Polygon)(i=L.Util.latLngsToSuperMapPoints(t.getLatLngs()[0])).push(i[0].clone());else if(t instanceof L.Polyline)i=L.Util.latLngsToSuperMapPoints(t.getLatLngs());else if(t instanceof K){var o=t.getBounds();i.push(new SuperMap.Geometry.Point(o.left,o.top)),i.push(new SuperMap.Geometry.Point(o.left,o.bottom)),i.push(new SuperMap.Geometry.Point(o.right,o.bottom)),i.push(new SuperMap.Geometry.Point(o.top,o.right))}if(0===i.length)e=2;else{var s=this._containsPoint(i[0]);s&&(e=1);for(let t=1;t1&&(o.push(s),s=[]);0!==s.length&&o.push(s);var r=o.length;if(!0===e&&r>1&&SuperMap.Plot.PlottingUtil.equalFuzzy(o[0][0].x,o[r-1][o[r-1].length-1].x)&&SuperMap.Plot.PlottingUtil.equalFuzzy(o[0][0].y,o[r-1][o[r-1].length-1].y)){for(var p=0;p0;)if(1===o.length)n.push(o[0]),o.splice(0,1);else{for(var a=0,r=SuperMap.Plot.PlottingUtil.distance(t,o[0]),p=1;pi?(this.symbolData.localePoints[i].x=this.getLatLngs()[i].lng,this.symbolData.localePoints[i].y=this.getLatLngs()[i].lat):this.symbolData.localePoints.push({x:this.getLatLngs()[i].lng,y:this.getLatLngs()[i].lat,z:0})}},_parseSymbolData:function(){if(lt.prototype._parseSymbolData.call(this),null!==this.symbolData&&(this.style=SuperMap.Plot.AnalysisSymbol.getStyle(this.symbolData,!0),this.maxEditPts=this.symbolData.algoMaxEditPts,this.minEditPts=this.symbolData.algoMinEditPts,void 0!==this.symbolData.isEdit&&(this.isEdit=this.symbolData.isEdit),void 0!==this.symbolData.scaleByMap&&(this.scaleByMap=this.symbolData.scaleByMap),this.surroundLineType=this.symbolData.surroundLineType,this.symbolData.localePoints)){this.latLngs=[];for(var t=0;t=2&&new SuperMap.Plot.CalculateCanvasGradient(this,this.components[t].getBounds()).createFillMode(this.components[t].options):this._computeGradientInCanvas(this.components[t],this.components[t].options,this.style))},_rotate:function(t,e){for(var i in this.components)this.components[i]instanceof ut?this.components[i]._rotate(t,e):(this.components[i]instanceof Q&&(this.components[i].options.rotation+=-t),this.components[i]instanceof K&&(this.components[i].options.labelRotation?(this.components[i].options.labelRotation+=-t,this.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL&&0===this.components[i].options.labelRotation&&(this.components[i].options.labelRotation=360)):this.components[i].options.labelRotation=-t),L.Util.rotateLatLngs(this.components[i].getLatLngs(),e,t),this.components[i].setLatLngs(this.components[i].getLatLngs()));L.Util.rotateLatLngs(this.getLatLngs(),e,t)},_move:function(t,e){for(var i=0,o=this.components.length;i0){for(let t in this.radius)this.scaleValues[t]=this.radius[t];delete this.radius}}else 0===this.libID&&this.symbolType===SuperMap.Plot.SymbolType.CONCENTRICCIRCLE?(null!==this.startAngle&&void 0!==this.startAngle&&(this.scaleValues[0]=this.startAngle,delete this.startAngle),null!==this.endAngle&&void 0!==this.endAngle&&(this.scaleValues[1]=this.endAngle,delete this.endAngle)):0===this.libID&&this.symbolType===SuperMap.Plot.SymbolType.POLYGONREGION&&(this.annotationPosition>this.getLatLngs()?this.scaleValues[1]=0:null==this.scaleValues[1]&&(this.scaleValues[1]=this.annotationPosition));SuperMap.Plot.AlgoSymbolFactory.isAccessServer(this.libID,this.code)||(this.minEditPts=SuperMap.Plot.AlgoSymbolFactory.getMinEditPts(this.libID,this.code),this.maxEditPts=SuperMap.Plot.AlgoSymbolFactory.getMaxEditPts(this.libID,this.code),0===this.subSymbols.length&&(this.subSymbols=SuperMap.Plot.AlgoSymbolFactory.getDefaultSubSymbols(this.libID,this.code)),null!==this.style&&!1===this.isEdit&&(this.style=SuperMap.Plot.PlottingUtil.copyAttributes(this.style,SuperMap.Plot.AlgoSymbolFactory.getDefaultStyle(this.libID,this.code))),this.controlPoints=L.Util.latLngsToSuperMapPoints(this.latLngs),this.superMapAlgoSymbol=SuperMap.Plot.AlgoSymbolFactory.getAlgoSymbol(this),this.scaleValues=this.superMapAlgoSymbol.scaleValues,0!==this.libID||this.symbolType!==SuperMap.Plot.SymbolType.SYMBOLTEXTBOX&&this.symbolType!==SuperMap.Plot.SymbolType.LINEMARKING||(this.textBoxType=this.superMapAlgoSymbol.textBoxType),delete this.controlPoints),this._setBasicSymbolName()},onAdd:function(t){this.superMapAlgoSymbol&&(this.superMapAlgoSymbol.map=t._map),ut.prototype.onAdd.call(this,t)},getTextContent:function(){return this.textContent},getArrowHeadType:function(){return this.arrowHeadType},setArrowHeadType:function(t){1016===this.code&&this.arrowHeadType!==t&&(this.arrowHeadType=t,this.redraw())},getArrowTailType:function(){return this.arrowTailType},setArrowTailType:function(t){1016===this.code&&this.arrowTailType!==t&&(this.arrowTailType=t,this.redraw())},getArrowBodyType:function(){return this.arrowBodyType},setArrowBodyType:function(t){1016===this.code&&this.arrowBodyType!==t&&(this.arrowBodyType=t,this.redraw())},setRotate:function(t){this.dRotate+=t,0!==this.textContent.length&&(void 0===this.style.labelRotation?this.style.labelRotation=-t:this.style.labelRotation+=-t),null===this.anchorPoint&&this.symbolType!==SuperMap.Plot.SymbolType.TEXTSYMBOL&&this.symbolType!==SuperMap.Plot.SymbolType.CONCENTRICCIRCLE?this.anchorPoint=this.getBounds().getCenter():null===this.anchorPoint&&(this.anchorPoint=L.latLng(this.latLngs[0].lat,this.latLngs[0].lng)),this._rotate(t,this.anchorPoint);for(var e=0,i=this.avoidRegions.length;ee?this.symbolData.scaleValues[e]=this.scaleValues[e]:this.symbolData.scaleValues.push(this.scaleValues[e]);else this.symbolData.scaleValues=[],this.symbolData.scaleValues=this.scaleValues;1016===this.code&&(this.symbolData.arrowTailType=this.arrowTailType,this.symbolData.arrowBodyType=this.arrowBodyType,this.symbolData.arrowHeadType=this.arrowHeadType)}},_calculateParts:function(){if("none"!==this.style.display)if(this.textContent&&""!==this.textContent&&"???"!==this.textContent||this.symbolType!==SuperMap.Plot.SymbolType.TEXTSYMBOL||(this.textContent="请输入文本"),0!==this.textContent.length&&this.dRotate!==this.style.labelRotation&&(this.style.labelRotation=-this.dRotate),this.superMapAlgoSymbol&&0!==this.getLatLngs().length){if(this.superMapCalculateParts(),this._setBasicSymbolText(),this.symbolType===SuperMap.Plot.SymbolType.ELLIPSESYMBOL){if(3===this.superMapAlgoSymbol.controlPoints.length){var t=new SuperMap.Geometry.Point(2*this.superMapAlgoSymbol.controlPoints[0].x-this.superMapAlgoSymbol.controlPoints[1].x,2*this.superMapAlgoSymbol.controlPoints[0].y-this.superMapAlgoSymbol.controlPoints[1].y);this.superMapAlgoSymbol.controlPoints.push(t);let e=new SuperMap.Geometry.Point(2*this.superMapAlgoSymbol.controlPoints[0].x-this.superMapAlgoSymbol.controlPoints[2].x,2*this.superMapAlgoSymbol.controlPoints[0].y-this.superMapAlgoSymbol.controlPoints[2].y);this.superMapAlgoSymbol.controlPoints.push(e)}else if(5===this.superMapAlgoSymbol.controlPoints.length){let t=new SuperMap.Geometry.Point(2*this.superMapAlgoSymbol.controlPoints[0].x-this.superMapAlgoSymbol.controlPoints[2].x,2*this.superMapAlgoSymbol.controlPoints[0].y-this.superMapAlgoSymbol.controlPoints[2].y);this.superMapAlgoSymbol.controlPoints[4].x=t.x,this.superMapAlgoSymbol.controlPoints[4].y=t.y}this.latLngs=L.Util.superMapPointsToLatLngs(this.superMapAlgoSymbol.controlPoints)}}else!this.superMapAlgoSymbol&&this.getLatLngs().length>=this.minEditPts&&(this._calAccessServerSymbol(),this._setBasicSymbolText())},_calAccessServerSymbol:function(){for(var t=SuperMap.Plot.AnalysisSymbol.analysisSymbolCells(this.symbolData,!0),e=0;e=this.strokeWidth&&(this.style.weight=this.strokeWidth),this.style.weight<=.5&&(this.style.weight=.5)}else!0===this.scaleStrokeWidth&&(this.style.weight=this.strokeWidth,this.scaleStrokeWidth=!1),this.strokeWidth=this.style.weight;if(this.prevStrokeWidth=this.style.weight,34===this.symbolType&&!1===this.style.sizeFixed||34!==this.symbolType)for(var r in this.textContent.length>0&&(this.style.fontSize*=e),this.components)this.components[r]instanceof K&&(this.components[r].options.fontSize*=e);22!==this.libID||1012!==this.code&&1013!==this.code&&1014!==this.code&&1015!==this.code||this.dScale>=1&&this.redraw(),this.layer._map.getRenderer(this.layer)instanceof L.Canvas&&this._updateCanvasFills(),this._updateSymbolTexts(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)}this.fromZoom=this._map.getZoom(),(1===this.surroundLineType||2===this.surroundLineType||SuperMap.Plot.AlgoSymbolFactory.zoomCalSymbol(this.libID,this.code))&&this.redraw(),this.symbolType===SuperMap.Plot.SymbolType.TEXTSYMBOL&&this.isSelected&&this._map.getPlotEditControl()&&this._map.getPlotEditControl().fire(SuperMap.Plot.Event.featuresmodified,{features:[this]})}},_rotate:function(t,e){if(this.symbolType===SuperMap.Plot.SymbolType.TEXTSYMBOL)for(var i in this.components)this.components[i].options.labelRotation=this.style.labelRotation,this.components[i].redraw();if(L.Util.rotateLatLngs(this.getLatLngs(),e,t),L.Util.rotateLatLngs(this.scalePoints,e,t),this.symbolType!==SuperMap.Plot.SymbolType.CONCENTRICCIRCLE||SuperMap.Plot.PlottingUtil.equalFuzzy(Math.abs(this.scaleValues[0]-this.scaleValues[1]),360)||(this.scaleValues[0]+=t,this.scaleValues[1]+=t),SuperMap.Plot.AlgoSymbolFactory.isAccessServer(this.libID,this.code)){var o=new SuperMap.GetSymbolInfoParameters;o.libID=this.libID,o.code=this.code,o.inputPoints=L.Util.latLngsToSuperMapPoints(this.getLatLngs()),o.scaleValues=this.scaleValues,o.subSymbols=this.subSymbols,L.supermap.symbolInfoService(this.serverUrl).getSymbolInfo(o,function(t){this.symbolData.innerCells=t.result.innerCells,this.symbolData.scalePoints=t.result.scalePoints,this.symbolData.scaleValues=t.result.scaleValues,this.redraw(),this._updateSymbolTexts()},this)}else this.superMapAlgoSymbol;this.redraw(),this._updateSymbolTexts()},_resize:function(t,e){ut.prototype._resize.call(this,t,e);var i=new SuperMap.Geometry.Point(e.lng,e.lat);if(this.superMapAlgoSymbol){for(let e=0;e5?this.dScale=5:this.dScale<1&&(this.dScale=1),this.redraw()):this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues),this.fromZoom=this._map.getZoom()},_calculateOffset:function(){var t=this.route._getNodeByUuid(this.towardNode.routeNodeId),e=L.latLng((this.startRouteNode.y+t.y)/2,(this.startRouteNode.x+t.x)/2),i=this._map.latLngToLayerPoint(e),o=this._map.latLngToLayerPoint(this.latLngs[0]);this.towardNode.offsetX=o.x-i.x,this.towardNode.offsetY=o.y-i.y},_getTextContentsCells:function(t){var e=this.towardNode.textContent,i=this.dScale*this.style.fontSize+1,o=this._map.layerPointToLatLng(L.point(0,0)),s=this._map.layerPointToLatLng(L.point(i,0)),l=SuperMap.Plot.PlottingUtil.distance({x:o.lng,y:o.lat},{x:s.lng,y:s.lat}),n=l,a=l*t,r=e.length+2,p=[],u=r*n*.5,h=new Object;h.type=SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,h.positionPoints=[],h.positionPoints.push(new SuperMap.Geometry.Point(u,0)),h.positionPoints.push(new SuperMap.Geometry.Point(-2*n+u,.5*a)),h.positionPoints.push(new SuperMap.Geometry.Point(-r*n+u,.5*a)),h.positionPoints.push(new SuperMap.Geometry.Point(-r*n+u,-.5*a)),h.positionPoints.push(new SuperMap.Geometry.Point(-2*n+u,-.5*a)),h.style={surroundLineFlag:!1,fontSize:12},p.push(h);for(var y=1;y<=e.length;y++){var c=new Object;c.type=SuperMap.Plot.SymbolType.POLYLINESYMBOL,c.positionPoints=[],c.positionPoints.push(new SuperMap.Geometry.Point(-(y+1)*n+u,.5*a)),c.positionPoints.push(new SuperMap.Geometry.Point(-(y+1)*n+u,-.5*a)),c.style={surroundLineFlag:!1,fontSize:12},p.push(c);var S=new Object;S.type=SuperMap.Plot.SymbolType.TEXTSYMBOL,S.positionPoints=[],S.positionPoints.push(new SuperMap.Geometry.Point(-(.5+y+1)*n+u,0)),S.textContent=e[y-1],S.style={surroundLineFlag:!1,fontSize:12,fontFamily:"Microsoft YaHei"},S.style.labelAlign="cm",p.push(S)}var P=new SuperMap.Geometry.Point(-1.4*n+u,0),g=new Object;g.type=SuperMap.Plot.SymbolType.TEXTSYMBOL,g.positionPoints=[],g.positionPoints.push(P),g.textContent=this.towardNode.index.toString(),g.style={surroundLineFlag:!1,fontSize:12,fontSizeLimit:!0,fontFamily:"Microsoft YaHei"},g.style.labelAlign="cm",p.push(g);var d=new Object;return d.type=SuperMap.Plot.SymbolType.CIRCLESYMBOL,d.positionPoints=[],d.positionPoints.push(P),d.positionPoints.push(new SuperMap.Geometry.Point(P.x,.4*n)),d.style={surroundLineFlag:!1,fontSize:12},p.push(d),p}});L.supermap.plotting.literateSign=function(t,e,i,o){return new ct(t,e,i,o)},L.supermap.plotting.LiterateSign=ct;var St=ht.extend({relLineText:0,showPathLine:!0,showPathLineArrow:!1,isCurve:!1,isAvoid:!1,textToLineDistance:0,getRelLineText:function(){return this.relLineText},setRelLineText:function(t){this.relLineText!==t&&(this.relLineText=t,this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues))},getShowPathLine:function(){return this.showPathLine},setShowPathLine:function(t){this.showPathLine!==t&&(this.showPathLine=t,this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues))},getShowPathLineArrow:function(){return this.showPathLineArrow},setShowPathLineArrow:function(t){this.showPathLineArrow!==t&&(this.showPathLineArrow=t,this.showPathLine&&(this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)))},getIsCurveLine:function(){return this.isCurve},setCurveLine:function(t){this.isCurve!==t&&(this.isCurve=t,this.showPathLine&&(this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)))},getIsAvoidLine:function(){return this.isAvoid},setAvoidLine:function(t){this.isAvoid!==t&&(this.isAvoid=t,this.relLineText===SuperMap.Plot.RelLineText.ONLINE&&this.showPathLine&&(this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)))},getSpace:function(){return this.textToLineDistance},setSpace:function(t){this.textToLineDistance!==t&&(this.textToLineDistance=t,this.relLineText!==SuperMap.Plot.RelLineText.ONLINE&&(this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)))},initialize:function(t,e,i,o){this.code=SuperMap.Plot.SymbolType.PATHTEXT,this.libID=0,this.symbolType=SuperMap.Plot.SymbolType.PATHTEXT,this.symbolName="沿线注记",this.minEditPts=2,this.maxEditPts=9999,ht.prototype.initialize.call(this,t,e,i,o)},_reView:function(){this.fromZoom!==this._map.getZoom()&&(this.redraw(),this.fromZoom=this._map.getZoom())},toSuperMapAlgorithms:function(){ht.prototype.toSuperMapAlgorithms.call(this),this.superMapAlgoSymbol.relLineText=this.relLineText,this.superMapAlgoSymbol.showPathLine=this.showPathLine,this.superMapAlgoSymbol.showPathLineArrow=this.showPathLineArrow,this.superMapAlgoSymbol.isCurve=this.isCurve,this.superMapAlgoSymbol.isAvoid=this.isAvoid,this.superMapAlgoSymbol.textToLineDistance=this.textToLineDistance}});L.supermap.plotting.pathText=function(t,e,i,o){return new St(t,e,i,o)},L.supermap.plotting.PathText=St;var Pt=ut.extend({route:null,routeNode:null,_isFirstNode:function(){for(var t=0;t=this.minEditPts){if(this.routeNode.type===SuperMap.Plot.RouteNodeType.STANDBY){var t=SuperMap.Plot.RouteNodePrimitives.getRouteNodeCells(this.routeNode.type,!1,this.routeNode.rotate);this._transformSymbolCellsToGeometrys(t);var e=SuperMap.Plot.RouteNodePrimitives.getRouteNodeCells(this.routeNode.type,!0);this._transformSymbolCellsToGeometrys(e)}else{var i=SuperMap.Plot.RouteNodePrimitives.getRouteNodeCells(this.routeNode.type);this._transformSymbolCellsToGeometrys(i)}if(this.routeNode.style=this.style,null!==this.routeNode.name&&""!==this.routeNode.name){var o=this.getBounds(),s=L.latLng(o.getNorth(),o.getEast()),l=this.routeNode.style;l.labelAlign="lb",this._createAndDrawLayer(SuperMap.Plot.SymbolType.TEXTSYMBOL,[s],l,this.routeNode.name).isNameLayer=!0}}},_transformSymbolCellsToGeometrys:function(t){for(var e=this._map.latLngToLayerPoint(this.latLngs[0]),i=0;i5?this.dScale=5:this.dScale<1&&(this.dScale=1),this.redraw()):this.redraw(),this.fromZoom=this._map.getZoom(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues))}});L.supermap.plotting.routeNode=function(t,e,i,o){return new Pt(t,e,i,o)},L.supermap.plotting.RouteNode=Pt;var gt=lt.extend({routeNodes:[],nextRouteNodeType:SuperMap.Plot.RouteNodeType.TURNING,arrRoutePts:[],initialize:function(t,e,i,o){this.scaleByMap=!0,this.minEditPts=1,this.maxEditPts=9999,this.routeNodes=[],this.arrRoutePts=[],lt.prototype.initialize.call(this,t,e,i,o)},destroy:function(){this.routeNodes=null,this.arrRoutePts=null,lt.prototype.destroy.apply(this,arguments)},highlight:function(t){for(var e in this.highlightFlag=!0,this.highlightStyle=t,this.components)if(this.components[e]instanceof ht){var i=SuperMap.Util.copyAttributes(this.components[e].style,t);this.components[e].setStyle(i)}},unhighlight:function(){for(var t in this.components)if(this.components[t]instanceof ht){var e=SuperMap.Util.copyAttributes(this.components[t].style,this.style);this.components[t].setStyle(e)}this.highlightFlag=!1,this.highlightStyle=null},blinkRoute:function(t,e,i,o){void 0===i&&(i=2),void 0===t&&(t={color:"#ff0000"}),void 0===e&&(e={color:"#0000ff"}),void 0===o&&(o=300);for(var s=[],l=0;l0&&this.removeFeatures(e.geoSymbolTexts));var i=SuperMap.Util.indexOf(this.features,e);-1!==i&&this.features.splice(i,1)}}this._update()},getFeatures:function(){return this.features.slice()},removeAllFeatures:function(){this.removeFeatures(this.features.slice()),this.features=[]},_setCursorStyle:function(t){void 0===t&&(t="");var e=!1;if(this._map.getPlottingLayers().length>1){var i=this._map.getPlottingLayers();for(var o in i)if(i[o]._renderer instanceof L.Canvas)i[o]._renderer._container.style.cursor=t;else if(i[o]._renderer instanceof L.SVG)for(let e=0;e=0?t.negativeImage?new L.latLng(i.getNorth(),i.getEast()):new L.latLng(i.getNorth(),i.getWest()):t.negativeImage?new L.latLng(i.getSouth(),i.getWest()):new L.latLng(i.getSouth(),i.getEast())},_projectPoint:function(t,e,i){if(e===i)return e;var o=new L.latLng(0,0),s=i.lng-e.lng,l=e.lat-i.lat,n=s*s,a=l*l,r=s*l,p=s*s+l*l;return o.lng=(r*(e.lat-t.lat)+e.lng*a+t.lng*n)/p,o.lat=(r*(e.lng-t.lng)+e.lat*n+t.lat*a)/p,o},_modifyPoint:function(t,e){if(0===t)this.subObjects[0].setLatLngs([e]);else{var i=this.subObjects[t-1].latLngs[0],o=this._calculateFlagTop(this.subObjects[t-1]);o=this._pointRotate(this.dRotate,this.subObjects[0].latLngs[0],o);var s=Math.sqrt(Math.pow(i.lng-o.lng,2)+Math.pow(i.lat-o.lat,2)),l=this._projectPoint(e,i,o),n=Math.sqrt(Math.pow(i.lng-l.lng,2)+Math.pow(i.lat-l.lat,2));this.ratio[t-1]=n/s}this.redraw()},_reView:function(){for(var t in this.components)this.components[t].scaleByMap=this.scaleByMap,this.components[t]._reView();this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)},_parseSymbolData:function(){nt.prototype._parseSymbolData.call(this),this.symbolData&&(this.ratio=this.symbolData.ratio)},_setSymbolData:function(){nt.prototype._setSymbolData.call(this),this.symbolData&&(this.symbolData.ratio=this.ratio)}}),Lt=function(t,e,i,o){return new mt(t,e,i,o)};L.supermap.plotting.flagGroup=Lt,L.supermap.plotting.FlagGroup=mt;var Mt=L.Control.extend({_mouseTolerance:10,_editMarkers:null,_editMode:SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE,feature:null,_temportary:null,options:{avoidRegionStyle:{fill:!1,color:"#0000ff",dashArray:"2, 2",opacity:1,weight:1},draggable:!0,avoidIcon:L.divIcon({className:"leaflet-supermap-plot-avoid-icon-path",iconSize:[8,8]}),icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"})},initialize:function(t,e){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,e),L.setOptions(this,e),this._temportary=new dt("avoidRegionControl-temportary",this.serverUrl),this._editMarkers={},this.feature=t},onAdd:function(t){if(this.feature&&!this.feature.getLocked())return this.controlDiv=L.DomUtil.create("div","supermap-iclient-avoidregion"),this._map=t,this._markers=[],this._latlngs=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._map.addLayer(this._temportary),this._map.on("mousemove",this._onMouseMove,this).on("click",this._onMapClick,this),this._showAvoidRegions(),this.controlDiv},onRemove:function(){this._hideAvoidRegions(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,delete this._latlngs,this.plotting&&(this._temportary.removeFeatures(this.plotting),delete this.plotting,this.plotting=null),this._map.removeLayer(this._temportary),delete this._temportary,this._map.off("mousemove",this._onMouseMove,this).off("click",this._onMapClick,this),this._map=null},_showAvoidRegions:function(){for(var t=0;t1&&this._markers[i-1].on("click",this._finishShape,this),i>2&&this._markers[i-2].off("click",this._finishShape,this)},_finishShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this);var t=this.plotting.clone();this._markerGroup.clearLayers(),this._markers=[],this._latlngs=[],this._temportary.removeFeatures(this.plotting),delete this.plotting,this.plotting=null,this._temportary.addFeatures(t),this.feature.addAvoidRegion(t),this._selectFeature(t);var e=new SuperMap.Plot.Transaction;e.transType=SuperMap.Plot.TransactionType.EDIT;var i=new SuperMap.Plot.TransactionInfo;i.layerId=this.feature.layer._leaflet_id,i.uuid=this.feature.uuid,i.functionName="addAvoidRegion",i.undoParams=[t],i.redoParams=[t],e.transInfos.push(i),L.supermap.plotting.getControl().getTransManager().add(e),t.on("contextmenu",function(){})},_onDragStart:function(t){var e=t.target,i=this._editMarkers[e.uuid];for(var o in i)i[o].setOpacity(0)},_onDrag:function(t){t.target.move(t.dLat,t.dLng)},_onDragEnd:function(t){var e=t.target;this._collectEditMarkers(e),this.moveend=!0},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);if(this.plotting){var o=L.Util.cloneLatLngs(this._latlngs);0===o.length?o.push(i):o[o.length-1].lat===i.lat&&o[o.length-1].lng===i.lng||o.push(i),this.plotting.setLatLngs(o)}L.DomEvent.preventDefault(t.originalEvent)}}),bt=dt.extend({tolerancePixel:5,isLocked:!1,isEditable:!0,isSelected:!0,visibility:!0,getSelected:function(){return this.isSelected},setSelected:function(t){this.isSelected!==t&&(this.isSelected=t,this._map&&this._map.getPlotEditControl()&&(this.isSelected?this._map.getPlotEditControl().enableEditFeatures(this.features):this._map.getPlotEditControl().disableEditFeatures(this.features)))},getEditable:function(){return this.isEditable},setEditable:function(t){if(this.isEditable!==t&&(this.isEditable=t,this._map&&this._map.getPlotEditControl())){var e=this._map.getPlotEditControl().getSelectedFeatures();this._map.getPlotEditControl().unselectFeatures(this.features),this._map.getPlotEditControl().selectFeatures(e)}},getLocked:function(){return this.isLocked},setLocked:function(t){if(this.isLocked!==t&&(this.isLocked=t,this._map&&this._map.getPlotEditControl())){var e=this._map.getPlotEditControl().getSelectedFeatures();this._map.getPlotEditControl().unselectFeatures(this.features),this._map.getPlotEditControl().selectFeatures(e)}},getVisibility:function(){return this.visibility},setVisibility:function(t){this.visibility!==t&&(this.visibility=t,this.visibility?this._renderer._container.style.display="block":this._renderer._container.style.display="none")},initialize:function(t,e,i){dt.prototype.initialize.call(this,t,e,i),this.setVisibility(this.visibility)},getFeatureByUuid:function(t){for(var e=0;e1){var s=new nt(0,SuperMap.Plot.SymbolType.GROUPOBJECT,[],{subObjects:i,uuid:e});return this.addFeatures(s),s}return null},unGroupObject:function(t){var e=[];return t.symbolType===SuperMap.Plot.SymbolType.GROUPOBJECT||t.symbolType===SuperMap.Plot.SymbolType.FLAGGROUP?(e=t._unGroupObject(),this.removeFeatures(t),t.destroy()):e.push(t),e},createInterferenceBeam:function(t,e,i,o,s,l){s||(s={}),s.associatedUuid=t,s.uuid=i,s.custom=l;var n=L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.INTERFERENCEBEAM,e,s,o,l);return this.addFeatures(n),n},createSatellite:function(t,e,i,o,s,l,n,a,r){var p=this._getSymbolDataFromCache(t,e);if(null===p){var u=new SuperMap.GetSymbolInfoParameters({libID:t,code:e});L.supermap.symbolInfoService(this.serverUrl).getSymbolInfo(u,function(p){this._cacheSymbolData(p.result),n||(n={}),n.serverUrl=this.serverUrl,n.orbitPoints=i,n.textContent=o,n.uuid=s,n.custom=r,n.subSymbols=[{libID:t,code:e,symbolData:SuperMap.Plot.PlottingUtil.cloneObject(p.result),textContent:o}];var u=L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.SATELLITE,[],n,l,r);this.addFeatures(u),"function"==typeof a&&a({feature:u})},this)}else{n||(n={}),n.serverUrl=this.serverUrl,n.orbitPoints=i,n.textContent=o,n.uuid=s,n.custom=r,n.subSymbols=[{libID:t,code:e,symbolData:p,textContent:o}];var h=L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.SATELLITE,[],n,l,r);this.addFeatures(h),"function"==typeof a&&a({feature:h})}},createSatelliteTimeWindows:function(t,e,i,o,s,l){s||(s={}),s.associatedUuid=t,s.timeWindows=e,s.custom=l,s.uuid=i;var n=L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.SATELLITETIMEWINDOWS,[],s,o,l);return this.addFeatures(n),n},createSatelliteTimeWindows1:function(t,e,i,o,s,l){s||(s={}),s.associatedUuid=t;for(var n=0;n=2800&&t[s].code<=2900&&o.push(t[s]);var l=null;return o.length>1&&(l=new mt(0,SuperMap.Plot.SymbolType.FLAGGROUP,[],{subObjects:o,ratio:e,uuid:i}),this.addFeatures(l)),l},createArcRegion:function(t,e,i,o,s,l,n,a,r,p,u){r||(r={}),r.centerPoint=t,r.radius=e,r.startAngle=i,r.endAngle=o,r.textContent=s,r.textPosition=l,r.uuid=n,r.custom=u,r.spatialAnalystUrl=this.spatialAnalystUrl;var h=new SuperMap.BufferDistance({value:1e3*r.radius}),y=new SuperMap.BufferSetting({endType:SuperMap.BufferEndType.ROUND,leftDistance:h,rightDistance:h,semicircleLineSegment:36}),c=new SuperMap.GeometryBufferAnalystParameters({sourceGeometry:L.marker(r.centerPoint),sourceGeometrySRID:parseInt(this._map.options.crs.code.split(":")[1]),bufferSetting:y}),S=this;L.supermap.spatialAnalystService(this.spatialAnalystUrl).bufferAnalysis(c,function(t){r.circlePts=[];for(var e=t.result.resultGeometry.points,i=0,o=e.length;i0&&(i.subSymbols[r].symbolData=this._getSymbolDataFromCache(i.subSymbols[r].libID,i.subSymbols[r].code),null===i.subSymbols[r].symbolData&&-1===SuperMap.Util.indexOf(a,i.subSymbols[r])&&a.push(i.subSymbols[r]))}for(var h=a.slice(),y=0;y=0&&null===(e=this._selectFeature(this.features[a],t.latlng,n));a--);return e},_getSymbolDataFromCache:function(t,e){var i=L.supermap.plotting.getControl(this._map,this.serverUrl).getSymbolLibManager().getSymbolLibByLibId(t);return null!==i?i.getSymbolData(e):null},_cacheSymbolData:function(t){var e=L.supermap.plotting.getControl(this._map,this.serverUrl).getSymbolLibManager().getSymbolLibByLibId(t.libID);null!==e&&e.cacheSymbolData(t)},_isAvoidRegion:function(...t){if(0!==t.length){let o=null,s=!1;if(0===t[0].avoidRegions.length)return t[0];if(o=new Mt(t[0]),this._map.addControl(o),s=!0){for(var e=0,i=t[0].avoidRegions.length;e=s.getWest()&&e.lng<=s.getEast()&&e.lat>=s.getSouth()&&e.lat<=s.getNorth())return t}else{var l=this._map.latLngToLayerPoint(e);for(let e=0,i=t.components.length;et)return!1;var e=this.getRatioByTime();return!(e>1&&this.lastExecute||e<0)},getRatioByTime:function(){if(this.animationState!==SuperMap.Plot.GOAnimationState.PLAYING)return 0;var t=(new Date).getTime()/1e3;if(this.innerStartTime+this.startTime>t)return 0;var e=(t-this.innerStartTime-this.startTime)/this.duration;return e>=1&&!this.lastExecute?this.repeat?(this.innerStartTime=(new Date).getTime()/1e3,e=0,this.lastExecute=!1,this.animationState=SuperMap.Plot.GOAnimationState.PLAYING):(e=1,this.lastExecute=!0,this.animationState=SuperMap.Plot.GOAnimationState.STOP):e<0&&(e=0),this.ratio=e,e},showAnimationFeature:function(t){if(null!==this.animationGOFeature&&null!==this.animationGOFeature.style&&(this.resetAnimationFeature(t),this.animationGOFeature.redraw()),null!==this.goFeature&&null!==this.goFeature.style){if(t){this.goFeature.style.display="none";for(let t=0;te.length?(this._executeAndRatioIsZero(),!0):(this.animationGOFeature.setLatLngs(L.Util.superMapPointsToLatLngs(e)),!0)},_execute_Generalization:function(t){if(0===this.lineLength&&(this.controlPoints=L.Util.latLngsToSuperMapPoints(this.goFeature.getLatLngs()),this.lineLength=SuperMap.Plot.PlottingUtil.polylineDistance(this.controlPoints)),0===t)return this._executeAndRatioIsZero(),!0;for(var e=[],i=SuperMap.Plot.PlottingUtil.clonePoints(this.controlPoints),o=this._findPos(this.lineLength*t,i),s=0;s<=o.pos;s++)e.push(i[s]);return e.push(o.pts),SuperMap.Plot.AlgoSymbolFactory.isAccessServer(this.animationGOFeature.libID,this.animationGOFeature.code)&&this.goFeature.symbolData.algoMinEditPts>e.length?(this._executeAndRatioIsZero(),!0):(this.animationGOFeature.latLngs=L.Util.superMapPointsToLatLngs(e),this.animationGOFeature.redraw(),!0)},_execute_Rect:function(t){0===this.controlPoints.length&&(this.controlPoints=L.Util.latLngsToSuperMapPoints(this.goFeature.getLatLngs()));var e=new SuperMap.Geometry.Point((this.controlPoints[0].x+this.controlPoints[1].x)/2,(this.controlPoints[0].y+this.controlPoints[1].y)/2),i=Math.abs(this.controlPoints[0].x-this.controlPoints[1].x)/2*t,o=Math.abs(this.controlPoints[0].y-this.controlPoints[1].y)/2*t,s=new SuperMap.Geometry.Point(e.x-i,e.y+o),l=new SuperMap.Geometry.Point(e.x+i,e.y-o);return this.animationGOFeature.setLatLngs(L.Util.superMapPointsToLatLngs([s,l])),!0},_execute_Circle:function(t){0===this.controlPoints.length&&(this.controlPoints=L.Util.latLngsToSuperMapPoints(this.goFeature.getLatLngs()));var e=this.controlPoints[0].clone(),i=t*Math.sqrt((this.controlPoints[0].x-this.controlPoints[1].x)*(this.controlPoints[0].x-this.controlPoints[1].x)+(this.controlPoints[0].y-this.controlPoints[1].y)*(this.controlPoints[0].y-this.controlPoints[1].y));return this.animationGOFeature.setLatLngs(L.Util.superMapPointsToLatLngs([e,new SuperMap.Geometry.Point(e.x+i,e.y)])),!0},_execute_Kidney:function(t){if(0===this.controlPoints.length&&(this.controlPoints=L.Util.latLngsToSuperMapPoints(this.goFeature.getLatLngs())),0===t)return this._executeAndRatioIsZero(),!0;var e=[],i=this.controlPoints.length,o=SuperMap.Plot.PlottingUtil.getPolygonCenterPt(this.controlPoints);if(null===o)return this._executeAndRatioIsZero(),!0;for(var s=0;sl)return!1;var a=SuperMap.Plot.PlottingUtil.linePnt(o,this.controlPoints[s],n);e.push(a)}return this.animationGOFeature.setLatLngs(L.Util.superMapPointsToLatLngs(e)),!0},_execute_RegularPloygon:function(t){if(0===this.controlPoints.length&&(this.controlPoints=L.Util.latLngsToSuperMapPoints(this.goFeature.getLatLngs())),0===t)return this._executeAndRatioIsZero(),!0;var e=this.controlPoints.length,i=SuperMap.Plot.PlottingUtil.distance(this.controlPoints[0],this.controlPoints[this.controlPoints.length-1])*t,o=new SuperMap.Geometry.Point(this.controlPoints[0].x+i,this.controlPoints[0].y),s=2*Math.PI/(e+1),l=Math.PI/2+this.animationGOFeature.dRotate,n=o;SuperMap.Plot.PlottingUtil.rotateAngle(this.controlPoints[0],l,n);var a=[];a.push(this.controlPoints[0].clone()),a.push(n);for(var r=n.clone(),p=1;p1&&(this.startScale=1),this.endScale<0&&(this.endScale=0),this.endScale>1&&(this.endScale=1)},execute:function(){if(!(this.goFeature instanceof ht))return!1;if(!this.canExecute())return!1;this.endScale>1&&(this.endScale=1);var t=(new Date).getTime();if(this.lastDrawTime>0&&t-this.timeSpace=t);i++)o+=s;var l,n=new Object;return l=i1?1:parseFloat(t),this.animationGOFeature.style.display="display",this.animationGOFeature.style.opacity=e,this.animationGOFeature.style.fontOpacity=e,this.animationGOFeature.style.surroundLineColorOpacity=this.goFeature.style.surroundLineColorOpacity*t,this.animationGOFeature.style.fill&&(this.animationGOFeature.style.fillOpacity=this.goFeature.style.fillOpacity*t,this.animationGOFeature.style.fillBackOpacity=this.goFeature.style.fillBackOpacity*t),this.animationGOFeature.redraw()},getJSONData:function(){var t=_t.prototype.getJSONData.call(this);return t.showEffect=this.showEffect,t.finalDisplay=this.finalDisplay,t},fromJSONData:function(t){_t.prototype.fromJSONData.call(this,t),this.showEffect=t.showEffect,this.finalDisplay=t.finalDisplay}});L.supermap.plotting.GOAnimationShow=Ct;var Nt=_t.extend({showPath:!1,tangentDirection:!1,pathWidth:.5,pathColor:"#00FFFF",currentPt:null,pathType:SuperMap.Plot.WayPathType.POLYLINE,wayPoints:null,shapePoints:null,pathFeature:null,pathLength:0,destroy:function(){null!==this.pathFeature&&(L.supermap.plotting.getControl().getGOAnimationManager().map.removeLayer(this.pathFeature),this.pathFeature=null);_t.prototype.destroy.call(this)},getGOAnimationType:function(){return SuperMap.Plot.GOAnimationType.ANIMATION_WAY},setShowPath:function(t){this.showPath=t},resetAnimationFeature:function(t){_t.prototype.resetAnimationFeature.call(this,t);var e=this.goFeature.dRotate,i=this.animationGOFeature.dRotate;this.animationGOFeature._rotate(e-i,this.animationGOFeature.getLatLngs()[0]),t&&(null!==this.pathFeature&&null!==this.shapePoints||(this._makePath(),this.pathColor&&(this.pathFeature.options.color=this.pathColor),this.pathWidth&&(this.pathFeature.options.weight=this.pathWidth)),this.pathFeature.options.opacity=0,1!==this.animationGOFeature.symbolType&&(this.pathFeature.options.opacity=0),this.pathFeature.setStyle())},execute:function(){if(this.goFeature.symbolType!==SuperMap.Plot.SymbolType.DOTSYMBOL)return null!==this.pathFeature&&(this.pathFeature.options.opacity=0),!1;if(!this.canExecute())return!1;this.showPath&&0===this.pathFeature.options.opacity&&(this.pathFeature.options.opacity=1,this.pathFeature.setStyle());var t=this.ratio,e=t*this.pathLength,i=new Object,o=this._findPos(e,this.shapePoints,i);this.currentPt=o.clone();var s=this.animationGOFeature.getLatLngs()[0],l=o.y-s.lat,n=o.x-s.lng;if(this.animationGOFeature.move(l,n),this.tangentDirection){var a=i.angle;1===t&&(a=0);var r=this.animationGOFeature.dRotate;this.animationGOFeature._rotate(a-r,this.animationGOFeature.getLatLngs()[0])}return!0},setWayPoints:function(t){((!t||!SuperMap.Util.isArray(t)||2>t.length)&&(t=[this.goFeature.getLatLngs()[0],this.goFeature.getLatLngs()[0]]),this.wayPoints=[],this.wayPoints=L.Util.cloneLatLngs(t),null!==this.pathFeature)&&(L.supermap.plotting.getControl().getGOAnimationManager().map.removeLayer(this.pathFeature),this.pathFeature.destroy(),this.pathFeature=null)},getWayPoints:function(){return this.wayPoints},getCurrentPt:function(){return this.currentPt},setPathColor:function(t){t&&(this.pathColor=t,this.pathFeature&&null!==this.pathFeature&&(this.pathFeature.options.color=this.pathColor,this.pathFeature.setStyle(this.pathFeature.options)))},getPathColor:function(){return this.pathColor},setPathWidth:function(t){t&&(this.pathWidth=t,this.pathFeature&&null!==this.pathWidth&&(this.pathFeature.options.weight=this.pathWidth,this.pathFeature.setStyle(this.pathFeature.options)))},getPathWidth:function(){return this.pathWidth},setPathType:function(t){void 0!==t&&null!==t&&(this.pathType!==t&&(this.pathType=t,null!==this.pathFeature&&(L.supermap.plotting.getControl().getGOAnimationManager().map.removeLayer(this.pathFeature),this.pathFeature.destroy(),this.pathFeature=null)))},getPathType:function(){return this.pathType},_makePath:function(){((null===this.wayPoints||2>this.wayPoints.length)&&(this.wayPoints=[this.goFeature.getLatLngs()[0],this.goFeature.getLatLngs()[0]]),null===this.pathFeature)&&(this.pathType===SuperMap.Plot.WayPathType.POLYLINE?this.shapePoints=L.Util.latLngsToSuperMapPoints(this.wayPoints):this.shapePoints=SuperMap.Plot.PlottingUtil.generateBeizerPointsNoCtrlPt(L.Util.latLngsToSuperMapPoints(this.wayPoints)),this.pathFeature=L.polyline(L.Util.superMapPointsToLatLngs(this.shapePoints),SuperMap.Plot.PlottingUtil.cloneObject(this.animationGOFeature.style)),L.supermap.plotting.getControl().getGOAnimationManager().map.addLayer(this.pathFeature));this.pathLength=0;for(var t=1;t=t);o++)s+=l;var n=SuperMap.Plot.PlottingUtil.findPoint(e[o-1],e[o],t-s,0);return this.tangentDirection&&(i.angle=SuperMap.Plot.PlottingUtil.radian(n,e[o])/Math.PI*180),n},getJSONData:function(){var t=_t.prototype.getJSONData.call(this);t.showPath=this.showPath,t.tangentDirection=this.tangentDirection,t.pathType=this.pathType,t.pathWidth=this.pathWidth,t.pathColor=this.pathColor,t.wayPoints=[];for(var e=0;e0&&t.screenY>0&&this._map.getContainer().focus()}});L.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=L.DomUtil.create("div",e+"control-container",this._container);function o(o,s){var l=e+o+" "+e+s;t[o+s]=L.DomUtil.create("div",l,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){L.DomUtil.remove(this._controlContainer)}});var Rt=L.Handler.extend({symbolData:null,plotting:null,_isDrawing:!1,libID:0,code:24,serverUrl:"",isFreeCure:!1,_drawingLayer:null,_tempDrawingLayer:null,_control:null,options:{tolerancePixel:6,allowIntersection:!0,repeatMode:!0,icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3},initialize:function(t,e,i){this._map=t,this._drawingLayer=e,this._tempDrawingLayer=new dt("drawControl-temportary"),this._container=t._container,this._overlayPane=t._panes.overlayPane,L.setOptions(this,i)},addHooks:function(){this._map&&(this._isDrawing=!1,this._markers=[],this._latlngs=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._map.addLayer(this._tempDrawingLayer),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this),this._map.getPlotEditControl()&&this._map.getPlotEditControl()._avoidEditing&&this._map.getPlotEditControl().avoidEdit(!1))},removeHooks:function(){this._isDrawing=!1,this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,delete this._latlngs,delete this.isFreeCure,this.plotting&&(this._tempDrawingLayer.removeFeatures(this.plotting),delete this.plotting,this.plotting=null),this._map.removeLayer(this._tempDrawingLayer),this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseup",this._onMouseUp,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){this._latlngs.pop();var t=this._markers.pop(),e=this.plotting.getLatLngs(),i=e.splice(-1,1)[0];this.plotting.setLatLngs(e),this._markerGroup.removeLayer(t),this.plotting.getLatLngs().length<2&&this._tempDrawingLayer.removeFeatures(this.plotting),this._vertexChanged(i,!1)}},addVertex:function(t){if(this._markers.push(this._createMarker(t)),this._latlngs.push(t),this.plotting&&0===this.libID&&1023===this.code&&!0===this.isFreeCure)this.plotting.addLatLng(t);else if(this.plotting&&SuperMap.Plot.AlgoSymbolFactory.isAccessServer(this.plotting.libID,this.plotting.code)&&this._latlngs.length>=this.plotting.minEditPts){var e=new SuperMap.GetSymbolInfoParameters({libID:this.libID,code:this.code});e.inputPoints=L.Util.latLngsToSuperMapPoints(this._latlngs),L.supermap.symbolInfoService(this._drawingLayer.serverUrl).getSymbolInfo(e,function(t){this.plotting.symbolData=t.result,this.plotting.setLatLngs(this._latlngs)},this)}else if(this.plotting&&this.plotting instanceof gt){var i=this._map.layerPointToLatLng(L.point(0,0)),o=this._map.layerPointToLatLng(L.point(this.options.tolerancePixel,0)),s=SuperMap.Plot.PlottingUtil.distance({x:i.lng,y:i.lat},{x:o.lng,y:o.lat});this.plotting._addRouteNodeByPos(t,s)}else this.plotting&&this.plotting.setLatLngs(this._latlngs);this._vertexChanged(t,!0)},_finishShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this),0===this.libID&&this.code===SuperMap.Plot.SymbolType.FREECURVE&&!0===this.isFreeCure&&(this.plotting.latLngs=L.Util.superMapPointsToLatLngs(this.plotting.superMapAlgoSymbol.controlPoints),this.isFreeCure=!1),-1===this.plotting.libID&&(this.plotting.libID=this.libID,this.plotting.code=this.code);var t=this.plotting.clone();this._markerGroup.clearLayers(),this._markers=[],this._latlngs=[],this._tempDrawingLayer.removeFeatures(this.plotting),delete this.plotting,this._drawingLayer.addFeatures(t),this._drawingLayer._renderer instanceof L.SVG&&(t.isFirstAdd=!0),this._control.fire(SuperMap.Plot.Event.featureadded,{feature:t}),this._isDrawing=!1,this.options.repeatMode||this.disable();var e=new SuperMap.Plot.Transaction;e.transType=SuperMap.Plot.TransactionType.CREATE;var i=new SuperMap.Plot.TransactionInfo;i.layerId=t.layer._leaflet_id,i.feature=t,e.transInfos.push(i),L.supermap.plotting.getControl(this._map,this.serverUrl).getTransManager().add(e)},_onZoomEnd:function(){this._markers},_onMouseMove:function(t){var e=this._map.mouseEventToLayerPoint(t.originalEvent),i=this._map.layerPointToLatLng(e);if(this._currentLatLng=i,!this.plotting||!0!==this._isDrawing||this.plotting instanceof gt){if(!1===this._isDrawing)if(this._isDrawing=!0,SuperMap.Plot.AlgoSymbolFactory.isAccessServer(this.libID,this.code))if(this.symbolData=this._drawingLayer._getSymbolDataFromCache(this.libID,this.code),null===this.symbolData){var o,s,l=Math.floor(1e3*Math.random()),n=(new Date).getTime();let t=new SuperMap.GetSymbolInfoParameters({libID:this.libID,code:this.code});t.dynamicToken=l,L.supermap.symbolInfoService(this._drawingLayer.serverUrl).getSymbolInfo(t,function(t){t.result.dynamicToken&&(s=parseInt(t.result.dynamicToken,16),o=s-l),!o||o-n>6e4?this.symbolData=null:this.libID!==t.result.libID||this.code!==t.result.code?this.symbolData=null:(this._drawingLayer._cacheSymbolData(t.result),this.symbolData=t.result,this.plotting=L.supermap.plotting.PlottingObject.createSymbol(this.libID,this.code,[],{symbolData:this.symbolData,serverUrl:this._drawingLayer.serverUrl,map:this._map}),this._control.fire(SuperMap.Plot.Event.beforefeatureadded,{feature:this.plotting}),this._tempDrawingLayer.addFeatures(this.plotting),this.plotting.isEdit=!1)},this)}else this.plotting=L.supermap.plotting.PlottingObject.createSymbol(this.libID,this.code,[],{symbolData:this.symbolData,serverUrl:this._drawingLayer.serverUrl,map:this._map}),this._control.fire(SuperMap.Plot.Event.beforefeatureadded,{feature:this.plotting}),this._tempDrawingLayer.addFeatures(this.plotting),this.plotting.isEdit=!1;else if(this.plotting=L.supermap.plotting.PlottingObject.createSymbol(this.libID,this.code,[],{serverUrl:this._drawingLayer.serverUrl,spatialAnalystUrl:this._drawingLayer.spatialAnalystUrl,map:this._map}),this.plotting.subSymbols&&0!==this.plotting.subSymbols.length){for(var a=[],r=0,p=this.plotting.subSymbols.length;r=this.plotting.minEditPts){let t=new SuperMap.GetSymbolInfoParameters({libID:this.libID,code:this.code});t.inputPoints=L.Util.latLngsToSuperMapPoints(c),L.supermap.symbolInfoService(this._drawingLayer.serverUrl).getSymbolInfo(t,function(t){this.plotting.symbolData=t.result,this.plotting.setLatLngs(c)},this)}else this.plotting.setLatLngs(c)}this._mouseMarker.setLatLng(i),L.DomEvent.preventDefault(t.originalEvent)},_vertexChanged:function(){var t=this._markers.length;t>1&&this._markers[t-1].on("click",this._finishShape,this),t>2&&this._markers[t-2].off("click",this._finishShape,this)},_onMouseDown:function(t){if((!t||2!==t.originalEvent.button)&&!this._clickHandled&&!this._touchHandled&&!this._disableMarkers&&this._drawingLayer&&this._drawingLayer.isEditable&&this._drawingLayer._map){this._onMouseMove(t),this._clickHandled=!0,this._disableNewMarkers();var e=t.originalEvent,i=e.clientX,o=e.clientY;this._startPoint.call(this,i,o)}},_startPoint:function(t,e){0===this.libID&&this.code===SuperMap.Plot.SymbolType.FREECURVE&&(this.isFreeCure=!0),this._mouseDownOrigin=L.point(t,e)},_onMouseUp:function(t){!L.Browser.ie||null!==this._mouseDownOrigin&&void 0!==this._mouseDownOrigin||this._onMouseDown.call(this,t);var e=t.originalEvent,i=e.clientX,o=e.clientY;this._endPoint.call(this,i,o,t),this._clickHandled=null,L.DomEvent.stopPropagation(t)},_endPoint:function(t,e,i){if(this._mouseDownOrigin){var o=L.point(t,e).distanceTo(this._mouseDownOrigin),s=this._calculateFinishDistance(i.latlng);(this.plotting instanceof ut||this.plotting instanceof L.supermap.plotting.Route)&&(this._latlngs.length+1>=this.plotting.maxEditPts||s<10&&L.Browser.touch)?this._finishShape():Math.abs(o)<9*(window.devicePixelRatio||1)&&this.addVertex(i.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(t){var e,i,o=t.originalEvent;!o.touches||!o.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e=o.touches[0].clientX,i=o.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e,i),this._endPoint.call(this,e,i,t),this._touchHandled=null),this._clickHandled=null},_calculateFinishDistance:function(t){var e;if(this._markers.length>0){var i=this._markers[this._markers.length-1],o=this._map.latLngToContainerPoint(i.getLatLng()),s=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),l=this._map.latLngToContainerPoint(s.getLatLng());e=o.distanceTo(l)}else e=1/0;return e},_createMarker:function(t){var e=new L.Marker(t,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e),e},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout(function(){this._disableMarkers=!1}.bind(this),50)}}),Bt=Ut.extend({drawingLayer:null,initialize:function(t,e){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");this.drawingLayer=t,L.Control.prototype.initialize.call(this,e)},onAdd:function(t){var e=L.DomUtil.create("div","supermap-iclient");return this._map=t,this.handler=new Rt(this._map,this.drawingLayer),this.handler._control=this,e},onRemove:function(){this._map=null,this.handler=null},setDrawingLayer:function(t){this.drawingLayer=t,this.handler._drawingLayer=t,this.handler._tempDrawingLayer.serverUrl=t.serverUrl}}),Gt=function(t,e){return new Bt(t,e)};L.supermap.plotting.drawControl=Gt;var Ft=Ut.extend({_dragStartScale:null,_dragStartRotate:null,_dragStartBounds:null,_dragStartLatLngs:null,_dragStartScaleValues:null,_dragStartPositionOffset:null,_dragStartScalePoints:null,_editMarkers:null,_disEditBox:null,_editFeatures:null,_mouseTolerance:10,_editMode:SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE,_avoidEditing:!1,selectedFeatures:[],options:{highlightFlag:!0,highlightStyle:{color:"#ffffff",opacity:1,weight:1},draggable:!0,editIcon:L.divIcon({className:"leaflet-supermap-plot-control-icon-path",iconSize:[10,10]}),scaleIcon:L.divIcon({className:"leaflet-supermap-plot-scale-icon-path",iconSize:[10,10]}),rotateIcon:L.divIcon({className:"leaflet-supermap-plot-rotate-icon-path",iconSize:[15,15]}),lockedIcon:L.divIcon({className:"leaflet-supermap-plot-locked-icon-path",iconSize:[10,10]}),avoidIcon:L.divIcon({className:"leaflet-supermap-plot-avoid-icon-path",iconSize:[8,8]})},initialize:function(t,e){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,e),L.setOptions(this,e),this._editMarkers={},this._disEditBox={},this._dragStartScale={},this._dragStartRotate={},this._dragStartBounds={},this._dragStartLatLngs={},this._dragStartPositionOffset={},this._dragStartScaleValues={},this._dragStartScalePoints={},this._editFeatures={}},onAdd:function(t){this.controlDiv=L.DomUtil.create("div","supermap-iclient"),this._map=t,this._map.on("click",this._onMapClick,this),this._map._plotEditControl=this;for(var e=0;e0},canCut:function(){return this.getSelectedFeatures().length>0},canPaste:function(){return!!(this.pasteGeoAry&&this.pasteGeoAry.length>0)},copy:function(){this.pasteGeoAry=[],this.pasteGeoSel=[];for(var t=0,e=this._map.getPlottingLayers().length;t0){var i=e.layer._getFeatureFromEvent(t);i.symbolType===SuperMap.Plot.SymbolType.SATELLITETIMEWINDOWS&&(e=i)}if(this.transaction||(this.transaction=new SuperMap.Plot.Transaction,this.transaction.transType=SuperMap.Plot.TransactionType.EDIT,this.isAddTransInfo=!0),e instanceof lt)if(e instanceof nt&&e.moveend)e.moveend=!1;else if(null!==e.ownerGroup&&e.ownerGroup.moveend)e.ownerGroup.moveend=!1;else{var o,s;if(this._editMode!==SuperMap.Plot.EditMode.ADDCONTROLPOINT)e instanceof nt&&!e.isSelected?(!1===t.originalEvent.ctrlKey&&this.unselectFeatures(),this.selectFeatures(e)):e instanceof gt||e.isSelected||null!==e.ownerGroup&&!0!==e.ownerGroup.isSelected||(!1===t.originalEvent.ctrlKey&&this.unselectFeatures(),this.selectFeatures(e));else if(e instanceof gt||e.isSelected){if(!1===e.isLocked&&e.isSelected)if(e instanceof gt){var l=this._getAddPointTolerance();if(null===(a=e._selectNodeLayer(t.latlng,l))){let i=this._getAddPointTolerance(),o=e._addRouteNodeByPosWithoutLast(t.latlng,i);null!==o&&(this.unselectFeatures(),this.selectFeatures(o))}}else if(e instanceof Pt&&e.route.isSelected){let t=e._isFirstNode(),i=e._isLastNode();if(!0===t||!0===i){let o=e.route._addRouteNodeByNode(e.routeNode,t,i);if(null!==o){this.unselectFeatures(),this.selectFeatures(o);var n=new SuperMap.Plot.TransactionInfo;n.layerId=o.layer._leaflet_id,n.uuid=o.uuid,n.functionName="setLatLngs",n.undoParams=[L.Util.cloneLatLngs(o.getLatLngs())],n.redoParams=[L.Util.cloneLatLngs(o.getLatLngs())],this.transaction.transInfos.push(n),this.transaction&&(L.supermap.plotting.getControl().getTransManager().add(this.transaction),this.transaction=new SuperMap.Plot.Transaction,this.isAddTransInfo=!0)}}else this.unselectFeatures(),this.selectFeatures(e)}else this._addPoint(e,t.latlng)}else if(!1===t.originalEvent.ctrlKey&&this.unselectFeatures(),this.selectFeatures(e),e instanceof Pt&&((o=e._isFirstNode())||(s=e._isLastNode()))){var a=e.route._addRouteNodeByNode(e.routeNode,o,s);null!==a&&(this.unselectFeatures(),this.selectFeatures(a))}L.DomEvent.stopPropagation(t)}},_addPoint:function(t,e){if(null!==t&&void 0!==t){var i=t.scaleValues.slice(),o=L.Util.cloneLatLngs(t.getLatLngs()),s=L.Util.latLngsToSuperMapPoints(t.getLatLngs());if(t.symbolType===SuperMap.Plot.SymbolType.ANNOFRAMESYMBOLM){var l=L.supermap.plotting.editMarker(e,{icon:this.options.scaleIcon,nHandle:-2,tag:t.scalePoints.length});l.owner=t,this._addToMapAndBindMarker(l),this._editMarkers[t.uuid].push(l),t.scalePoints.push(e),t._modifyPoint(t.scalePoints.length-1,e);let o=new SuperMap.Plot.TransactionInfo;o.layerId=t.layer._leaflet_id,o.uuid=t.uuid,o.functionName="setScaleValues",o.undoParams=[i],o.redoParams=[t.scaleValues],this.transaction.transInfos.push(o),this.transaction&&(L.supermap.plotting.getControl().getTransManager().add(this.transaction),this.transaction=new SuperMap.Plot.Transaction,this.isAddTransInfo=!0)}else{if(t.getLatLngs().length>=t.maxEditPts)return;var n=t._getSymbolWayType();if(void 0!==SuperMap.Plot.AlgoSymbolFactory&&SuperMap.Plot.AlgoSymbolFactory.canPolylineConnect(t.libID,t.code)&&!0===t.polylineConnectLocationPoint&&(n=SuperMap.Plot.AddPoint_WayType.POLYLINE),SuperMap.Plot.AddPoint_WayType.UNKNOWN===n)return;var a=new SuperMap.Geometry.Point(e.lng,e.lat),r=-1;SuperMap.Plot.AddPoint_WayType.CURVE===n&&(r=this._addPointByCurve(t,a));var p=new SuperMap.Plot.Transaction;if(L.supermap.plotting.getControl().getTransManager().add(p),SuperMap.Plot.AddPoint_WayType.POLYLINE===n&&(r=this._addPointByPolyLine(t,a)),s=L.Util.latLngsToSuperMapPoints(t.getLatLngs()),r>0&&ro.length)return-1;for(var s=[],l=0,n=1,a=i.length;nh&&(u=h,p=t+1))}var y=i.slice();y.push(y[0]);var c=SuperMap.Plot.PlottingUtil.generateBeizerPointsNoCtrlPt(y),S=[];for(n=1,a=y.length;nf&&(d=f,g=t+1))}return g>p&&(p=-1),p},_addPointByPolyLine:function(t,e){var i=-1,o=L.Util.latLngsToSuperMapPoints(t.getLatLngs());return(i=this._computePointToLineMinDis(e,o).index)>=0&&i++,i},_computePointToLineMinDis:function(t,e){var i=this._getAddPointTolerance(),o=SuperMap.Plot.PlottingUtil.computePointToLineMinDis(t,e);return o.minDis>i&&(o.index=-1),o},_getAddPointTolerance:function(){var t=this._mouseTolerance,e=this._map.layerPointToLatLng(L.point(0,0)),i=this._map.layerPointToLatLng(L.point(t,0));return SuperMap.Plot.PlottingUtil.distance(new SuperMap.Geometry.Point(e.lng,e.lat),new SuperMap.Geometry.Point(i.lng,i.lat))},_collectEditMarkers:function(t){void 0!==this._editMarkers[t.uuid]&&this._removeMarkers(t);var e,i=[];if(t.layer instanceof bt&&(t.layer.getLocked()||!t.layer.getEditable())){var o=t.getBounds();if(null!==o&&o.isValid()){var s=L.latLng(o.getNorth(),o.getEast()),l=L.latLng(o.getNorth(),o.getWest()),n=L.latLng(o.getSouth(),o.getEast()),a=L.latLng(o.getSouth(),o.getWest()),r=new L.Polygon([s,l,a,n],{smoothFactor:.5});L.setOptions(r,{weight:1,opacity:.5,color:"#0000ff",fillOpacity:.3,fillColor:"#0000ff"}),this._map.addLayer(r),e=r}}else if(t.getLocked()){var p=t._getHandlePointsByBounds();for(var u in p){let e=new L.LatLng(p[u].lat,p[u].lng),o=L.supermap.plotting.editMarker(e,{icon:this.options.lockedIcon,nHandle:-3});this._addToMapAndBindMarker(o),o.owner=t,i.push(o)}}else if(t instanceof nt||t instanceof Pt)if(t instanceof mt&&this._editMode!==SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE)for(var h=0;h9&&(s=-1);let l=new L.LatLng(e.handlePoints[o].lat,e.handlePoints[o].lng),n=L.supermap.plotting.editMarker(l,{icon:this.options.editIcon,nHandle:s,tag:o});this._addToMapAndBindMarker(n),n.owner=t,i.push(n)}for(let o=0,s=e.rotatePoints.length;o1)for(let e in t.scalePoints){let o=new L.LatLng(t.scalePoints[e].lat,t.scalePoints[e].lng),s=t.scalePoints[e].tag?t.scalePoints[e].tag:e,l=L.supermap.plotting.editMarker(o,{icon:this.options.scaleIcon,nHandle:t.enableEdit?-2:-3,tag:s});this._addToMapAndBindMarker(l),i.push(l),l.owner=t}this._editMarkers[t.uuid]=i,this._disEditBox[t.uuid]=e},_resetEditMarkersValue:function(t){if(this._editMarkers.hasOwnProperty(t.uuid)){var e=this._editMarkers[t.uuid];if(!L.Util.isArray(e)||0!==e.length){var i=this._disEditBox[t.uuid];if(0!==this._map.getPlotEditControl().length||!t.layer.getLocked()&&t.layer.getEditable())if(t instanceof nt||t instanceof Pt)if(t instanceof mt&&this._editMode!==SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE)for(var o in t.scalePoints)e[o]._latlng=t.scalePoints[o],e[o].update();else{let i=t._getHandleAndRotatePoints();for(let t in i.handlePoints)e[t]._latlng=i.handlePoints[t],e[t].update();if(this._editMode===SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE){let t=i.handlePoints.length;for(let o in i.rotatePoints)e[t+parseInt(o)]._latlng=i.rotatePoints[o],e[t+parseInt(o)].update()}}else if(this._editMode===SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE){let i=t._getHandleAndRotatePoints();for(let t in i.handlePoints)e[t]._latlng=i.handlePoints[t],e[t].update();let o=i.handlePoints.length;for(let t in i.rotatePoints)e[o+parseInt(t)]._latlng=i.rotatePoints[t],e[o+parseInt(t)].update()}else if(void 0!==t.scalePoints&&null!==t.scalePoints||(t.scalePoints=[]),t.symbolType===SuperMap.Plot.SymbolType.REGULARPOLYGON){let i=[t.getLatLngs()[0],t.components[0].getLatLngs()[0][0]];for(let t in i)e[t]._latlng=i[t],e[t].update()}else if(t.symbolType===SuperMap.Plot.SymbolType.PARALLELLINE){var s=L.Util.superMapPointsToLatLngs(t.superMapAlgoSymbol.controlPoints[0]);t.getLatLngs()[0]=L.latLng(s[0].lat,s[0].lng);for(let i in t.getLatLngs())e[i]._latlng=t.getLatLngs()[i],e[i].update()}else if(t.symbolType===SuperMap.Plot.SymbolType.SATELLITE||t.timeWindows&&t.timeWindows.length>1)for(let i in t.scalePoints){let o=parseInt(i);e[o]._latlng=t.scalePoints[i],e[o].update()}else if(t.getLatLngs().length+t.scalePoints.length===e.length){for(let i in t.getLatLngs())e[i]._latlng=t.getLatLngs()[i],e[i].update();let i=t.getLatLngs().length;for(let o in t.scalePoints){var l=i+parseInt(o);e[l]._latlng=t.scalePoints[o],e[l].update()}}else this._collectEditMarkers(t);else{var n=t.getBounds();if(null!==n&&n.isValid()){var a=L.latLng(n.getNorth(),n.getEast()),r=L.latLng(n.getNorth(),n.getWest()),p=L.latLng(n.getSouth(),n.getEast()),u=L.latLng(n.getSouth(),n.getWest());i.setLatLngs([a,r,u,p])}}}}},_removeMarkers:function(t){var e=this._editMarkers[t.uuid];for(let t in e)this._unbindMarkerEvents(e[t]),this._map.removeLayer(e[t]);delete this._editMarkers[t.uuid];var i=this._disEditBox[t.uuid];i&&this._map.removeLayer(i),delete this._disEditBox[t.uuid]},_unbindMarkerEvents:function(t){t.off("mousemove",this._moveMove,this),t.off("mouseout",this._moveOut,this),-3!==t.options.nHandle&&(t.off("click",this._removePoint,this),t.off("dragstart",this._dragStart,this),t.off("drag",this.redraw,this),t.off("dragend",this._dragEnd,this),t.dragging.disable())},_addToMapAndBindMarker:function(t){t.addTo(this._map),t.on("mousemove",this._moveMove,this),t.on("mouseout",this._moveOut,this),-3!==t.options.nHandle&&(t.on("click",this._removePoint,this),t.on("dragstart",this._dragStart,this),t.on("drag",this._dragPoint,this),t.on("dragend",this._dragEnd,this),t.dragging.enable()),-3===t.options.nHandle&&(t.on("dragstart",this._dragStart,this),t.on("dragend",this._dragEnd,this),t.dragging.enable())},_moveMove:function(t){switch(t.target.options.nHandle){case 1:case 8:t.target._icon.style.cursor="se-resize";break;case 3:case 6:t.target._icon.style.cursor="ne-resize";break;case 4:case 5:t.target._icon.style.cursor="e-resize";break;case 2:case 7:t.target._icon.style.cursor="n-resize";break;case-1:case-2:t.target._icon.style.cursor="pointer";break;case 0:t.target._icon.style.cursor="default"}},_moveOut:function(t){t.target._icon.style.cursor=""},_removePoint:function(t){if(this._editMode===SuperMap.Plot.EditMode.ADDCONTROLPOINT&&t.target.owner.isSelected){let i=L.Util.cloneLatLngs(t.target.owner.getLatLngs()),o=this._editMarkers[t.target.owner.uuid],s=o.indexOf(t.target);this._map.removeLayer(o[s]),o.splice(s,1),t.target.owner.latLngs.splice(s,1),t.target.owner.redraw();let l=new SuperMap.Plot.Transaction;L.supermap.plotting.getControl().getTransManager().add(l);var e=new SuperMap.Plot.TransactionInfo;e.layerId=t.target.owner.layer._leaflet_id,e.uuid=t.target.owner.layer.uuid,e.functionName="setLatLngs",e.undoParams=[i],e.redoParams=[t.target.owner.getLatLngs()],l.transInfos.push(e)}else if(this._editMode===SuperMap.Plot.EditMode.REMOVECONTROLPOINT&&t.target.owner.isSelected){let e=this._editMarkers[t.target.owner.uuid],i=e.indexOf(t.target),o=L.Util.cloneLatLngs(t.target.owner.getLatLngs());if(t.target.owner.getLatLngs().length<=t.target.owner.minEditPts)return this._editMode=SuperMap.Plot.EditMode.EDITCIRCUMRECTANGLE,void this._collectEditMarkers(t.target.owner);this._map.removeLayer(e[i]),e.splice(i,1),t.target.owner.latLngs.splice(i,1),t.target.owner.redraw();let s=new SuperMap.Plot.Transaction;L.supermap.plotting.getControl().getTransManager().add(s);let l=new SuperMap.Plot.TransactionInfo;l.layerId=t.target.owner.layer._leaflet_id,l.uuid=t.target.owner.uuid,l.functionName="setLatLngs",l.undoParams=[o],l.redoParams=[t.target.owner.getLatLngs()],s.transInfos.push(l)}},_dragStart:function(t){for(var e in this.transaction||(this.transaction=new SuperMap.Plot.Transaction,this.transaction.transType=SuperMap.Plot.TransactionType.EDIT,this.isAddTransInfo=!0),this.selectedFeatures){var i=this.selectedFeatures[e];if(i._isDot()&&(this._dragStartScale[i.uuid]=i.getScale()),i.scaleValues&&i.scaleValues.length&&0!==i.scaleValues.length){this._dragStartScaleValues[i.uuid]=[];for(var o=0;o0?this._dragResize(t,t.target.options.nHandle):this._dragLatLngs(t),this.fire(SuperMap.Plot.Event.featuresmodified,{features:this.selectedFeatures})}},_dragRotate:function(t){var e=this;var i=t.target.owner,o=null;o=i.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL||i.symbolType===SuperMap.Plot.SymbolType.CONCENTRICCIRCLE?i.getLatLngs()[0]:i.anchorPoint;var s=this._map.latLngToLayerPoint(o);i.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL&&!0===i.positionOffset&&(s.x+=i.positionOffsetX*i.dScale,s.y+=i.positionOffsetY*i.dScale);var l=this._map.latLngToLayerPoint(t.latlng),n=this._map.latLngToLayerPoint(t.oldLatLng),a=l.x-s.x-(n.x-s.x),r=l.y-s.y-(n.y-s.y);if(0!==a&&0!==r){var p=180*(Math.atan2(n.y-s.y,n.x-s.x)-Math.atan2(l.y-s.y,l.x-s.x))/Math.PI,u=p;if(void 0!==this._lastPixel)u=180*(Math.atan2(this._lastPixel.y-s.y,this._lastPixel.x-s.x)-Math.atan2(l.y-s.y,l.x-s.x))/Math.PI;!function(t,i){for(var o=0;o0&&i.selectedFeatures[a].setScale(p)}if(i.isAddTransInfo){let t=new SuperMap.Plot.TransactionInfo;t.layerId=i.selectedFeatures[a].layer._leaflet_id,t.uuid=i.selectedFeatures[a].uuid,t.functionName="setScale",i.transaction.transInfos.push(t)}}else{if(9===i.selectedFeatures[a]._getHandleCount()&&e&&e>0){var u=i._dragStartBounds[i.selectedFeatures[a].uuid],h=i._dragStartLatLngs[i.selectedFeatures[a].uuid],y=i.selectedFeatures[a]._getLatLng(e,u,l);i.selectedFeatures[a]._resizeLatLngs(y,e,u,h)}if(SuperMap.Plot.AlgoSymbolFactory.isAccessServer(i.selectedFeatures[a].libID,i.selectedFeatures[a].code)){var c=new SuperMap.GetSymbolInfoParameters;c.libID=i.selectedFeatures[a].libID,c.code=i.selectedFeatures[a].code,c.inputPoints=L.Util.latLngsToSuperMapPoints(i.selectedFeatures[a].getLatLngs()),c.scaleValues=i.selectedFeatures[a].scaleValues,c.subSymbols=i.selectedFeatures[a].subSymbols,n.push(i.selectedFeatures[a]),L.supermap.symbolInfoService(s.serverUrl).getSymbolInfo(c,function(t){for(var e=0;e3||Math.abs(n.y-this._lastDragPixel.y)>3)&&l-this.lastDownTime>100))return;var a=new SuperMap.GetSymbolInfoParameters;a.libID=e.libID,a.code=e.code,s?(a.inputPoints=L.Util.latLngsToSuperMapPoints(e.getLatLngs()),a.scalePoints=L.Util.latLngsToSuperMapPoints(e.scalePoints),a.scaleValues=e.scaleValues,a.newScalePoint=new SuperMap.Geometry.Point(t.latlng.lng,t.latlng.lat),a.newScalePointIndex=parseInt(t.target.options.tag)):(e.getLatLngs()[o]=t.target.getLatLng(),a.inputPoints=L.Util.latLngsToSuperMapPoints(e.getLatLngs()),a.scaleValues=e.scaleValues),a.subSymbols=e.subSymbols,L.supermap.symbolInfoService(e.serverUrl).getSymbolInfo(a,function(t){e.symbolData.innerCells=t.result.innerCells,e.symbolData.scalePoints=t.result.scalePoints,e.symbolData.scaleValues=t.result.scaleValues,e.redraw(),e._updateSymbolTexts(),this._resetEditMarkersValue(e)},this),this._lastDragPixel=n,this.lastDownTime=(new Date).getTime()}else if(-1===t.target.options.nHandle){if(e.symbolType===SuperMap.Plot.SymbolType.REGULARPOLYGON)1===o?e.getLatLngs()[e.getLatLngs().length-1]=t.latlng:e.getLatLngs()[0]=t.latlng;else if(e.symbolType===SuperMap.Plot.SymbolType.ELLIPSESYMBOL)e.getLatLngs()[o]=t.latlng;else if(e.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL){if(!0===e.positionOffset?e.setLatLngs(t.latlng):e.setLatLngs(e.latLngs[0]),this.isAddTransInfo){let t=new SuperMap.Plot.TransactionInfo;t.layerId=e.layer._leaflet_id,t.uuid=e.uuid,t.functionName="setLatLngs",this.transaction.transInfos.push(t)}}else e.getLatLngs()[o]=t.latlng;if(e.symbolType===SuperMap.Plot.SymbolType.LINERELATION||e.symbolType===SuperMap.Plot.SymbolType.SYMBOLTEXT||e.symbolType===SuperMap.Plot.SymbolType.SYMBOLTEXT1||e.symbolType===SuperMap.Plot.SymbolType.ELLIPSESYMBOL)e._modifyPoint(parseInt(t.target.options.tag),t.latlng);else if(e.redraw(),e.symbolType===SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL&&e.ownerGroup&&(e.ownerGroup.symbolType===SuperMap.Plot.SymbolType.NAVYDEPLOYMENT||e.ownerGroup.symbolType===SuperMap.Plot.SymbolType.AIRDEPLOYMENT))for(let t in e.ownerGroup.subObjects)e.ownerGroup.subObjects[t].redraw();e._updateSymbolTexts(),this._resetEditMarkersValue(e)}else if(-2===t.target.options.nHandle){var r=t.target.getLatLng();if(r.isScalePoint=!0,e._modifyPoint(parseInt(t.target.options.tag),r),e.symbolType===SuperMap.Plot.SymbolType.FLAGGROUP)for(var p=0,u=e.components.length;pn&&!0===this.pasteGeoSel[n])if(a instanceof gt){var u=p._getNodeFeature(p._getNodeByUuid(a.routeNode.id));this.selectedFeatures(u)}else this.selectFeatures(p);if(l[n]&&l[n].geoSymbolTexts)for(let t=0;to[e+1].x){let t=o[e+1];o[e+1]=o[e],o[e]=t;let i=l[e+1];l[e+1]=l[e],l[e]=i}for(var n=Math.abs(o[o.length-1].x-o[0].x)/(o.length-1),a=1;ao[u+1].y){var h=o[u+1];o[u+1]=o[u],o[u]=h;var y=l[u+1];l[u+1]=l[u],l[u]=y}var c=Math.abs(o[o.length-1].y-o[0].y)/(o.length-1);for(let t=1;tthis.maxScale?this.dScale=this.maxScale:this.dScalethis.maxScale?this.dScale=this.maxScale:this.actualScalethis.symbolSize.h?this.symbolSize.w:this.symbolSize.h;this.style.weight=Math.round(i/10),this.style.weight>=this.weight&&(this.style.weight=this.weight),this.style.weight<=.5&&(this.style.weight=.5)}else!0===this.scaleStrokeWidth&&(this.scaleStrokeWidth=!1),this.style.weight=this.strokeWidth;if(this.prevStrokeWidth=this.style.weight,this.style.fontSize=this.style.fontSize*this._map.getZoomScale(this._map.getZoom(),this.fromZoom),this.prevFontSize=this.style.fontSize,0!==this.textContent.length&&8===this.annotationPosition){var o;!0===this.limitWidthHeight?o=this.middleMarkBounds.scale(this.dScale*this.initialScale.x,this.anchorPoint):this._widthHeightLimitScale();var s=96*o.getWidth()/25.4/10,l=96*o.getHeight()/25.4/10;this.components[this._annotationId].options.graphicWidth=s,this.components[this._annotationId].options.graphicHeight=l}for(var n in this.components)n===this._annotationId&&this.components[n]instanceof K?this.components[n].options.fontSize=this.style.fontSize:n!==this._annotationId&&this.components[n]instanceof K?this.components[n].options.fontSize=t*(this.components[n].options.fontSize/this.prevScale/this.initialScale.x):n!==this._annotationId&&!0!==this.components[n].isLeadLine&&(this.components[n].options.weight=this.style.weight);for(var a=0;athis.symbolSizeInLib.w&&(e=this.symbolSizeInLib.h),0===e||0===t.dotSymbolSize)this.symbolSize.w=this.symbolSizeInLib.w,this.symbolSize.h=this.symbolSizeInLib.h;else if(0!==this.symbolSize.w||0===this.symbolData.symbolSize.x||0!==this.symbolSize.h||0===this.symbolData.symbolSize.y||this.minEditPts)if(0!==this.symbolSize.w||0!==this.symbolSize.h);else{var i=t.dotSymbolSize/e;this.symbolSize.w=i*this.symbolSizeInLib.w,this.symbolSize.h=i*this.symbolSizeInLib.h}else{this.symbolSize.w=96*this.symbolData.symbolSize.x/25.4/10,this.symbolSize.h=96*this.symbolData.symbolSize.y/25.4/10;var o=this.symbolSize.w/this.dScale/this.symbolSizeInLib.w,s=this.symbolSize.h/this.dScale/this.symbolSizeInLib.h;this.initialScale!==o?this.initialScale=o:this.initialScale!==s&&(this.initialScale=s),this.symbolSize.w=this.initialScale*this.dScale*this.symbolSizeInLib.w,this.symbolSize.h=this.initialScale*this.dScale*this.symbolSizeInLib.h}}var l=this.symbolSizeInLib.w,n=this.symbolSize.w;this.symbolSizeInLib.w45&&s<135||s>225&&s<315){let i=L.point(n.x-this.style.weight/2,n.y),o=L.point(n.x+this.style.weight/2,n.y);t=this._map.layerPointToLatLng(i),e=this._map.layerPointToLatLng(o)}else{let i=L.point(n.x,n.y-this.style.weight/2),o=L.point(n.x,n.y+this.style.weight/2);t=this._map.layerPointToLatLng(i),e=this._map.layerPointToLatLng(o)}let r=[this.getLatLngs()[0],t,e];this._createAndDrawLayer(32,r,{surroundLineFlag:!1,lineWidthLimit:!0,weight:0,fillLimit:!0,fill:!0}).isLeadLine=!0}},_handleAnnotation:function(){-1!==this._annotationId&&(this.components[this._annotationId].removeEventParent(this),this.components[this._annotationId].onRemove(),delete this.components[this._annotationId],this.components.splice(this._annotationId,1),this._annotationId=-1),this.textContent=SuperMap.Plot.PlottingUtil.trim(this.textContent);var t=this.getBounds();if(this.textContent&&null!==this.textContent&&0!==this.textContent.length&&null!==t&&t.isValid()){var e=SuperMap.Plot.PlottingUtil.cloneObject(this.style),i=this.space*this.dScale,o=null;if(0===this.annotationPosition){e.labelAlign="rb";let s=L.latLng(t.getNorth(),t.getWest()),l=this._map.latLngToLayerPoint(s);l.x-=i,o=this._map.layerPointToLatLng(l)}else if(1===this.annotationPosition){e.labelAlign="rt";let s=L.latLng(t.getSouth(),t.getWest()),l=this._map.latLngToLayerPoint(s);l.x-=i,o=this._map.layerPointToLatLng(l)}else if(2===this.annotationPosition){e.labelAlign="lb";let s=L.latLng(t.getNorth(),t.getEast()),l=this._map.latLngToLayerPoint(s);l.x+=i,o=this._map.layerPointToLatLng(l)}else if(3===this.annotationPosition){e.labelAlign="lt";let s=L.latLng(t.getSouth(),t.getEast()),l=this._map.latLngToLayerPoint(s);l.x+=i,o=this._map.layerPointToLatLng(l)}else if(4===this.annotationPosition){e.labelAlign="cb";let s=L.latLng(t.getNorth(),(t.getWest()+t.getEast())/2),l=this._map.latLngToLayerPoint(s);l.y-=i,o=this._map.layerPointToLatLng(l)}else if(5===this.annotationPosition){e.labelAlign="ct";let s=L.latLng(t.getSouth(),(t.getWest()+t.getEast())/2),l=this._map.latLngToLayerPoint(s);l.y+=i,o=this._map.layerPointToLatLng(l)}else if(6===this.annotationPosition){e.labelAlign="rm";let s=L.latLng((t.getSouth()+t.getNorth())/2,t.getWest()),l=this._map.latLngToLayerPoint(s);l.x-=i,o=this._map.layerPointToLatLng(l)}else if(7===this.annotationPosition){e.labelAlign="lm";let s=L.latLng((t.getSouth()+t.getNorth())/2,t.getEast()),l=this._map.latLngToLayerPoint(s);l.x+=i,o=this._map.layerPointToLatLng(l)}else if(8===this.annotationPosition&&this.symbolData.middleMarkExist){var s;s=!0===this.limitWidthHeight?this.middleMarkBounds.scale(this.dScale*this.initialScale.x,this.anchorPoint):this._widthHeightLimitScale();var l=new SuperMap.Geometry.Point((s.left+s.right)/2,(s.top+s.bottom)/2);if(this.negativeImage){var n=SuperMap.Plot.PlottingUtil.projectPoint(l,new SuperMap.Geometry.Point(this.anchorPoint.x,100),new SuperMap.Geometry.Point(this.anchorPoint.x,this.anchorPoint.y));SuperMap.Plot.PlottingUtil.rotateAngle(n,Math.PI,l)}l.x-=this.anchorPoint.x,l.y-=this.anchorPoint.y;var a=this.dRotate*(Math.PI/180);SuperMap.Plot.PlottingUtil.rotateAngle(new SuperMap.Geometry.Point(0,0),a,l);var r=this._map.latLngToLayerPoint(this.getLatLngs()[0]);!0===this.positionOffset&&(r.x+=this.positionOffsetX*this.dScale,r.y+=this.positionOffsetY*this.dScale);var p=96*s.getWidth()/25.4/10,u=96*s.getHeight()/25.4/10;e.graphicWidth=p,e.graphicHeight=u,o=this._transitionPoint(l,r)}if(8===this.annotationPosition&&this.symbolData.middleMarkExist){e.rotation=-this.dRotate,e.labelAlign="cm",e.graphicOpacity=1,e.fontColor=this.style.fontColor,e.fontFamily=this.style.fontFamily,e.fontWeight=this.style.fontWeight,e.fontStyle=this.style.fontStyle,e.externalGraphic=this._getTextGraphic(this.textContent,e);var h={externalGraphic:e.externalGraphic,graphicWidth:e.graphicWidth,graphicHeight:e.graphicHeight,rotation:-this.dRotate};let t=L.supermap.plotting.pointImage([o],h);this._annotationId=this.components.length,this._addComponents(t)}else if(8!==this.annotationPosition){if(!1===this.limitWidthHeight)var y=this.initialScale.x1&&(e=1),e<0&&(e=0),this.radiusText[e]!==t&&(this.radiusText[e]=t,this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues))},getRadiusText:function(t){return t>1&&(t=1),t<0&&(t=0),this.radiusText[t]},setRadiusTextPos:function(t){this.radiusPosAngle!==t&&(this.radiusPosAngle=t,0!==this.radiusText.length&&(this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)))},getRadiusTextPos:function(){return this.radiusPosAngle},setRadiusLineType:function(t){this.radiusLineType!==t&&(this.radiusLineType=t,0!==this.radiusText.length&&(this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)))},getRadiusLineType:function(){return this.radiusLineType},initialize:function(t,e,i,o){this.scalePoints=[],this.scaleValues=[],ut.prototype.initialize.call(this,t,e,i,o),this.libID=0,this.code=SuperMap.Plot.SymbolType.ARCREGION,this.symbolType=SuperMap.Plot.SymbolType.ARCREGION,this.symbolName="扇形区域",this.minEditPts=2,this.maxEditPts=3,null===this.circlePts&&(this.circlePts=[]),null===this.textPosition&&(this.textPosition=(this.startAngle+this.endAngle)/2),null===this.radiusText&&(this.radiusText=[]),null===this.radiusPosAngle&&(this.radiusPosAngle=(this.startAngle+this.endAngle)/2),null===this.radiusLineType&&(this.radiusLineType=SuperMap.Plot.RadiusLineType.NONE),void 0!==o.constantSize&&null!==o.constantSize||!1!==this.isEdit||(this.constantSize=!0),this.subSymbolDefaultPixelSize=15,0===this.scaleValues.length&&this.scaleValues.push(.1)},destroy:function(){this.centerPoint=null,this.radius=null,this.startAngle=null,this.endAngle=null,this.textPosition=null,this.radiusText=null,this.radiusPosAngle=null,this.radiusLineType=null,ht.prototype.destroy.call(this)},_calculateParts:function(){if(this.scalePoints=[],this.isEdit?1===this.latLngs.length&&this.centerPoint!==this.latLngs[0]&&(this.centerPoint=this.latLngs[0]):(2===this.latLngs.length&&(this.centerPoint=this.latLngs[0],this.radius=SuperMap.Plot.PlottingUtil.distVincenty(this.latLngs[0],this.latLngs[1])),3===this.latLngs.length&&(this.startAngle=180*SuperMap.Plot.PlottingUtil.radian(new SuperMap.Geometry.Point(this.latLngs[0].lng,this.latLngs[0].lat),new SuperMap.Geometry.Point(this.latLngs[1].lng,this.latLngs[1].lat))/Math.PI,this.endAngle=180*SuperMap.Plot.PlottingUtil.radian(new SuperMap.Geometry.Point(this.latLngs[0].lng,this.latLngs[0].lat),new SuperMap.Geometry.Point(this.latLngs[2].lng,this.latLngs[2].lat))/Math.PI)),this.centerPoint&&null!==this.centerPoint&&this.radius&&null!==this.radius){this.startAngle%=360,this.endAngle%=360,this.startAngle>this.endAngle&&(this.endAngle+=360);var t=SuperMap.Plot.PlottingUtil.equalFuzzy(this.startAngle,this.endAngle);t&&(this.startAngle=0,this.endAngle=360);var e=this.getArcPts(this.startAngle,this.endAngle);if(!t){var i=(e=this.getArcPts(this.startAngle,this.endAngle))[0].clone();i.isScalePoint=!0,i.tag=0;var o=e[e.length-1].clone();o.isScalePoint=!0,o.tag=1,this.scalePoints.push(i),this.scalePoints.push(o),e.push(this.centerPoint.clone()),this.latLngs.length>2&&this.latLngs.splice(1,this.latLngs.length-1)}this._createAndDrawLayer(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,e,{surroundLineFlag:!1}),0===this.latLngs.length&&this.latLngs.push(this.centerPoint.clone()),1===this.latLngs.length&&t&&this.latLngs.push(e[Math.ceil(e.length/2)].clone()),this._textGeometry(),this._radiusGeometry()}},_textGeometry:function(){if(0!==this.textContent.length){var t=90,e=!1;this.textPosition%=360,this.endAngle>this.startAngle&&(this.textPositionthis.startAngle?(this.endAngle-this.textPositionthis.startAngle?(this.textPosition+=360,this.endAngle-this.textPositionthis.endAngle&&(this.textPosition>this.startAngle||this.textPosition=0;u--)p.push(r[u]);this._addComponents(L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.PATHTEXT,p,{textContent:this.textContent,showPathLine:!1,isCurve:!1,relLineText:a},this.style)),i=n[Math.ceil(n.length/2)].clone()}i.isScalePoint=!0,i.tag=2,this.scalePoints.push(i)}},_radiusGeometry:function(){if(0!==this.radiusText.length){this.radiusPosAngle%=360;var t=SuperMap.Plot.PlottingUtil.destinationVincenty(this.centerPoint,360-this.radiusPosAngle+90,1e3*this.radius),e=new SuperMap.Geometry.Point(t.lng,t.lat),i=new SuperMap.Geometry.Point(this.centerPoint.lng,this.centerPoint.lat),o=SuperMap.Plot.PlottingUtil.distance(i,e),s=[];if(s.push(this.centerPoint),s.push(L.latLng(e.y,e.x)),SuperMap.Plot.RadiusLineType.NONE!==this.radiusLineType&&this._createAndDrawLayer(SuperMap.Plot.SymbolType.POLYLINESYMBOL,s,{surroundLineFlag:!1}),this.radiusLineType===SuperMap.Plot.RadiusLineType.ARROW){var l;if(null===this.map)l=0;else{var n=this._map.layerPointToLatLng(L.point(0,0)),a=this._map.layerPointToLatLng(L.point(this.subSymbolDefaultPixelSize,0));l=SuperMap.Plot.PlottingUtil.distance(new SuperMap.Geometry.Point(n.lng,n.lat),new SuperMap.Geometry.Point(a.lng,a.lat))}var r=SuperMap.Plot.PlottingUtil.findPoint(e,i,l,12.5),p=SuperMap.Plot.PlottingUtil.findPoint(e,i,l,-12.5),u=[];u.push(L.latLng(e.y,e.x)),u.push(L.latLng(r.y,r.x)),u.push(L.latLng(p.y,p.x)),this._createAndDrawLayer(SuperMap.Plot.SymbolType.ARBITRARYPOLYGONSYMBOL,u,{surroundLineFlag:!1,fill:!0,fillLimit:!0,lineTypeLimit:!0})}if(SuperMap.Util.isArray(this.radiusText)||(this.radiusText=[this.radiusText]),this.radiusText.length>=1){var h=SuperMap.Plot.PlottingUtil.findPoint(i,e,.2*o,0),y=SuperMap.Plot.PlottingUtil.findPoint(i,e,.8*o,0),c=SuperMap.Plot.PlottingUtil.findPoint(h,e,.02*o,90),S=SuperMap.Plot.PlottingUtil.findPoint(y,e,.02*o,90),P=L.latLng(c.y,c.x),g=L.latLng(S.y,S.x);let t=SuperMap.Plot.RelLineText.ONLEFTLINE;var d=[];c.xthis.startAngle&&ithis.startAngle&&i+360this.startAngle&&othis.startAngle&&o+3600&&(this.centerPoint=this.latLngs[0].clone()),2===this.latLngs.length&&(this.radius=SuperMap.Plot.PlottingUtil.distVincenty(this.latLngs[0],this.latLngs[1]));this.redraw()},_resizeLatLngs:function(t,e,i,o){var s=!1;1===this.latLngs.length&&(s=!0,this.latLngs.push(this.scalePoints[0])),ht.prototype._resizeLatLngs.call(this,t,e,i,o),this.centerPoint.lng=this.latLngs[0].lng,this.centerPoint.lat=this.latLngs[0].lat,this.radius=SuperMap.Plot.PlottingUtil.distVincenty(this.latLngs[0],this.latLngs[1]),s&&this.latLngs.splice(1,1)},setRotate:function(t){if(this.dRotate=t,this._rotate(t,this.centerPoint),this.radiusPosAngle+=t,this.startAngle+=t,this.endAngle+=t,this.textPosition+=t,this.latLngs=[],0!==this.avoidRegions.length)for(var e=0,i=this.avoidRegions.length;e0&&o-e<5){let t=SuperMap.Plot.PlottingUtil.destinationVincenty(this.centerPoint,360-e+90,1e3*this.radius);i.push(t)}return i}}),Xt=function(t,e,i,o){return new Ht(t,e,i,o)};L.supermap.plotting.arcRegion=Xt;var Jt=nt.extend({colNum:null,space:null,initialize:function(t,e,i,o){nt.prototype.initialize.call(this,t,e,i,o),this.libID=0,this.code=SuperMap.Plot.SymbolType.NAVYDEPLOYMENT,this.symbolType=SuperMap.Plot.SymbolType.NAVYDEPLOYMENT,this.symbolName="海军兵力部署",null===this.colNum&&(this.colNum=1),null===this.space&&(this.space=10),null===this.scaleByMap&&(this.scaleByMap=!0)},destroy:function(){this.space=null,this.colNum=null,nt.prototype.destroy.call(this)},redraw:function(){"none"!==this.style.display?this._redrawComponents():this._clearComponents()},_calculateParts:function(){var t=this.layer.getFeatureByUuid(this.associatedUuid);if(null!==t&&t.symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL&&0!==t.latLngs.length){var e=!1;for(let i=0;i=this.subSymbols[t].symbolData.innerCells[x].positionPoints[_].x&&(T=this.subSymbols[t].symbolData.innerCells[x].positionPoints[_].x),v<=this.subSymbols[t].symbolData.innerCells[x].positionPoints[_].y&&(v=this.subSymbols[t].symbolData.innerCells[x].positionPoints[_].y),A>=this.subSymbols[t].symbolData.innerCells[x].positionPoints[_].y&&(A=this.subSymbols[t].symbolData.innerCells[x].positionPoints[_].y);var O=L.latLng(M,m),w=this._map.latLngToLayerPoint(L.latLng(M,m)),I=new SuperMap.Geometry.Point(b,(v+A)/2),D=new SuperMap.Geometry.Point(I.x,I.y),E=new SuperMap.Geometry.Point(this.subSymbols[t].symbolData.anchorPoint.x,this.subSymbols[t].symbolData.anchorPoint.y),C=this._transitionPoint(D,w),N=this._transitionPoint(E,w);O.lat+=N.lat-C.lat,O.lng+=N.lng-C.lng;var U=this.subSymbols[t].symbolData.libID,R=this.subSymbols[t].symbolData.code;this.subSymbols[t].symbolData.annotationPosition=6;var B=SuperMap.Util.cloneObject(this.subSymbols[t].symbolData),G=L.supermap.plotting.PlottingObject.createSymbol(U,R,O,{serverUrl:this.serverUrl,symbolData:B,scaleByMap:!0,minScale:0,maxScale:2048,space:0});G.enableEdit=!0,G.ownerGroup=this,this._addComponents(G),this.bounds=this._calculateBounds(),this.subObjects.push(G)}if(this.bounds=new L.LatLngBounds,this.bounds=this._calculateBounds(),null!==this.textContent&&0!==this.textContent.length){var F=L.latLng(i[0].lat+y/2+l,i[0].lng-5*l),k=L.supermap.plotting.PlottingObject.createSymbol(0,34,[F],{textContent:this.textContent,serverUrl:this.serverUrl});k.style.labelAlign="rb",k.style.scaleByMap=!0,k.enableEdit=!0,k.ownerGroup=this,this._addComponents(k),this.bounds.extend(k.getBounds()),this.subObjects.push(k)}var z=new L.LatLngBounds(L.latLng(this.bounds.getSouth()-l,this.bounds.getWest()-l),L.latLng(this.bounds.getNorth()+l,this.bounds.getEast()+l)),Y=[];Y.push(L.latLng(z.getNorth(),z.getWest())),Y.push(L.latLng(z.getSouth(),z.getEast()));var V=L.latLng(i[0].lat,i[0].lng);V.isFixedPos=!0,Y.push(V);var W=L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL,Y,{serverUrl:this.serverUrl});for(var j in W.enableEdit=!0,W.ownerGroup=this,this.subObjects.splice(0,0,W),this._addComponents(W),this._clearComponents(),this.subObjects)this.subObjects[j].ownerGroup=this,this.subObjects[j].enableEdit=!0,this._addComponents(this.subObjects[j])}}},_reView:function(){for(var t in this.subObjects)this.subObjects[t].layer&&this.subObjects[t]._reView();this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)},move:function(t,e){for(var i in this.subObjects)this.subObjects[i].move(t,e);this.fire(SuperMap.Plot.Event.reseteditmarkersvalues)},_resize:function(t,e){for(var i in this.subObjects)this.subObjects[i]._resize(t,e)},_transitionPoint:function(t,e){var i=e.x+t.x*(96/254),o=e.y-t.y*(96/254);return this._map.layerPointToLatLng(L.point(i,o))},_getSubSymbolCount:function(t){var e=0;if(t<0)return e;t>this.subSymbols.length-1&&(t=this.subSymbols.length-1);for(var i=0;i<=t;i++)e+=this.subSymbols[t].totalNum;return e},_calculateBounds:function(){for(var t in this.bounds=new L.LatLngBounds,this.components)this.components[t].symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL&&this.bounds.extend(this.components[t].getBoundsWithText());return this.bounds},setTextContent:function(t){if(this.textContent!==t){this.textContent=t;for(var e=0;e=S.length);P++){var d=S[g];if(void 0!==d.symbolData&&null!==d.symbolData){for(var f=d.symbolData.libID,m=d.symbolData.code,M=c.lng+P*(l+Math.abs(u.getEast()-u.getWest())),b=c.lat-(2*l+Math.abs(u.getNorth()-u.getSouth())/2),T=0,v=0,A=0,x=0,_=0;_=d.symbolData.innerCells[_].positionPoints[O].x&&(v=d.symbolData.innerCells[_].positionPoints[O].x),A<=d.symbolData.innerCells[_].positionPoints[O].y&&(A=d.symbolData.innerCells[_].positionPoints[O].y),x>=d.symbolData.innerCells[_].positionPoints[O].y&&(x=d.symbolData.innerCells[_].positionPoints[O].y);var w=L.latLng(b,M),I=this._map.latLngToLayerPoint(L.latLng(b,M)),D=new SuperMap.Geometry.Point((T+v)/2,A),E=new SuperMap.Geometry.Point(D.x,D.y),C=new SuperMap.Geometry.Point(S[g].symbolData.anchorPoint.x,S[g].symbolData.anchorPoint.y),N=this._transitionPoint(E,I),U=this._transitionPoint(C,I);w.lat+=U.lat-N.lat,w.lng+=U.lng-N.lng,d.symbolData.annotationPosition=5;var R=SuperMap.Util.cloneObject(d.symbolData),B=L.supermap.plotting.PlottingObject.createSymbol(f,m,w,{symbolData:R,scaleByMap:!0,minScale:0,maxScale:2048,space:0});B.enableEdit=!0,B.ownerGroup=this,this._addComponents(B),this.subObjects.push(B),g++}}this.bounds=this._calculateBounds(),c.lat=this.bounds.getSouth()}if(this.isShowTooltip){var G=new L.LatLngBounds(L.latLng(this.bounds.getSouth()-l,this.bounds.getWest()-l),L.latLng(this.bounds.getNorth()+l+1.2,this.bounds.getEast()+l)),F=[];F.push(L.latLng(G.getNorth(),G.getWest())),F.push(L.latLng(G.getSouth(),G.getEast()));var k=L.latLng(i[0].lat,i[0].lng);k.isFixedPos=!0,F.push(k);var z=L.supermap.plotting.PlottingObject.createSymbol(0,SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL,F,{serverUrl:this.serverUrl});for(var Y in z.enableEdit=!0,z.ownerGroup=this,this.subObjects.splice(0,0,z),this._addComponents(z),this._clearComponents(),this.subObjects)this.subObjects[Y].enableEdit=!0,this.subObjects[Y].ownerGroup=this,this._addComponents(this.subObjects[Y])}}}},_setSubSymbolText:function(){for(var t=0;t=this.minEditPts&&this._createAndDrawLayer(32,this.latLngs,this.style,"")},move:function(t,e){L.Util.moveLatLngs(this.getLatLngs(),t,e);for(var i=0,o=this.avoidRegions.length;iSuperMap.Plot.PlottingUtil.distance(l[t],o[0])&&(r=SuperMap.Plot.PlottingUtil.distance(l[t],o[0]),n=t);var p=0;0===n&&(n=1);for(let t=0;t1&&(this._createAndDrawLayer(24,l,{surroundLineFlag:!1,lineWidthLimit:!0,weight:4*t.style.weight+this.style.weight}),l[0].isScalePoint=!0,l[0].tag=2*e,this.scalePoints.push(l[0]),l[l.length-1].isScalePoint=!0,l[l.length-1].tag=2*e+1,this.scalePoints.push(l[l.length-1]))}}},calculateBounds:function(){this.bounds=null;var t=new L.Bounds,e=this.components;if(e)for(var i=0;i=SuperMap.Plot.PlottingUtil.distance(l[0],n[t])&&(r=SuperMap.Plot.PlottingUtil.distance(l[0],n[t]),p=t);for(let e=0;e=SuperMap.Plot.PlottingUtil.distance(l[0],n[t])&&(u=SuperMap.Plot.PlottingUtil.distance(l[0],n[t]),p=t);for(let e=0;ee&&(this.symbolTexts[e]=t,this.redraw(),this.fire(SuperMap.Plot.Event.reseteditmarkersvalues))},removeSymbolTextsFromDotSymbol:function(t){if(t&&"string"==typeof t){var e=this.layer.getFeatureByUuid(t);if(e)for(var i=0,o=e.geoSymbolTexts.length;i0){var o=this.layer.getFeatureByUuid(this.associatedUuid);if(null===o||void 0===o)return;var s=!1,l=o.geoSymbolTexts;for(let t=0,e=l.length;t=this.libIDs.length?-1:this.libIDs[t]},getSymbolLibJSONInfo:function(t){return t>=this.libIDs.length?null:this.symbolLibJsons[t]},getSymbolLibByIndex:function(t){return t>=this.libIDs.length?null:this.symbolLibs[t]},getSymbolLibByLibId:function(t){for(var e=0;ethis.maxCount-1&&this.undoTransactions.splice(0,this.undoTransactions.length-this.maxCount+1),this.undoTransactions.push(t)},undo:function(){var t=this.undoTransactions.length;if(t>0){var e=this.undoTransactions[t-1];this.doTransaction(e,!0),this.redoTransactions.push(e),this.undoTransactions.splice(t-1,1)}},redo:function(){var t=this.redoTransactions.length;if(t>0){var e=this.redoTransactions[t-1];this.doTransaction(e),this.undoTransactions.push(e),this.redoTransactions.splice(t-1,1)}},doTransaction:function(t,e){var i=t.transInfos;if(t.transType===SuperMap.Plot.TransactionType.CREATE)for(var o=0,s=i.length;o0&&n.setFontAlign(a[0]);else if("setLatLngs"===i[l].functionName)a.length>0&&n.setLatLngs(a[0]);else if("modifyPoint"===i[l].functionName)a.length>0&&n._modifyPoint(a[0],a[1]);else if("setTextContent"===i[l].functionName)a.length>0&&n.setTextContent(a[0]);else if("setRadiusText"===i[l].functionName)2===a.length&&n.setRadiusText(a[0],a[1]);else if("setType"===i[l].functionName&&n instanceof L.supermap.plotting.RouteNode)a.length>0&&n.setType(a[0]);else if("setStrokeColor"===i[l].functionName&&n.geometry instanceof SuperMap.Geometry.GroupObject)a.length>0&&n.setStyle(a[0]);else if("addAvoidRegion"===i[l].functionName)a.length>0&&(a[0]&&a[0].layer&&a[0].layer.removeFeatures(a[0]),e?n.removeAvoidRegions(a[0]):n.addAvoidRegion(a[0]));else if("removeAvoidRegions"===i[l].functionName){if(a.length>0){for(let t=0;t0&&(r=t.unGroupObject(i[l].undoParams[0])):"createGroupObject"===i[l].functionName?r=t.createGroupObject(i[l].redoParams[0]):"createFlags"===i[l].functionName&&(r=t.createFlags(i[l].redoParams[0])),null!==r&&t._map.getPlotEditControl().selectFeatures(r)}else"updateSymbolText"===i[l].functionName?a.length>0&&n.updateSymbolText(a[0],a[1]):i[l].functionName&&null!==a&&n[i[l].functionName](a[0],a[1]);if(i[l].propertyName){var p=i[l].undoValue;e||(p=i[l].redoValue),n.hasOwnProperty(i[l].propertyName)?n[i[l].propertyName]=p:null!==n&&(n.style[i[l].propertyName]=p)}n&&n.layer&&(n.symbolType!==SuperMap.Plot.SymbolType.DOTSYMBOL||8!==n.textPosition||"fontColor"!==i[l].propertyName&&"fontFamily"!==i[l].propertyName||n._calculateParts(),n.redraw(),n.fire(SuperMap.Plot.Event.reseteditmarkersvalues))}}else if(t.transType===SuperMap.Plot.TransactionType.REMOVE)for(var u=0;un.lat?l.lat:n.lat;if(!(e.latr))(e.lat-l.lat)*(n.lng-l.lng)/(n.lat-l.lat)+l.lng>e.lng&&i++}}return i%2==1},getGObjectsInCircle:function(t,e){if(t&&e){for(var i=[],o=this.map.getPlottingLayers(),s=0;sMath.sqrt(Math.pow(t.lng-r.lng,2)+Math.pow(t.lat-r.lat,2))&&i.push(a)}}}return i}},getGObjectsInRect:function(t,e){if(t&&e){for(var i=[],o=this.map.getPlottingLayers(),s=0;se.lat?r.lng>t.lng&&r.lnge.lat&&i.push(a):r.lnge.lng&&r.late.lat&&i.push(a)}}}return i}}}),xe=function(t){return new Ae(t)};L.supermap.plotting.query=xe;var _e=L.supermap.ServiceBase.extend({initialize:function(t,e){L.supermap.ServiceBase.prototype.initialize.call(this,t,e)},getSMLInfos:function(t,e,i){return i||(i=this),new x(this.url,{eventListeners:{scope:i,processCompleted:e,processFailed:e}}).processAsync(t),this},editSMLFile:function(t,e,i){return i||(i=this),new M(this.url,{eventListeners:{scope:i,processCompleted:e,processFailed:e}}).processAsync(t),this}}),Oe=function(t,e){return new _e(t,e)};L.supermap.smlFileService=Oe;var we=L.supermap.ServiceBase.extend({initialize:function(t,e){L.supermap.ServiceBase.prototype.initialize.call(this,t,e)},getSymbolInfo:function(t,e,i){return i||(i=this),new O(this.url,{serverType:this.options.serverType,eventListeners:{scope:i,processCompleted:e,processFailed:e}}).processAsync(t),this}}),Ie=function(t,e){return new we(t,e)};L.supermap.symbolInfoService=Ie;var De=L.supermap.ServiceBase.extend({initialize:function(t,e){L.supermap.ServiceBase.prototype.initialize.call(this,t,e)},getLibIDs:function(t,e){return e||(e=this),new b(this.url,{eventListeners:{scope:e,processCompleted:t,processFailed:t}}).processAsync(),this},getLibInfo:function(t,e,i){return i||(i=this),new v(this.url,{eventListeners:{scope:i,processCompleted:e,processFailed:e}}).processAsync(t),this}}),Ee=function(t,e){return new De(t,e)};L.supermap.symbolLibService=Ee;var Ce=function(t){var e=[];L.Util.isArray(t)||(t=[t]);for(var i=0;i400&&(t.options.fontPercent=400),void 0===t.options.fontSpace&&(t.options.fontSpace=0),t.options.fontSpace>30?t.options.fontSpace=30:t.options.fontSpace<0&&(t.options.fontSpace=0);var i=t._latlng,o=this._map.latLngToLayerPoint(i);if(void 0!=o){if(t.options.labelXOffset||t.options.labelYOffset){var s=isNaN(t.options.labelXOffset)?0:t.options.labelXOffset,l=isNaN(t.options.labelYOffset)?0:t.options.labelYOffset;o.x+=s,o.y-=l}if(!0===t.options.fontBackground){this._ctx.font=[t.options.fontStyle?t.options.fontStyle:"normal","normal",t.options.fontWeight?t.options.fontWeight:"normal",t.options.fontSize?t.options.fontSize+"px":"1em",t.options.fontFamily?t.options.fontFamily:"sans-serif"].join(" ");var n=t.options.labelRotation;t.options.labelRotation=0;var a=t.getPxBounds();t.options.labelRotation=n;var r=a.min.x,p=a.min.y,u=a.max.x-a.min.x,h=a.max.y-a.min.y;this._ctx.fillStyle=t.options.fontBackgroundColor,this._ctx.globalAlpha=1,this._ctx.save(),this._ctx.translate(r,p),0!=t.options.labelRotation&&this._ctx.rotate(t.options.labelRotation*Math.PI/180),this._ctx.fillRect(0,0,u,h),this._ctx.restore()}if(!0===t.options.fontShadow){var y=L.point(o.x,o.y);if(t.options.fontShadowOffsetX&&(y.x+=t.options.fontShadowOffsetX),t.options.fontShadowOffsetY&&(y.y+=t.options.fontShadowOffsetY),0!==t.options.labelRotation){var c=o.x,S=o.y,P=t.options.labelRotation*Math.PI/180,g=Math.sqrt(Math.pow(y.x-c,2)+Math.pow(y.y-S,2)),d=P+Math.atan2(y.y-S,y.x-c);y.x=c+g*Math.cos(d),y.y=S+g*Math.sin(d)}var f=t.options.fontStroke;t.options.fontStroke=!1;var m=t.options.fontColor;t.options.fontColor=t.options.fontShadowColor,this._updateTextPt(y,t),t.options.fontColor=m,t.options.fontStroke=f}if(t.hasOwnProperty("_eventParents"))for(var M in t._eventParents)t._eventParents[M].hasOwnProperty("ownerGroup")&&null!==t._eventParents[M].ownerGroup&&(t._eventParents[M].ownerGroup.symbolType!==SuperMap.Plot.SymbolType.NAVYDEPLOYMENT&&t._eventParents[M].ownerGroup.symbolType!==SuperMap.Plot.SymbolType.AIRDEPLOYMENT||t._updateBounds());this._updateTextPt(o,t)}}},_updateImage:function(t){var e=this,i=function(){var t=this.style,i=t.graphicWidth||t.graphicHeight,o=t.graphicHeight||t.graphicWidth;i=i||2*t.pointRadius,o=o||2*t.pointRadius;var s=void 0!==t.graphicXOffset?t.graphicXOffset:-.5*i,l=void 0!==t.graphicYOffset?t.graphicYOffset:-.5*o,n=t.graphicOpacity||t.fillOpacity,a=this.point,r=a.x,p=a.y;if(!isNaN(r)&&!isNaN(p)){var u;e._ctx.save(),t.rotation&&(u=t.rotation/180*Math.PI),e._ctx.translate(r,p),u&&e._ctx.rotate(u),e._ctx.translate(s,l),e._ctx.globalAlpha=n;var h=L.Canvas.drawImageScaleFactor||(L.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);e._ctx.drawImage(this.img,0,0,i*h,o*h),e._ctx.restore()}},o=new Image;"firefox"==SuperMap.Browser.name?(o.onload=function(){i.call({point:t._point,style:t.options,img:o}),o.onload=null},t.options.graphicTitle&&(o.title=t.options.graphicTitle),o.src=t.options.externalGraphic):(t.options.graphicTitle&&(o.title=t.options.graphicTitle),o.onload=function(){o.src=t.options.externalGraphic,i.call({point:t._point,style:t.options,img:o}),o.onload=null}),window.ActiveXObject||"ActiveXObject"in window?o.onload():o.complete&&o.onload()},_updateArc:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=t._radius,s=(t._radiusY||o)/o,l=(360-t.options.endAngle)*(Math.PI/180),n=(360-t.options.startAngle)*(Math.PI/180);this._drawnLayers[t._leaflet_id]=t,1!==s&&(i.save(),i.scale(1,s)),i.beginPath(),i.arc(e.x,e.y/s,o,l,n,!1),1!==s&&i.restore(),this._fillStroke(i,t)}},_handleMouseHover:function(t,e){var i,o=null;for(var s in this._map._layers)if((i=this._map._layers[s])._drawFirst)for(var l=i._drawFirst;l;l=l.next)l.layer.options.interactive&&l.layer._containsPoint(e)&&!this._map._draggableMoved(l.layer)&&(o=l.layer);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(L.DomUtil.addClass(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_onClick:function(t){var e,i=this._map.mouseEventToLayerPoint(t),o=[],s=[];for(let t in this._map._layers)if(this._map._layers[t]._drawFirst)for(var l=this._map._layers[t]._drawFirst;l;l=l.next)if(l.layer.options.interactive&&l.layer._containsPoint(i)&&!this._map._draggableMoved(l.layer)&&(e=l.layer).hasOwnProperty("_eventParents")&&null!==e._eventParents)for(var n in e._eventParents)s.push(e),o.push(e._eventParents[n]);if(e&&s.length>1){if(o.length>0){var a=!1,r=[],p=[];for(let t=0,e=o.length;t1){this._fireEvent([p[e]],t);break}if(!a){this._fireEvent([p[p.length-1]],t);break}}}}else e&&(L.DomEvent.fakeStop(t),this._fireEvent([e],t))}}),L.Polyline.prototype._containsPoint=function(t,e){var i,o,s,l,n,a,r=this._clickTolerance()+5;if(this._pxBounds&&!this._pxBounds.contains(t))return!1;for(i=0,l=this._parts.length;i1){if(o.length>0){var r=!1,p=[],u=[];for(let t=0,e=o.length;t1){this._fireEvent([u[e]],t);break}if(!r){this._fireEvent([u[u.length-1]],t);break}}}}else e&&(L.DomEvent.fakeStop(t),e._eventParents[0]&&e._eventParents[0].fire(t.type,t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(L.DomUtil.removeClass(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null)},_handleMouseHover:function(t,e){var i,o;for(var s in this._layers)(i=this._layers[s]).options.interactive&&"function"==typeof i._containsPoint&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(L.DomUtil.addClass(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t)},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_updateTextPt:function(t,e,i,o){var s;if(t.setAttributeNS(null,"x",e.x),t.setAttributeNS(null,"y",e.y),i.options.display&&t.setAttributeNS(null,"display",i.options.display),!0===i.options.fontStroke&&(i.options.fontStrokeColor&&t.setAttributeNS(null,"stroke",i.options.fontStrokeColor),i.options.fontStrokeWidth&&t.setAttributeNS(null,"stroke-width",i.options.fontStrokeWidth)),i.options.labelRotation&&t.setAttributeNS(null,"transform","rotate("+i.options.labelRotation+" "+e.x+","+e.y+")"),i.options.fontColor&&t.setAttributeNS(null,"fill",i.options.fontColor),i.options.fontOpacity&&t.setAttributeNS(null,"opacity",i.options.fontOpacity),i.options.fontFamily&&t.setAttributeNS(null,"font-family",i.options.fontFamily),i.options.fontSize&&t.setAttributeNS(null,"font-size",i.options.fontSize),i.options.fontWeight&&t.setAttributeNS(null,"font-weight",i.options.fontWeight),i.options.fontStyle&&t.setAttributeNS(null,"font-layer.options",i.options.fontStyle),L.Browser.gecko){if(100!==i.options.fontPercent&&0!==i.options.fontSpace&&(s=i.options.fontSpace+i.options.fontPercent/100*parseFloat(i.options.fontSize)*i.options.text.length),100!==i.options.fontPercent&&0===i.options.fontSpace){var l=document.createElement("span");document.body.appendChild(l),l.style.width="auto",l.style.height="auto",i.options.fontSize&&(l.style.fontSize=new String(i.options.fontSize)+"px"),i.options.fontFamily&&(l.style.fontFamily=i.options.fontFamily),i.options.fontWeight&&(l.style.fontWeight=i.options.fontWeight),l.style.position="absolute",l.style.visibility="hidden",l.innerHTML=i.options.text;var n=l.clientWidth;s=i.options.fontPercent/100*n+i.options.text.length}t.setAttributeNS(null,"textLength",s),t.setAttributeNS(null,"lengthAdjust","spacingAndGlyphs")}t.setAttributeNS(null,"pointer-events","visible");var a=i.options.labelAlign||"cm";t.setAttributeNS(null,"text-anchor",L.SVG.LABEL_ALIGN[a[0]]||"middle"),!0===L.Browser.gecko&&t.setAttributeNS(null,"dominant-baseline",L.SVG.LABEL_ALIGN[a[1]]||"central");for(var r=function(){let t=L.SVG.LABEL_VFACTOR[a[1]];null===t&&(t=-.5);let e=t*(u-1);return L.Browser.ie&&(null===(t=L.SVG.LABEL_IE_VOFFSET[a[1]])&&(t=.35),e+=t),e},p=i.options.text.split("\n"),u=p.length;t.childNodes.length>u;)t.removeChild(t.lastChild);for(var h=0;h>>1)),0!==g?s.setAttribute("dy","0em"):0===h?s.setAttribute("dy",r()+"em"):s.setAttribute("dy","1em");let l=""===S[g]?" ":S[g];i.options.isUnicode?L.Browser.ie||L.Browser.ielt9?(this.element.innerHTML=l,s.textContent=this.element.innerHTML):s.innerHTML=l:s.textContent=l,s.parentNode||t.appendChild(s),P+=S[g],c=SuperMap.Plot.PlottingUtil.getTextWidth(i.options,P)+parseFloat(i.options.fontSpace)*(i.options.fontPercent/100)}}else{let s=o+"tspan"+h;i._tspanNodeObj&&i._tspanNodeObj[s]||(i._tspanNodeObj[s]=L.SVG.create("tspan"));let l=i._tspanNodeObj[s];if(!1===L.Browser.gecko&&l.setAttributeNS(null,"baseline-shift",L.SVG.LABEL_VSHIFT[a[1]]||"-35%"),100!==i.options.fontPercent){let t=SuperMap.Plot.PlottingUtil.getTextWidth(i.options,p[h]);l.setAttributeNS(null,"textLength",t),l.setAttributeNS(null,"lengthAdjust","spacingAndGlyphs")}l.setAttribute("x",e.x),0==h?l.setAttribute("dy",r()+"em"):l.setAttribute("dy","1em");let n=""===p[h]?" ":p[h];i.options.isUnicode?L.Browser.ie||L.Browser.ielt9?(this.element.innerHTML=n,l.textContent=this.element.innerHTML):l.innerHTML=n:l.textContent=n,l.parentNode||t.appendChild(l)}}t.parentNode||this._rootGroup.appendChild(t)},_updateText:function(t){if(t.options.text&&0!==t.options.text.length)if(t.options.fontSize<6||t.options.fontPercent<=0)t._removeNode();else{for(var e in t._eventParents)if(t._eventParents[e].symbolType===SuperMap.Plot.SymbolType.DOTSYMBOL&&!1===t._eventParents[e].textDisplay)return void t._removeNode();void 0===t.options.fontPercent&&(t.options.fontPercent=100),t.options.fontPercent<0&&(t.options.fontPercent=0),t.options.fontPercent>400&&(t.options.fontPercent=400),void 0===t.options.fontSpace&&(t.options.fontSpace=0),t.options.fontSpace>30?t.options.fontSpace=30:t.options.fontSpace<0&&(t.options.fontSpace=0);var i=t._latlng,o=this._map.latLngToLayerPoint(i);if(void 0!=o){if(t.options.labelXOffset||t.options.labelYOffset){var s=isNaN(t.options.labelXOffset)?0:t.options.labelXOffset,l=isNaN(t.options.labelYOffset)?0:t.options.labelYOffset;o.x+=s,o.y-=l}if(!0===t.options.fontShadow){t._shadowTextNode&&t._shadowTextNode.parentNode||(t._shadowTextNode=L.SVG.create("text"),this._rootGroup.appendChild(t._shadowTextNode));var n=L.point(o.x,o.y);if(t.options.fontShadowOffsetX&&(n.x+=t.options.fontShadowOffsetX),t.options.fontShadowOffsetY&&(n.y+=t.options.fontShadowOffsetY),0!==t.options.labelRotation){var a=o.x,r=o.y,p=t.options.labelRotation*Math.PI/180,u=Math.sqrt(Math.pow(n.x-a,2)+Math.pow(n.y-r,2)),h=p+Math.atan2(n.y-r,n.x-a);n.x=a+u*Math.cos(h),n.y=r+u*Math.sin(h)}var y=t.options.fontStroke;t.options.fontStroke=!1;var c=t.options.fontColor;t.options.fontColor=t.options.fontShadowColor,this._updateTextPt(t._shadowTextNode,n,t,"shadow"),t.options.fontColor=c,t.options.fontStroke=y}else t._shadowTextNode&&t._shadowTextNode.parentNode&&(this._rootGroup.removeChild(t._shadowTextNode),delete t._shadowTextNode);if(t._textNode&&t._textNode.parentNode||(t._textNode=L.SVG.create("text"),this._rootGroup.appendChild(t._textNode),t.options.interactive&&L.DomUtil.addClass(t._textNode,"leaflet-interactive"),t.addInteractiveTarget(t._textNode)),this._updateTextPt(t._textNode,o,t,"label"),!0===t.options.fontBackground){var S=t._shadowTextNode;if(S&&S.parentNode||(S=t._textNode),!S||!S.parentNode)return;t._backgroundTextNode&&t._backgroundTextNode.parentNode||(t._backgroundTextNode=L.SVG.create("rect"),!0===t.options.fontShadow?this._rootGroup.insertBefore(t._backgroundTextNode,t._shadowTextNode):this._rootGroup.insertBefore(t._backgroundTextNode,t._textNode));var P=t._textNode.getBBox();t._backgroundTextNode.x.baseVal.value=P.x,t._backgroundTextNode.y.baseVal.value=P.y,t._backgroundTextNode.width.baseVal.value=P.width,t._backgroundTextNode.height.baseVal.value=P.height,t._backgroundTextNode.style.fill=t.options.fontBackgroundColor,t.options.labelRotation&&t._backgroundTextNode.setAttributeNS(null,"transform","rotate("+t.options.labelRotation+" "+o.x+","+o.y+")")}else t._backgroundTextNode&&t._backgroundTextNode.parentNode&&(this._rootGroup.removeChild(t._backgroundTextNode),delete t._backgroundTextNode)}else t._removeNode()}else t._removeNode()},_updateImage:function(t){if(t._imageNode&&t._imageNode.parentNode||(t._imageNode=L.SVG.create("image"),this._rootGroup.appendChild(t._imageNode)),t._imageNode.setAttributeNS(null,"cx",t._point.x),t._imageNode.setAttributeNS(null,"cy",t._point.y),t._imageNode.setAttributeNS(null,"r",1),t._imageNode.style.visibility="",t.options.graphicTitle){t._imageNode.setAttributeNS(null,"title",t.options.graphicTitle);var e=L.SVG.create("title");e.textContent=style.graphicTitle,t._imageNode.appendChild(e)}t.options.graphicWidth&&t.options.graphicHeight&&t._imageNode.setAttributeNS(null,"preserveAspectRatio","none");var i=t.options.graphicWidth||t.options.graphicHeight,o=t.options.graphicHeight||t.options.graphicWidth;i=i||2*t.options.pointRadius,o=o||2*t.options.pointRadius;var s=void 0!=t.options.graphicXOffset?t.options.graphicXOffset:-.5*i,l=void 0!=t.options.graphicYOffset?t.options.graphicYOffset:-.5*o,n=t.options.graphicOpacity||t.options.fillOpacity;t._imageNode.setAttributeNS(null,"x",(t._point.x+s).toFixed()),t._imageNode.setAttributeNS(null,"y",(t._point.y+l).toFixed()),t._imageNode.setAttributeNS(null,"width",i),t._imageNode.setAttributeNS(null,"height",o),t._imageNode.setAttributeNS("http://www.w3.org/1999/xlink","href",t.options.externalGraphic),t._imageNode.setAttributeNS(null,"style","opacity: "+n),t._imageNode.onclick=L.SVG.preventDefault;var a=t.options.rotation;void 0===a&&void 0===t._imageNode._rotation||!t._point||(t._imageNode._rotation=a,a|=0,t._imageNode.setAttributeNS(null,"transform","rotate("+a+" "+t._point.x+" "+t._point.y+")")),t._imageNode.setAttributeNS(null,"fill","none"),t._imageNode.setAttributeNS(null,"stroke","none"),t.options.pointerEvents?(t._imageNode.setAttributeNS(null,"pointer-events",t.options.pointerEvents),t._imageNode.style.pointerEvents=t.options.pointerEvents):(t._imageNode.setAttributeNS(null,"pointer-events","visiblepainted"),t._imageNode.style.pointerEvents="visiblepainted"),null!=t.options.cursor&&t._imageNode.setAttributeNS(null,"cursor",style.cursor)},_updateArc:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=t._radius,o="a"+i+","+(t._radiusY||i)+" 0 1,0 ";sRadian=(360-t.options.endAngle)*(Math.PI/180),eRadian=(360-t.options.startAngle)*(Math.PI/180);var s=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,s)}}}),L.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"},L.SVG.LABEL_VSHIFT={t:"-83%",b:"0"},L.SVG.LABEL_VFACTOR={t:0,b:-1},L.SVG.LABEL_IE_VOFFSET={t:.86,b:0},L.SVG.preventDefault=function(t){t.preventDefault&&t.preventDefault()}}]);