/*! * * iclient-plot-leaflet.(https://iclient.supermap.io) * Copyright© 2000 - 2020 SuperMap Software Co.Ltd * version: v10.1.0 * */!function(t){var e={};function o(i){if(e[i])return e[i].exports;var l=e[i]={i:i,l:!1,exports:{}};return t[i].call(l.exports,l,l.exports,o),l.l=!0,l.exports}o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var l in t)o.d(i,l,function(e){return t[e]}.bind(null,l));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=183)}([function(t,e,o){"use strict";o(0),L.supermap.plotting=L.supermap.plotting||{}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GraphicObject=void 0,o(0);var i=o(5),l=o(2),n=o(11),a=e.GraphicObject=i.PlottingObject.extend({surroundLineType:null,scaleByMap:null,latLngs:[],initialize:function(t,e,o,l){this.geoSymbolTexts=[],this.subAssociatedUuids=[],this.latLngs=o||[],i.PlottingObject.prototype.initialize.call(this,t,e,o,l),null===this.surroundLineType&&(this.surroundLineType=SuperMap.Plot.AlgoSurroundLineType.NONE)},destroy:function(){i.PlottingObject.prototype.destroy.call(this),this.surroundLineType=null,this.scaleByMap=null,this.latLngs=[]},setLatLngs:function(t){return this.latLngs=t,this.redraw()},getLatLngs:function(){return this.latLngs},addLatLng:function(t){if(this.latLngs[this.latLngs.length-1].lat!==t.lat||this.latLngs[this.latLngs.length-1].lng!==t.lng)return this.latLngs.push(t),this.redraw()},setScaleByMap:function(t){this.scaleByMap=t},getScaleByMap:function(){return this.scaleByMap},getSurroundLineType:function(){return this.surroundLineType},setSurroundLineType:function(){},_resizeLatLngs:function(t,e,o,i){if(this.symbolType!==SuperMap.Plot.SymbolType.SATELLITETIMEWINDOWS){var l=this._resizeBounds(t,e,o);if(!(SuperMap.Plot.PlottingUtil.equalFuzzy(l.getWest(),l.getEast())&&SuperMap.Plot.PlottingUtil.equalFuzzy(l.getNorth(),l.getSouth())||SuperMap.Plot.PlottingUtil.equalFuzzy(o.getWest(),o.getEast())&&SuperMap.Plot.PlottingUtil.equalFuzzy(o.getNorth(),o.getSouth()))){var n=SuperMap.Plot.PlottingUtil.equalFuzzy(o.getWest(),o.getEast())?0:(l.getEast()-l.getWest())/(o.getEast()-o.getWest()),a=SuperMap.Plot.PlottingUtil.equalFuzzy(o.getNorth(),o.getSouth())?0:(l.getNorth()-l.getSouth())/(o.getNorth()-o.getSouth()),s=L.latLng((o.getNorth()+o.getSouth())/2,(o.getWest()+o.getEast())/2),r=L.latLng((l.getNorth()+l.getSouth())/2,(l.getWest()+l.getEast())/2);if(this.symbolType===SuperMap.Plot.SymbolType.ANNOFRAMESYMBOL||this.symbolType===SuperMap.Plot.SymbolType.ANNOFRAMESYMBOLM||this.symbolType===SuperMap.Plot.SymbolType.SYMBOLTEXTBOX||this.symbolType===SuperMap.Plot.SymbolType.LINEMARKING)this.latLngs[0].lng=r.lng+(i[0].lng-s.lng)*n,this.latLngs[0].lat=r.lat+(i[0].lat-s.lat)*a,this.latLngs[1].lng=r.lng+(i[1].lng-s.lng)*n,this.latLngs[1].lat=r.lat+(i[1].lat-s.lat)*a;else if(this.symbolType===SuperMap.Plot.SymbolType.CONCENTRICCIRCLE)if(2===e||4===e||5===e||7===e){1===n&&(n=0),1===a&&(a=0);for(var u=Math.sqrt(n*n+a*a),p=L.Util.latLngsToSuperMapPoints(i),h=1;h
>>1)),0!==d?m.setAttribute("dy","0em"):0===h?m.setAttribute("dy",r()+"em"):m.setAttribute("dy","1em");var v=""===f[d]?" ":f[d];o.options.isUnicode?L.Browser.ie||L.Browser.ielt9?(this.element.innerHTML=v,m.textContent=this.element.innerHTML):m.innerHTML=v:m.textContent=v,m.parentNode||t.appendChild(m),P+=f[d],y=SuperMap.Plot.PlottingUtil.getTextWidth(o.options,P)+parseFloat(o.options.fontSpace)*(o.options.fontPercent/100)}}else{var M=i+"tspan"+h;o._tspanNodeObj&&o._tspanNodeObj[M]||(o._tspanNodeObj[M]=L.SVG.create("tspan"));var A=o._tspanNodeObj[M];if(!1===L.Browser.gecko&&A.setAttributeNS(null,"baseline-shift",L.SVG.LABEL_VSHIFT[s[1]]||"-35%"),100!==o.options.fontPercent){var T=SuperMap.Plot.PlottingUtil.getTextWidth(o.options,u[h]);A.setAttributeNS(null,"textLength",T),A.setAttributeNS(null,"lengthAdjust","spacingAndGlyphs")}A.setAttribute("x",e.x),0==h?A.setAttribute("dy",r()+"em"):A.setAttribute("dy","1em");var _=""===u[h]?" ":u[h];o.options.isUnicode?L.Browser.ie||L.Browser.ielt9?(this.element.innerHTML=_,A.textContent=this.element.innerHTML):A.innerHTML=_:A.textContent=_,A.parentNode||t.appendChild(A)}}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 o=t._latlng,i=this._map.latLngToLayerPoint(o);if(void 0!=i){if(t.options.labelXOffset||t.options.labelYOffset){var l=isNaN(t.options.labelXOffset)?0:t.options.labelXOffset,n=isNaN(t.options.labelYOffset)?0:t.options.labelYOffset;i.x+=l,i.y-=n}if(!0===t.options.fontShadow){t._shadowTextNode&&t._shadowTextNode.parentNode||(t._shadowTextNode=L.SVG.create("text"),this._rootGroup.appendChild(t._shadowTextNode));var a=L.point(i.x,i.y);if(t.options.fontShadowOffsetX&&(a.x+=t.options.fontShadowOffsetX),t.options.fontShadowOffsetY&&(a.y+=t.options.fontShadowOffsetY),0!==t.options.labelRotation){var s=i.x,r=i.y,u=t.options.labelRotation*Math.PI/180,p=Math.sqrt(Math.pow(a.x-s,2)+Math.pow(a.y-r,2)),h=u+Math.atan2(a.y-r,a.x-s);a.x=s+p*Math.cos(h),a.y=r+p*Math.sin(h)}var c=t.options.fontStroke;t.options.fontStroke=!1;var g=t.options.fontColor;t.options.fontColor=t.options.fontShadowColor,this._updateTextPt(t._shadowTextNode,a,t,"shadow"),t.options.fontColor=g,t.options.fontStroke=c}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,i,t,"label"),!0===t.options.fontBackground){var y=t._shadowTextNode;if(y&&y.parentNode||(y=t._textNode),!y||!y.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 f=t._textNode.getBBox();t._backgroundTextNode.x.baseVal.value=f.x,t._backgroundTextNode.y.baseVal.value=f.y,t._backgroundTextNode.width.baseVal.value=f.width,t._backgroundTextNode.height.baseVal.value=f.height,t._backgroundTextNode.style.fill=t.options.fontBackgroundColor,t.options.labelRotation&&t._backgroundTextNode.setAttributeNS(null,"transform","rotate("+t.options.labelRotation+" "+i.x+","+i.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 o=t.options.graphicWidth||t.options.graphicHeight,i=t.options.graphicHeight||t.options.graphicWidth;o=o||2*t.options.pointRadius,i=i||2*t.options.pointRadius;var l=void 0!=t.options.graphicXOffset?t.options.graphicXOffset:-.5*o,n=void 0!=t.options.graphicYOffset?t.options.graphicYOffset:-.5*i,a=t.options.graphicOpacity||t.options.fillOpacity;t._imageNode.setAttributeNS(null,"x",(t._point.x+l).toFixed()),t._imageNode.setAttributeNS(null,"y",(t._point.y+n).toFixed()),t._imageNode.setAttributeNS(null,"width",o),t._imageNode.setAttributeNS(null,"height",i),t._imageNode.setAttributeNS("http://www.w3.org/1999/xlink","href",t.options.externalGraphic),t._imageNode.setAttributeNS(null,"style","opacity: "+a),t._imageNode.onclick=L.SVG.preventDefault;var s=t.options.rotation;void 0===s&&void 0===t._imageNode._rotation||!t._point||(t._imageNode._rotation=s,s|=0,t._imageNode.setAttributeNS(null,"transform","rotate("+s+" "+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,o=t._radius,i="a"+o+","+(t._radiusY||o)+" 0 1,0 ";sRadian=(360-t.options.endAngle)*(Math.PI/180),eRadian=(360-t.options.startAngle)*(Math.PI/180);var l=t._empty()?"M0 0":"M"+(e.x-o)+","+e.y+i+2*o+",0 "+i+2*-o+",0 ";this._setPath(t,l)}}}),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()}},function(t,e,o){"use strict";var i=o(9),l=o(35),n=o(14);L.Map.include({getFeatureByUuid:function(t){var e=[];for(var o in this._layers){var a;if(this._layers[o]instanceof i.PlottingLayer)null!==(a=this._layers[o].getFeatureByUuid(t))&&e.push(a);if(this._layers[o]instanceof l.PlottingGraphicLayer)null!==(a=this._layers[o].getFeatureByUuid(t))&&e.push(a);if(this._layers[o]instanceof n.MovingTargetLayer)null!==(a=this._layers[o].getFeatureByUuid(t))&&e.push(a)}return 0===e.length?null:e[0]},getPlottingLayers:function(){var t=[],e=this._layers;for(var o in e)e[o]instanceof i.PlottingLayer&&t.push(e[o]);return t},clearPlottingLayers:function(){var t=this._layers;for(var e in t)t[e]instanceof i.PlottingLayer&&(t[e].removeAllFeatures(),this.removeLayer(t[e]))},getLayer:function(t){var e=this._layers;for(var o in e)if(e[o]._leaflet_id===t)return e[o]},getLayersByName:function(t){return this.getLayersBy("name",t)},getLayersBy:function(t,e){return this.getBy("_layers",t,e)},getBy:function(t,e,o){var i="function"==typeof o.test,l=[];for(var n in this[t])l.push(this[t][n]);return SuperMap.Array.filter(l,function(t){return t[e]===o||i&&o.test(t[e])})},latLngToLayerPoint:function(t){return this.project(L.latLng(t))._subtract(this.getPixelOrigin())}})},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.geoSymbolText1=e.GeoSymbolText1=void 0,o(0);var i=o(1),l=(o(18),e.GeoSymbolText1=i.GraphicObject.extend({space:null,offsetX:null,offsetY:null,initialize:function(t,e,o,l){this.minEditPts=1,this.maxEditPts=1,this.libID=0,this.code=SuperMap.Plot.SymbolType.SYMBOLTEXT1,this.symbolType=SuperMap.Plot.SymbolType.SYMBOLTEXT1,this.symbolName="对象标注(带指示线)",null===this.space&&(this.space=10),null===this.offsetX&&(this.offsetX=60),null===this.offsetY&&(this.offsetY=30),i.GraphicObject.prototype.initialize.call(this,t,e,o,l),this.style.sizeFixed=!1},destroy:function(){this.space=null,this.offsetX=null,this.offsetY=null,i.GraphicObject.prototype.destroy.call(this)},removeSymbolTextsFromDotSymbol:function(t){if(t&&"string"==typeof t){var e=this._map.getFeatureByUuid(t);if(e)for(var o=0,i=e.geoSymbolTexts.length;oe&&(this.symbolTexts[e]=t,this.redraw())},removeSymbolTextsFromDotSymbol:function(t){if(t&&"string"==typeof t){var e=this._map.getFeatureByUuid(t);if(e)for(var o=0,i=e.geoSymbolTexts.length;o0?(o[p].style.labelAlign="lm",!0===g&&(m.x=f.x,m.y=f.y+S/2,b.x=f.x+d,b.y=f.y-S/2)):(o[p].style.labelAlign="rm",!0===g&&(m.x=f.x,m.y=f.y+S/2,b.x=f.x-d,b.y=f.y-S/2))}var v=this._map.layerPointToLatLng(f);if(0!==o[p].offsetX||0!==o[p].offsetY){var M={};M.positionPoints=[v,y],M.style={},M.type=SuperMap.Plot.SymbolType.POLYLINESYMBOL,e.push(M)}var A=SuperMap.Util.copyAttributes(s,this.symbolTexts[p].style);if(g){var T=this._map.layerPointToLatLng(m),_=this._map.layerPointToLatLng(b),O={};O.positionPoints=[T,_],O.style=SuperMap.Util.cloneObject(A),O.type=SuperMap.Plot.SymbolType.RECTANGLESYMBOL,e.push(O),P=L.latLng((_.lat-T.lat)/2+T.lat,(T.lng-_.lng)/2+_.lng)}else P=v;var x={};x.positionPoints=P,x.type=SuperMap.Plot.SymbolType.TEXTSYMBOL,x.style=SuperMap.Util.cloneObject(A),x.textContent=o[p].textContent,g&&(x.style.labelAlign="cm"),e.push(x),this.latLngs.push(v)}}for(var w,E=0;E=g){var b=P[m];if(P[m]="\n",a++,s.weight?f=parseFloat(s.fontSize)*a+a+2*s.weight+.2*parseFloat(s.fontSize):this.style.strokeWidth&&(f=parseFloat(s.fontSize)*a+a+2*s.strokeWidth+.2*parseFloat(s.fontSize)),!(f