hi-ucs/front/plotting/iclient-plot-leaflet/iclient-plot-leaflet.min.js

11 lines
1002 KiB
Vue
Raw Normal View History

2022-06-14 09:32:49 +08:00
/*!
*
* 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<p.length;h++)p[h]=SuperMap.Plot.PlottingUtil.findPointInLine(p[0],p[h],SuperMap.Plot.PlottingUtil.distance(p[0],p[h])*u);this.latLngs=L.Util.superMapPointsToLatLngs(p)}else{for(var c=Math.sqrt(n*n+a*a)/Math.sqrt(2),g=L.Util.latLngsToSuperMapPoints(i),y=1;y<g.length;y++)g[y]=SuperMap.Plot.PlottingUtil.findPointInLine(g[0],g[y],SuperMap.Plot.PlottingUtil.distance(g[0],g[y])*c);this.latLngs=L.Util.superMapPointsToLatLngs(g)}else for(var f=0;f<i.length;f++)this.latLngs[f].lng=r.lng+(i[f].lng-s.lng)*n,this.latLngs[f].lat=r.lat+(i[f].lat-s.lat)*a}}},_getLatLng:function(t,e,o){var i=0,l=0;switch(t){case 1:i=e.getWest()+o.lng,l=e.getNorth(
/* Copyright© 2000 - 2018 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
* which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
var l=e.Point=function(){function t(e,o,i,l){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=parseFloat(e),this.y=parseFloat(o),this.tag=l||0==l?parseFloat(l):null,this.type=i||"Point",this.CLASS_NAME="SuperMapAlgoPlot"}return i(t,[{key:"clone",value:function(e){return null==e&&(e=new t(this.x,this.y)),SuperMap.Util.applyDefaults(e,this),e}},{key:"calculateBounds",value:function(){this.bounds=new Bounds(this.x,this.y,this.x,this.y)}},{key:"equals",value:function(t){var e=!1;return null!=t&&(e=this.x===t.x&&this.y===t.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(t.x)&&isNaN(t.y)),e}},{key:"move",value:function(t,e){this.x=this.x+t,this.y=this.y+e,this.clearBounds()}},{key:"toShortString",value:function(){return this.x+", "+this.y}},{key:"destroy",value:function(){this.x=null,this.y=null,this.tag=null,function t(e,o,i){null===e&&(e=Function.prototype);var l=Object.getOwnPropertyDescriptor(e,o);if(void 0===l){var n=Object.getPrototypeOf(e);return null===n?void 0:t(n,o,i)}if("value"in l)return l.value;var a=l.get;return void 0!==a?a.call(i):void 0}(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"getVertices",value:function(t){return[this]}}]),t}();SuperMapAlgoPlot.Point=l},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AddPoint_WayType=e.RouteNodePrimitives=e.Primitives=e.PlottingUtil=e.AnalysisSymbol=e.Point=void 0;var i=o(146),l=o(145),n=o(144),a=o(143),s=o(142),r=o(141);e.Point=i.Point,e.AnalysisSymbol=l.AnalysisSymbol,e.PlottingUtil=n.PlottingUtil,e.Primitives=a.Primitives,e.RouteNodePrimitives=s.RouteNodePrimitives,e.AddPoint_WayType=r.AddPoint_WayType},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var o=0;o<e.length;o++){var i=e[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,o,i){return o&&t(e.prototype,o),i&&t(e,i),e}}();var l=e.CalculateSVGGradient=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.feature=e}return i(t,[{key:"destroy",value:function(){this.feature=null}},{key:"createGradient",value:function(){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 o=this.createGradientDirection();for("LINEAR"===this.feature.style.fillGradientMode?((e=null===e?L.SVG.create("linearGradient"):e).setAttributeNS(null,"x1",o.x1),e.setAttributeNS(null,"y1",o.y1),e.setAttributeNS(null,"x2",o.x2),e.setAttributeNS(null,"y2",o.y2)):"RADIAL"===this.feature.style.fillGradientMode&&((e=null===e?L.SVG.create("radialGradient"):e).setAttributeNS(null,"cx",o.cx),e.setAttributeNS(null,"cy",o.cy),e.setAttributeNS(null,"fx",o.fx),e.setAttributeNS(null,"fy",o.fy),e.setAttributeNS(null,"r",o.r));e.hasChildNodes();)e.removeChild(e.firstChild);for(var i=0,l=o.colors.length;i<l;i++){var n=L.SVG.create("stop");n.setAttributeNS(null,"offset",o.colors[i].offset),n.setAttributeNS(null,"style","stop-color:"+SuperMap.Plot.PlottingUtil.colorRGBA(o.colors[i].color,o.colors[i].opacity)),e.appendChild(n)}return 0===e.id.length&&e.setAttributeNS(null,"id",e.tagName+"_"+this.feature.uuid),this.feature.layer._renderer._container.defs.appendChild(e),t&&this.feature.layer._renderer._container.appendChild(this.feature.layer._renderer._container.defs),e.id}},{key:"createTextureFill",value:function(t){var e=!1;this.feature.layer._renderer._container.defs||(this.feature.layer._renderer._container.defs=L.SVG.create("defs"),e=!0);var o=document.getElementById("patternFill_"+this.feature.uuid);function i(t){var e="";return 2===t.fillID?e="rotate(-45)":3===t.fillID||6===t.fillID?e="rotate(0)":4==