v-ol-map 1.11.0 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ol-map.umd.js +1 -1
- package/package.json +1 -1
package/lib/ol-map.umd.js
CHANGED
|
@@ -206,4 +206,4 @@ yyyy`,d*10],["week",d*14],["week",d*21],["month",d*31],["week",d*42],["month",d*
|
|
|
206
206
|
|
|
207
207
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
208
208
|
and limitations under the License.
|
|
209
|
-
***************************************************************************** */var _x=function(t,e){return _x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var r in n)n.hasOwnProperty(r)&&(i[r]=n[r])},_x(t,e)};function dfe(t,e){_x(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}var Hs=function(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")},Tk=function(t,e){return Object.keys(e).forEach(function(i){Hs(e[i])&&Hs(t[i])?Tk(t[i],e[i]):t[i]=e[i]}),t},xx=function(t,e){for(var i=arguments,n=[],r=2;r<arguments.length;r++)n[r-2]=i[r];return function(){for(var a=arguments,s=[],l=0;l<arguments.length;l++)s[l]=a[l];return t.apply(e,n.concat(Array.prototype.slice.call(s)))}},Ak=function(t,e){for(var i=0,n,r=t.length;i<r;i++)if(t[i].index===e.index){n=i;break}return n===void 0?t.push(e):t[n]=e,t},Ek=function(){function t(e){return e?(e^Math.random()*16>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}return t()};function Rk(t,e){t.forEach(function(i){!e[i]||(e[i]=e[i].bind(e))})}function bx(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Yg(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,button:e.pointerEvent.button,buttons:e.pointerEvent.buttons,clientX:e.pointerEvent.clientX,clientY:e.pointerEvent.clientY,zrX:e.pointerEvent.offsetX,zrY:e.pointerEvent.offsetY,movementX:e.pointerEvent.movementX,movementY:e.pointerEvent.movementY,relatedTarget:e.pointerEvent.relatedTarget,screenX:e.pointerEvent.screenX,screenY:e.pointerEvent.screenY,view:window});return i.zrX=e.pointerEvent.offsetX,i.zrY=e.pointerEvent.offsetY,i.event=i,i}function ffe(t,e){for(var i=t.split("."),n=e.split("."),r=0;r<3;r++){var a=Number(i[r]),s=Number(n[r]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}var gfe=function(t){return!t.UTF8Encoding},Ik=function(t,e,i){for(var n=[],r=[e[0],e[1]],a=r[0],s=r[1],l=0;l<t.length;l+=2){var o=t.charCodeAt(l)-64,u=t.charCodeAt(l+1)-64;o=o>>1^-(o&1),u=u>>1^-(u&1),o+=a,u+=s,a=o,s=u,n.push([o/i,u/i])}return n},vfe=function(t){if(gfe(t))return t;var e=t.UTF8Scale;e==null&&(e=1024);for(var i=t.features,n=0;n<i.length;n++)for(var r=i[n],a=r.geometry,s=[a.coordinates,a.encodeOffsets],l=s[0],o=s[1],u=0;u<l.length;u++){var h=l[u];if(a.type==="Polygon")l[u]=Ik(h,o[u],e);else if(a.type==="MultiPolygon")for(var d=0;d<h.length;d++){var c=h[d];h[d]=Ik(c,o[u][d],e)}}return t.UTF8Encoding=!1,t};function pfe(t){var e=vfe(t),i=Us.util.map(Us.util.filter(e.features,function(n){return n.geometry&&n.properties&&n.geometry.coordinates.length>0}),function(n){var r=n.properties,a=n.geometry,s=a.coordinates,l=[];return a.type==="Polygon"&&l.push(s[0]),a.type==="MultiPolygon"&&Us.util.each(s,function(o){o[0]&&l.push(o[0])}),{properties:r,type:"Feature",geometry:{type:"Polygon",coordinates:l}}});return{type:"FeatureCollection",crs:{},features:i}}var mfe=function(t,e,i){return e.center=i.dataToPoint(e.coordinates),e},yfe=function(t,e,i){return Hs(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(n,r){var a=i.dataToPoint(t.series[r].coordinates);return n.left=a[0]-parseFloat(n.width)/2,n.top=a[1]-parseFloat(n.height)/2,n})),e},_fe=function(t,e,i){return Hs(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(n,r){var a=i.dataToPoint(t.series[r].coordinates);return n.left=a[0]-parseFloat(n.width)/2,n.top=a[1]-parseFloat(n.height)/2,n})),e},xfe=Object.freeze({pie:mfe,bar:yfe,line:_fe}),wfe={forcedRerender:!1,forcedPrecomposeRerender:!1,hideOnZooming:!1,hideOnMoving:!1,hideOnRotating:!1,convertTypes:["pie","line","bar"],insertFirst:!1,stopEvent:!1,polyfillEvents:ffe(Nx,"6.1.1")<=0},bfe=function(t){dfe(e,t);function e(i,n,r){var a=this,s=Object.assign(wfe,n);return a=t.call(this,s)||this,a._options=s,a._chartOptions=i,a.set("chartOptions",i),a.$chart=null,a.$container=void 0,a._isRegistered=!1,a._initEvent=!1,a._incremental=[],a._coordinateSystem=null,a.coordinateSystemId="",a.prevVisibleState="",Rk(["redraw","onResize","onZoomEnd","onCenterChange","onDragRotateEnd","onMoveStart","onMoveEnd","mouseDown","mouseUp","onClick","mouseMove"],a),r&&a.setMap(r),a}return e.prototype.appendTo=function(i,n){n===void 0&&(n=!1),this.setMap(i,n)},e.prototype.getMap=function(){return this._map},e.prototype.setMap=function(i,n){var r=this;if(n===void 0&&(n=!1),i&&(n||i instanceof xa))this._map=i,this._map.once("postrender",function(){r.handleMapChanged()}),this._map.renderSync();else throw new Error("not ol map object")},e.prototype.getChartOptions=function(){return this.get("chartOptions")},e.prototype.setChartOptions=function(i){return i===void 0&&(i={}),this._chartOptions=i,this.set("chartOptions",i),this.clearAndRedraw(),this},e.prototype.appendData=function(i,n){return n===void 0&&(n=!0),i&&(n&&(this._incremental=Ak(this._incremental,{index:this._incremental.length,data:i.data,seriesIndex:i.seriesIndex})),this.$chart.appendData({data:i.data.copyWithin(),seriesIndex:i.seriesIndex})),this},e.prototype.clear=function(i){i||(this._incremental=[]),this.$chart&&this.$chart.clear()},e.prototype.remove=function(){this.clear(),this.$chart&&this.$chart.dispose(),this._initEvent&&this.$container&&(this.$container&&bx(this.$container),this.unBindEvent()),delete this.$chart,delete this._map},e.prototype.show=function(){this.setVisible(!0)},e.prototype.innerShow=function(){this.$container&&(this.$container.style.display=this.prevVisibleState,this.prevVisibleState="")},e.prototype.hide=function(){this.setVisible(!1)},e.prototype.innerHide=function(){this.$container&&(this.prevVisibleState=this.$container.style.display,this.$container.style.display="none")},e.prototype.isVisible=function(){return this.$container&&this.$container.style.display!=="none"},e.prototype.showLoading=function(){this.$chart&&this.$chart.showLoading()},e.prototype.hideLoading=function(){this.$chart&&this.$chart.hideLoading()},e.prototype.setZIndex=function(i){this.$container&&(typeof i=="number"&&(i=String(i)),this.$container.style.zIndex=i)},e.prototype.getZIndex=function(){return this.$container&&this.$container.style.zIndex},e.prototype.setVisible=function(i){i?(this.$container&&(this.$container.style.display=""),this._chartOptions=this.getChartOptions(),this.clearAndRedraw()):(this.$container&&(this.$container.style.display="none"),this.clear(!0),this._chartOptions={},this.clearAndRedraw())},e.prototype.render=function(){!this.$chart&&this.$container?(this.$chart=Us.init(this.$container),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1)),this.dispatchEvent({type:"load",source:this,value:this.$chart})):this.isVisible()&&this.redraw()},e.prototype.redraw=function(){this.clearAndRedraw()},e.prototype.updateViewSize=function(i){!this.$container||(this.$container.style.width=i[0]+"px",this.$container.style.height=i[1]+"px",this.$container.setAttribute("width",String(i[0])),this.$container.setAttribute("height",String(i[1])))},e.prototype.onResize=function(i){var n=this.getMap();if(n){var r=n.getSize();this.updateViewSize(r),this.clearAndRedraw(),i&&this.dispatchEvent({type:"change:size",source:this,value:r})}},e.prototype.onZoomEnd=function(){this._options.hideOnZooming&&this.innerShow();var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"zoomend",source:this,value:i.getView().getZoom()}))},e.prototype.onDragRotateEnd=function(){this._options.hideOnRotating&&this.innerShow();var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:rotation",source:this,value:i.getView().getRotation()}))},e.prototype.onMoveStart=function(){this._options.hideOnMoving&&this.innerHide();var i=this.getMap();i&&i.getView()&&this.dispatchEvent({type:"movestart",source:this,value:i.getView().getCenter()})},e.prototype.onMoveEnd=function(){this._options.hideOnMoving&&this.innerShow();var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"moveend",source:this,value:i.getView().getCenter()}))},e.prototype.onClick=function(i){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("click",i))},e.prototype.mouseDown=function(i){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("mousedown",i))},e.prototype.mouseUp=function(i){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("mouseup",i))},e.prototype.mouseMove=function(i){if(this.$chart)for(var n=i.originalEvent.target;n;){if(n.className==="ol-overlaycontainer-stopevent"){this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("mousemove",i));return}n=n.parentElement}},e.prototype.onCenterChange=function(){var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:center",source:this,value:i.getView().getCenter()}))},e.prototype.handleMapChanged=function(){var i=this.getMap();if(this._initEvent&&this.$container&&(this.$container&&bx(this.$container),this.unBindEvent()),this.$container||(this.createLayerContainer(),this.onResize(!1)),i){var n=this._options.stopEvent?i.getOverlayContainerStopEvent():i.getOverlayContainer();this._options.insertFirst?n.insertBefore(this.$container,n.childNodes[0]||null):n.appendChild(this.$container),this.render(),this.bindEvent(i)}},e.prototype.createLayerContainer=function(){this.$container=document.createElement("div"),this.$container.style.position="absolute",this.$container.style.top="0px",this.$container.style.left="0px",this.$container.style.right="0px",this.$container.style.bottom="0px",this.$container.style.pointerEvents="auto"},e.prototype.bindEvent=function(i){var n=i.getView();this._options.forcedPrecomposeRerender&&i.on("precompose",this.redraw),i.on("change:size",this.onResize),n.on("change:resolution",this.onZoomEnd),n.on("change:center",this.onCenterChange),n.on("change:rotation",this.onDragRotateEnd),i.on("movestart",this.onMoveStart),i.on("moveend",this.onMoveEnd),this._options.polyfillEvents&&(i.on("pointerdown",this.mouseDown),i.on("pointerup",this.mouseUp),i.on("pointermove",this.mouseMove),i.on("click",this.onClick)),this._initEvent=!0},e.prototype.unBindEvent=function(){var i=this.getMap();if(!!i){var n=i.getView();!n||(i.un("precompose",this.redraw),i.un("change:size",this.onResize),n.un("change:resolution",this.onZoomEnd),n.un("change:center",this.onCenterChange),n.un("change:rotation",this.onDragRotateEnd),i.un("movestart",this.onMoveStart),i.un("moveend",this.onMoveEnd),this._options.polyfillEvents&&(i.un("pointerdown",this.mouseDown),i.un("pointerup",this.mouseUp),i.un("pointermove",this.mouseMove),i.un("click",this.onClick)),this._initEvent=!1)}},e.prototype.clearAndRedraw=function(){if(!(!this.$chart||!this.isVisible())){if(this._options.forcedRerender&&this.$chart.clear(),this.$chart.resize(),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1),this._incremental&&this._incremental.length>0))for(var i=0;i<this._incremental.length;i++)this.appendData(this._incremental[i],!1);this.dispatchEvent({type:"redraw",source:this})}},e.prototype.registerMap=function(){if(this._isRegistered||(this.coordinateSystemId="openlayers_"+Ek(),Us.registerCoordinateSystem(this.coordinateSystemId,this.getCoordinateSystem(this._options)),this._isRegistered=!0),this._chartOptions){var i=this._chartOptions.series;if(i&&Hs(i)){var n=this._options.convertTypes;if(n)for(var r=i.length-1;r>=0;r--)n.indexOf(i[r].type)>-1||(i[r].coordinateSystem=this.coordinateSystemId),i[r].animation=!1}}},e.prototype.convertData=function(i){var n=i.series;if(n&&n.length>0){if(!this._coordinateSystem){var r=this.getCoordinateSystem(this._options);this._coordinateSystem=new r(this.getMap())}if(n&&Hs(n)){var a=this._options.convertTypes;if(a)for(var s=n.length-1;s>=0;s--)a.indexOf(n[s].type)>-1&&n[s]&&n[s].hasOwnProperty("coordinates")&&(n[s]=xfe[n[s].type](i,n[s],this._coordinateSystem))}}return i},e.prototype.getCoordinateSystem=function(i){var n=this.getMap(),r=this.coordinateSystemId,a=function(s){this.map=s,this._mapOffset=[0,0],this.dimensions=["lng","lat"],this.projCode=a.getProjectionCode(this.map)};return a.dimensions=a.prototype.dimensions||["lng","lat"],a.prototype.getZoom=function(){return this.map.getView().getZoom()},a.prototype.setZoom=function(s){return this.map.getView().setZoom(s)},a.prototype.getViewRectAfterRoam=function(){return this.getViewRect().clone()},a.prototype.setMapOffset=function(s){this._mapOffset=s},a.prototype.dataToPoint=function(s){var l;if(s&&Array.isArray(s)&&s.length>0){l=s.map(function(c){var f=0;return typeof c=="string"?f=Number(c):f=c,f});var o=i&&i.source||"EPSG:4326",u=i&&i.destination||this.projCode,h=this.map.getPixelFromCoordinate(Pr(l,o,u)),d=this._mapOffset;return[h[0]-d[0],h[1]-d[1]]}return[0,0]},a.prototype.pointToData=function(s){var l=this._mapOffset;return this.map.getCoordinateFromPixel([s[0]+l[0],s[1]+l[1]])},a.prototype.getViewRect=function(){var s=this.map.getSize();return new Us.graphic.BoundingRect(0,0,s[0],s[1])},a.prototype.getRoamTransform=function(){return Us.matrix.create()},a.prototype.prepareCustoms=function(){var s=this.getViewRect();return{coordSys:{type:r,x:s.x,y:s.y,width:s.width,height:s.height},api:{coord:xx(this.dataToPoint,this),size:xx(a.dataToCoordsSize,this)}}},a.create=function(s){s.eachSeries(function(l){l.get("coordinateSystem")===r&&(l.coordinateSystem=new a(n))})},a.getProjectionCode=function(s){var l="";return s?l=s.getView()&&s.getView().getProjection().getCode():l="EPSG:3857",l},a.dataToCoordsSize=function(s,l){var o=this;return l===void 0&&(l=[0,0]),[0,1].map(function(u){var h=l[u],d=[],c=[],f=s[u]/2;d[u]=h-f,c[u]=h+f,d[1-u]=l[1-u],c[1-u]=l[1-u];var g=o.dataToPoint(d)[u]-o.dataToPoint(c)[u];return Math.abs(g)},this)},a},e.prototype.dispatchEvent=function(i){return t.prototype.dispatchEvent.call(this,i)},e.prototype.set=function(i,n,r){return t.prototype.set.call(this,i,n,r)},e.prototype.get=function(i){return t.prototype.get.call(this,i)},e.prototype.unset=function(i,n){return t.prototype.unset.call(this,i,n)},e.prototype.on=function(i,n){return t.prototype.on.call(this,i,n)},e.prototype.un=function(i,n){return t.prototype.un.call(this,i,n)},e.formatGeoJSON=pfe,e.bind=xx,e.merge=Tk,e.uuid=Ek,e.bindAll=Rk,e.arrayAdd=Ak,e.removeNode=bx,e.isObject=Hs,e}(Gi);const Sfe={name:"v-echarts",extends:rr,inject:["VMap"],render(t,e){return null},props:{layerId:{type:String,default(){return`draw-layer-${He()}`}},options:{type:Object}},data(){return{layer:null}},computed:{map(){return this.VMap.map},map3d(){return this.VMap.map3d}},watch:{visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.dispose()},methods:{init(){this.layer=new bfe(this.options),this.zIndex&&this.layer.setZIndex(this.zIndex),this.layer.appendTo(this.map)},dispose(){this.layer.remove()}}};let Cfe,Tfe;const Mk={};var Lk=Oi(Sfe,Cfe,Tfe,!1,Afe,null,null,null);function Afe(t){for(let e in Mk)this[e]=Mk[e]}Lk.options.__file="src/components/layers/echarts/index.vue";const gc=function(){return Lk.exports}();gc.install=t=>{t.component(gc.name,gc)};function Efe(t,e){let i;return e.getLayers().forEach(n=>{n&&n.get("id")===t&&(i=n)}),i}const Lx=class{constructor(e,i,n,r,a,s,l,o,u){!i||i.length<1||(this.id=u.id,this.changeCarRotate=u.changeCarRotate,this.centerAtCar=u.centerAtCar,this._moving=!0,this._ismove=!1,this._map=e,this._labelShow=s,this._timeContentClass=l,this._vacuate=r,this._wholePathInfo=i,this._timeOverlayList=[],r?(this._pathInfo=n,this._convertPaths(n)):(this._pathInfo=i,this._convertPaths(i)),this._vacuatePath=n,this._path=[],this._passPath=[],this._pointIndexDistance=20,this._tracePoints=[],this._tracePointsModePlay=a,this._traceTimedivDom=e.traceTimedivDom,this._tracePointsFromTime=[],this._traceEnd=!1,this.traceLayer=new Ri({source:new Ln,zIndex:99}),this.traceLayer.set("isTrack",!0),e.addLayer(this.traceLayer),this.tracePassLayer=new Ri({source:new Ln,zIndex:100}),this.tracePassLayer.set("isTrack",!0),e.addLayer(this.tracePassLayer),this.arrowsLayer=new Ri({source:new Ln,zIndex:101}),this.arrowsLayer.set("isTrack",!0),e.addLayer(this.arrowsLayer),this.carLayer=new Ri({source:new Ln,zIndex:102}),this.carLayer.set("isTrack",!0),e.addLayer(this.carLayer),this.traceNodes=[],this.traceLineList=[],this.carMarker=null,this._carInfoWin=null,this._pointIndex=0,this._traceIndex=0,this._speedUp=1,this._intervalTraceFlag=null,this._intervalTimeFlag=null,this._opts={carIcon:{src:"",scale:1},speed:0,defaultContent:"",startIcon:{src:"",scale:1},endIcon:{src:"",scale:1},passFlag:!0,showInfoWin:!1,arrowPixel:50,tracePlay:!1},this._setOptions(u),this._initFlag=1,this._showTracePoint=o)}};let et=Lx;Zn(et,"track",Lx),et.prototype._setOptions=function(t){if(!!t)for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this._opts[e]=t[e])},et.prototype.getSpeed=function(){return this._opts.speed},et.prototype.getSpeedUp=function(){return this._speedUp},et.prototype.getPaths=function(){return this._pathInfo},et.prototype.getTraceIndex=function(){return this._pointIndex},et.prototype.setTraceIndex=function(t){this._pointIndex=t;const e=this._path[t];this.carMarker.setPosition(e)},et.prototype.getPercentnum=function(){const t=this._tracePoints,e=this.carMarker.getPosition();for(let i=0;i<t.length;i++)if(e.toString()===t[i].coordinate.toString())return parseFloat((i/t.length).toFixed(2))},et.prototype.setPercentnum=function(t){const e=this._tracePoints,i=this._tracePointsFromTime,n=Math.round(e.length*t),r=e[n].coordinate;this.carMarker.setPosition(r);for(let a=0;a<i.length;a++){const s=i[a].temBreakPointsFromTime;for(let l=0;l<s.length;l++)s[l].coordinate.toString()===r.toString()&&(this._traceIndex=l,this._pointIndex=a)}},et.prototype._showTimePopup=function(t){const e=this;e._traceTime=e._pathInfo[0].time,e._fromPause&&(e._traceTime=e._traceTimedivDom.innerText);const i=e._pathInfo[e._pathInfo.length-1].time,n=new Date(i).getTime();n>t.maxEndTime&&(t.maxEndTime=n),e._intervalTimeFlag=setInterval(function(){if(!e._traceEnd&&!e._fromPause&&!e._fromStop){if(e._traceTime=new Date(e._traceTime).getTime()+1e3*e._speedUp,t.maxEndTime<e._traceTime){e._traceEnd=!0,e._traceTimedivDom.innerText=i;return}e._traceTime%1e3===0&&(e._traceTime=Mfe(new Date(e._traceTime)),e._traceTimedivDom.innerText=e._traceTime)}},1e3)},et.prototype._setTraceTime=function(t){const e=this,i=e._tracePointsFromTime;if(e._traceTimedivDom.innerText=t,e._traceTime=t,e._opts.speed===0){let n=Number.MAX_VALUE;const r=new Date(e._traceTimedivDom.innerText).getTime();if(r>0||!isNaN(r))for(let a=0;a<i.length;a++){const s=i[a].temBreakPointsFromTime;for(let l=0;l<s.length;l++)Math.abs(r-s[l].thisTimeSecond)<n&&(n=Math.abs(r-s[l].thisTimeSecond),e._pointIndex=a,e._traceIndex=l)}e._fromStop&&(e._pointIndex=0,e._traceIndex=0),(e._traceTimedivDom.innerText===""||e._fromPause||e._fromStop)&&e._showTimePopup(e._map)}},et.prototype._convertPaths=function(t){this._path=[];for(let e=0;e<t.length;e++)this._path.push([t[e].longitude,t[e].latitude])},et.prototype.start=function(){this._moving=!0;const t=this,e=t.getTracePoints(1);t._tracePoints=e.breakPoints,t._tracePointsFromTime=e.breakPointsFromTime,!(t._path.length<1)&&(t._tracePointsModePlay==="skip"?t.tracePointsPlay():t._tracePointsModePlay==="animation"&&t.timePointsPlay())},et.prototype.tracePointsPlay=function(){const t=this,e=t._pathInfo,i=t._passPath;if(i.length===0&&t.tracePassLayer.getSource().clear(),!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop||t._pointIndex>=e.length)return;if(t._pointIndex+=t._speedUp,t._pointIndex>=e.length&&(t._pointIndex=e.length-1),t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._pointIndex===1&&i.push([e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude]),i.push([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const s=new Qt({geometry:new _i([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});s.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(s)}t._opts.showInfoWin&&(t._carInfoWin.getElement().innerText=e[t._pointIndex].info);const n=t._map.getView().calculateExtent(),r=t.carMarker.getPosition();!Ar(n,r)&&t.centerAtCar&&t._map.getView().animate({center:r})},1e3);else if(t._fromPause){if(!t._fromStop){if(t._pointIndex++,t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const n=new Qt({geometry:new _i([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});n.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(n)}t._ismove=!1}}else return;this._fromPause=!1,this._fromStop=!1},et.prototype.timePointsPlay=function(){const t=this,e=t._tracePoints,i=t._tracePointsFromTime,n=t._passPath;if(n.length===0&&t.tracePassLayer.getSource().clear(),t._opts.speed===0){let r=Number.MAX_VALUE;const a=new Date(t._traceTimedivDom.innerText).getTime();if(a>0||!isNaN(a))for(let s=0;s<i.length;s++){const l=i[s].temBreakPointsFromTime;for(let o=0;o<l.length;o++)Math.abs(a-l[o].thisTimeSecond)<r&&(r=Math.abs(a-l[o].thisTimeSecond),t._pointIndex=s,t._traceIndex=o)}t._fromStop&&(t._pointIndex=0,t._traceIndex=0),(t._traceTimedivDom.innerText===""||t._fromPause||t._fromStop)&&t._showTimePopup(t._map)}if(!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop)return;const r=t._opts.speed*1e3/3600;if(t._pointIndex>=i.length)return;const a=i[t._pointIndex].temBreakPointsFromTime,s=i[t._pointIndex].differenceTime,l=i[t._pointIndex].length;let o=0;if(r===0?o=(l/s/50).toFixed(2)*10*t._speedUp:o=(r/50).toFixed(2)*10,t._fromPause||t._fromStop||t._pointIndex>=e.length-1||t._pointIndex>=i.length)return;if(t._traceIndex+=o,t._traceIndex=Math.round(t._traceIndex),t._traceIndex>=a.length){t._traceIndex=a.length-1,t._pointIndex++;const c=a.slice(0,t._traceIndex);for(let p=0;p<c.length;p++)n.push(c[p].coordinate);if(t._opts.passFlag){const p=new Qt({geometry:new _i(n)});p.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}const f=Ok(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.carMarker.setPosition(a[t._traceIndex].coordinate),t.changeCarRotate&&t.carMarker.setRotateAngle(f);const g=t._troughPointIndex(a[t._traceIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0))),t._traceIndex=0}else{const c=a.slice(Math.round(t._traceIndex-o),t._traceIndex);for(let p=0;p<c.length;p++)n.push(c[p].coordinate);if(t._opts.passFlag){const p=new Qt({geometry:new _i(n)});p.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}t.carMarker.setPosition(a[t._traceIndex].coordinate);const f=Ok(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.changeCarRotate&&t.carMarker.setRotateAngle(f);const g=t._troughPointIndex(e[t._pointIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0)))}const u=t._map.getView().calculateExtent(),h=t.carMarker.getPosition();!Ar(u,h)&&t.centerAtCar&&t._map.getView().animate({center:h})},200);else if(t._fromPause)t._fromStop||(t._traceIndex++,t._ismove=!1);else return;this._fromPause=!1,this._fromStop=!1},et.prototype.setSpeed=function(t){this._opts.speed=t},et.prototype.setSpeedUp=function(t){this._speedUp=t},et.prototype.stop=function(){this._moving=!1,this._ismove=!1,this._pointIndex=0,this._traceIndex=0,this._fromStop=!0,this._passPath=[],this.tracePassLayer.getSource().clear(),this.carMarker.setPosition([this._pathInfo[0].longitude,this._pathInfo[0].latitude]),clearInterval(this._intervalTraceFlag),clearInterval(this._intervalTimeFlag)},et.prototype.pause=function(){this._moving=!1,this._ismove=!0,this._fromPause=!0,clearInterval(this._intervalTimeFlag)},et.prototype._addMarker=function(){const t=this;this.carMarker&&(this.carLayer.getSource().getFeatures().length>0&&this.carLayer.getSource().removeFeature(this.carMarker),clearInterval(this._intervalTraceFlag));const e=Lfe(this._path[0],this._opts);this.carLayer.getSource().addFeature(e),this.carMarker=e,e.on=function(i,n){if(i==="move"){const r=setInterval(function(){if(!t._moving)return;const a=e.getPosition(),s=t._pathInfo;for(let l=0;l<s.length;l++)a.toString()===s[l].longitude+","+s[l].latitude&&(n(l),l===s.length-1&&clearInterval(r))},200)}}},et.prototype._addInfoWin=function(){const t=this;if(!t._opts.showInfoWin)return;const e=t.carMarker.getPosition();if(t._carInfoWin){t._carInfoWin.setPosition(e);return}const i=document.createElement("div");i.className="carOverlay-class",i.innerText="";const n=new md({element:document.getElementById(t._opts.overlay.element.toString()),position:e,stopEvent:!0,offset:[10,0]});t._carInfoWin=n,t._map.addOverlay(n)},et.prototype.getArrowPoints=function(t){const e=this._pathInfo,i=[];for(let n=0;n<e.length-1;n++){const r=[e[n].longitude,e[n].latitude],a=[e[n+1].longitude,e[n+1].latitude],s=this._map.getPixelFromCoordinate(r),l=this._map.getPixelFromCoordinate(a),u=zk([s,l]),h=Math.floor(u/t),d=this.getRotationFromPixel(s,l);for(let c=1;c<h+1;c++){const f=[s[0]+t*c*Math.cos(d),s[1]+t*c*Math.sin(d)],g=this._map.getCoordinateFromPixel(f);i.push({rotate:d,coordinate:g})}}return i},et.prototype.getTracePoints=function(t){const e=this._pathInfo,i=[],n=[];for(let r=0;r<e.length-1;r++){const a=[],s=[e[r].longitude,e[r].latitude],l=[e[r+1].longitude,e[r+1].latitude],o=e[r].time,u=e[r+1].time,h=new Date(o).getTime(),d=new Date(u).getTime(),c=d-h;if(c===0)continue;const f=l6(s),g=l6(l),v=zk([f,g]),m=Math.floor(v/t),y=this.getRotationFromPixel(f,g),_=this.getAngleFromPixel(f,g);for(let w=0;w<m+1;w++){const b=[f[0]+w*t*Math.cos(y),f[1]+w*t*Math.sin(y)],C=GF(b),x=h+Math.round(c/m)*w;i.push({rotate:_,coordinate:C,thisTimeSecond:x}),a.push({rotate:_,coordinate:C,thisTimeSecond:x})}v%t!==0&&(i.push({rotate:_,coordinate:l,thisTimeSecond:d}),a.push({rotate:_,coordinate:l,thisTimeSecond:d})),n.push({length:v,differenceTime:c/1e3,initTime:o,targetTime:u,temBreakPointsFromTime:a})}return{breakPoints:i,breakPointsFromTime:n}},et.prototype.getRotationFromPixel=function(t,e){if(!t)return!1;t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),r=Math.sqrt(i*i+n*n),a=Math.asin(n/r);let s=0;return e.y<t.y&&e.x===t.x?s=Math.PI*2/3:e.y>t.y&&e.x===t.x?s=Math.PI/2:e.y===t.y&&e.x<t.x?s=Math.PI:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=a:e.y>t.y&&e.x<t.x?s=Math.PI-a:e.y<t.y&&e.x<t.x?s=Math.PI+a:e.y<t.y&&e.x>t.x&&(s=Math.PI*2-a),s},et.prototype.getAngleFromPixel=function(t,e){t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),r=Math.sqrt(i*i+n*n),a=Math.round(Math.asin(n/r)/Math.PI*180);let s=0;return e.y<t.y&&e.x===t.x?s=270:e.y>t.y&&e.x===t.x?s=90:e.y===t.y&&e.x<t.x?s=180:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=360-a:e.y>t.y&&e.x<t.x?s=180+a:e.y<t.y&&e.x<t.x?s=180-a:e.y<t.y&&e.x>t.x&&(s=a),s},et.prototype._troughPointIndex=function(t){const e=this._pointIndexDistance,i=this._path;for(let n=0;n<i.length;n++){const r=i[n];if(Ac(r,t)<e)return n}return-1},et.prototype._traceLineSytle=function(t){const e=this._opts,i=e.lineWidth?e.lineWidth:5,n=e.lineColor?e.lineColor:"blue";return{route:new _t({stroke:new Tt({width:i,color:n})}),node:new _t({image:new Hi({radius:5,stroke:new Tt({color:"white",width:0}),fill:new ot({color:"green"})})}),start:new _t({image:new an(this._opts.startIcon),text:new Pn({font:"13px Microsoft Yahei",fill:new ot({color:"#aa3300"}),stroke:new Tt({color:"#fff",width:2}),textAlign:"left"})}),end:new _t({image:new an(this._opts.endIcon),text:new Pn({font:"13px Microsoft Yahei",fill:new ot({color:"#aa3300"}),stroke:new Tt({color:"#fff",width:2}),textAlign:"left"})})}[t]},et.prototype._initLinesAndMarkers=function(){const t=this,e=t._pathInfo,i=t._wholePathInfo;if(t._convertPaths(e),t._initFlag===1){t.traceNodes=[];for(const n in i){const r=Number(n),a=[i[r].longitude,i[r].latitude],s=i[r].id;if(r>0&&r<i.length-1){const l=new Qt({geometry:new Ht(a)});l.set("id",s),l.set("number",parseInt(r)+1),t._showTracePoint&&t.traceNodes.push(l),l.set("type","node"),l.on("mouseover",function(o){t._map.getInfoWindowById(o.coordinate.toString())&&t._map.getInfoWindowById(o.coordinate.toString()).setPosition(o.coordinate)}),l.on("mouseout",function(o){t._map.getInfoWindowById(this.getPosition().toString())&&t._map.getInfoWindowById(this.getPosition().toString()).setPosition(void 0)})}else if(r===0){const l=new Qt({geometry:new Ht([i[r].longitude,i[r].latitude])});l.set("type","start"),l.set("id",s),l.set("number",parseInt(r)+1),t.traceNodes.push(l)}else if(r===i.length-1){const l=new Qt({geometry:new Ht([i[r].longitude,i[r].latitude+1e-8])});l.set("type","end"),l.set("id",s),l.set("number",parseInt(r)+1),t.traceNodes.push(l)}}for(let n=0;n<t._pathInfo.length-1;n++){const r=[t._pathInfo[n].longitude,t._pathInfo[n].latitude],a=[t._pathInfo[n+1].longitude,t._pathInfo[n+1].latitude],s=new Qt({geometry:new _i([r,a])});s.setStyle(t._traceLineSytle("route")),t.traceLayer.getSource().addFeature(s),t.traceLineList.push(s)}for(let n=0;n<t.traceNodes.length;n++){const r=t.traceNodes[n],a=t._traceLineSytle(r.get("type"));if(r.setStyle(a),r.getGeometry().getType()==="Point")for(let s=0;s<e.length;s++)r.get("id")===e[s].id&&t.traceLayer.getSource().addFeature(r)}}},et.prototype.setTraceLineColor=function(t){const e=this;e._opts.lineColor=t;const i=e.traceLineList;for(let n=0;n<i.length;n++)i[n].setStrokeColor(t);e.traceLayer.refresh()},et.prototype.setTraceLineWidth=function(t){const e=this;e._opts.lineWidth=t;const i=e.traceLineList;for(let n=0;n<i.length;n++)i[n].setStrokeWeight(t);e.traceLayer.refresh()},et.prototype._creatTimeOverlays=function(){const t=this,e=t._wholePathInfo,i=t._vacuatePath;if(t._timeOverlayList=[],t._labelShow){const n=[];for(let r=0;r<e.length;r++)for(let a=0;a<i.length;a++)if(i[a].longitude===e[r].longitude&&i[a].latitude===e[r].latitude){const s=[e[r].longitude,e[r].latitude];n.push({position:s,text:e[r].time})}typeof t.textLayer=="undefined"?(t.textLayer=Pfe(t._map,n,10),t.textLayer.set("id","lushuText"+new Date().getTime()),t._map.addLayer(t.textLayer)):typeof Efe(t.textLayer.get("id"),t._map)=="undefined"&&t._map.addLayer(t.textLayer)}},et.prototype.createArrows=function(){const t=this,e=t.getArrowPoints(t._opts.arrowPixel);for(let i=0;i<e.length;i++){const n=e[i].coordinate,r=e[i].rotate,a=new Qt({geometry:new Ht(n)});a.setStyle(new _t({image:new an({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABfUlEQVQ4T3WTTSvFYRDFf8dLKIqytFckthTpJkQWlyhF2fgEVr6BheytpChEsqB08xbZWPgOJAs7ieRlNMzV//75P7vnmZkz58ycR2ZWD7QBF5KM1DGzTuBO0k065neZ2S3QBGwAU5I+iolmNgrsAI9An6SrNIgDnAE9EdgFJiS9+93MuoEToBx4AgYkXSZBHKAWOAS6IrAP5CW9BUge2AIqgJdg8guiSKoBDoDeDJBhwNlVBsiQpNPvGST0VgF7TjPeCsCIpNdo0g84O2fibx4r/AJEUjVwlJDjXbybU/eZjAGbMROXmC8BiKQ64BxoDyYLkuYTTCeB9WD/9B9AA3AMdGQAzALLAfCcluDF3r01itMS5oDFiP3MIUHNi90T7ko/XjyYGOIMsFJSXByimTVGQbFzegOuew0o+7PGKL4AmjM8MA2shua/RjIzX1suw8pucZfiUjOt/AC4BHfaeOoz+d63oziX9Zla3CzAkqTP9G8zM4/dS7r+7zt/Aaattn1kX8VgAAAAAElFTkSuQmCC",rotation:r,scale:.5})})),t.arrowsLayer.getSource().addFeature(a)}},et.prototype.windowAddMouseWheel=function(){const t=this,e=function(i){i=i||window.event,i.wheelDelta?(i.wheelDelta>0&&t.arrowsLayer.getSource().clear(),i.wheelDelta<0&&t.arrowsLayer.getSource().clear()):i.detail&&(i.detail>0&&t.arrowsLayer.getSource().clear(),i.detail<0&&t.arrowsLayer.getSource().clear())};document.addEventListener&&document.addEventListener("DOMMouseScroll",e,!1),window.onmousewheel=document.onmousewheel=e},et.prototype.dispose=function(){this._intervalTimeFlag&&(clearInterval(this._intervalTimeFlag),this._intervalTimeFlag=null),this._intervalTraceFlag&&(clearInterval(this._intervalTraceFlag),this._intervalTraceFlag=null);const e=this._map.getLayers().getArray().filter(i=>i.get("isTrack")&&i.get("isTrack")===!0);e&&e.length>0&&e.forEach(i=>{i.getSource().clear(),this._map.removeLayer(i)})};function Sx(t,e,i,n,r){n==="distance"?Pk(t,e,i,r):n==="track"&&Rfe(t,e,i,r)}function Pk(t,e,i,n){const r=[];e.forEach(function(s,l){r.push(s)});let a=!0;for(let s=0;s<r.length-1;s++)if(Kg(t,r[s],r[s+1])<i&&r.length>=3){a=!1,s+1<r.length-1||s===0?r.splice(s+1,1):r.splice(s,1);break}a?n(e):Pk(t,r,i,n)}function Rfe(t,e,i,n){const r=e;r.forEach(function(l,o){l.id=o});const a=Cx(t,r,[],0,r.length-1,i);a.push(r[0]),r.length>1&&a.push(r[r.length-1]);const s=a.sort(function(l,o){return l.id<o.id?-1:l.id>o.id?1:0});n(s)}const Cx=function(t,e,i,n,r,a){if(n<r){let s=0,l=0;const o=e[n],u=e[r];for(let h=n+1;h<r;h++){const d=Ife(t,o,u,e[h]);d>s&&(s=d,l=h)}s>=a&&(i.push(e[l]),Cx(t,e,i,n,l,a),Cx(t,e,i,l,r,a))}return i},Ife=function(t,e,i,n){const r=Math.abs(Kg(t,e,i)),a=Math.abs(Kg(t,e,n)),s=Math.abs(Kg(t,i,n)),l=(r+a+s)/2;return Math.sqrt(Math.abs(l*(l-r)*(l-a)*(l-s)))*2/r},Kg=function(t,e,i){const n=e.latitude,r=i.latitude,a=e.longitude,s=i.longitude,l=t.getPixelFromCoordinate([a,n]),o=t.getPixelFromCoordinate([s,r]);return Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2))};var zk=function(t){let e=0;for(let i=0,n=t.length-1;i<n;++i)t[i+1]&&(e+=Math.sqrt(Math.pow(t[i+1][0]-t[i][0],2)+Math.pow(t[i+1][1]-t[i][1],2)));return e};function Mfe(t){let e=t.getHours(),i=t.getMinutes(),n=t.getSeconds();const r=t.getFullYear();let a=t.getMonth(),s=t.getDate();return e<10&&(e="0"+e),i<10&&(i="0"+i),n<10&&(n="0"+n),a=a+1,a<10&&(a="0"+a),s<10&&(s="0"+s),r+"-"+a+"-"+s+" "+e+":"+i+":"+n}function Lfe(t,e){const i=new Qt({geometry:new Ht(t)});return i.setStyle(new _t({image:new an(e.carIcon)})),i}function Pfe(t,e,i){const n=[],r=new Ri({source:new Ln});return t.getView().getZoom()>=i&&Dk(t,e,i,n,r),t.on("moveend",function(a){t.getView().getZoom()>=i?Dk(t,e,i,n,r):r.getSource().clear()}),r}function Dk(t,e,i,n,r){n=[],r.getSource().clear();for(let h=0;h<e.length;h++){const d=e[h],c=t.getPixelFromCoordinate(d.position);if(!Ar(t.getView().calculateExtent(),d.position))continue;const f=/[\u4e00-\u9fa5]/g,g=d.text.match(f)?d.text.match(f).length:0,p=d.text.length-g,v=g*15+p*8,m=c[0]+10,y=c[0]+v+20,_=c[1]-32,w=c[1]-12,b=[m,parseInt((_+w)/2)],C={x:m,y:_},x={x:y,y:w},S=c[0]-v-20,T=c[0]-10,E=c[1]-32,A=c[1]-12,R=[T,parseInt((E+A)/2)],I={x:S,y:E},L={x:T,y:A},M=c[0]-v-20,P=c[0]-10,O=c[1]+12,F=c[1]+32,q=[P,parseInt((O+F)/2)],j={x:M,y:O},z={x:P,y:F},D=c[0]+10,k=c[0]+v+20,N=c[1]+12,G=c[1]+32,B=[D,parseInt((N+G)/2)],V={x:D,y:N},U={x:k,y:G},H=new vc(C,x),Y=new vc(I,L),K=new vc(j,z),J=new vc(V,U);let Q="rightTop",te=!0;for(let ne=0;ne<4;ne++){for(let ae=0;ae<n.length;ae++){const de=n[ae];if(ne===0){if(te=de.intersects(H),!te)break}else if(ne===1){if(te=de.intersects(Y),!te)break}else if(ne===2){if(te=de.intersects(K),!te)break}else if(ne===3&&(te=de.intersects(J),!te))break}if(te){ne===0?Q="rightTop":ne===1?Q="leftTop":ne===2?Q="leftBom":ne===3&&(Q="rightBom");break}}var a,s,l,o,u;if(te)Q==="rightTop"?(n.push(H),u=b,a=m,s=_,l=y,o=w):Q==="leftTop"?(n.push(Y),u=R,a=S,s=E,l=T,o=A):Q==="rightBom"?(n.push(J),u=B,a=D,s=N,l=k,o=G):Q==="leftBom"&&(n.push(K),u=q,a=M,s=O,l=P,o=F);else continue;const ie=t.getCoordinateFromPixel([a,s]),se=t.getCoordinateFromPixel([l,s]),me=t.getCoordinateFromPixel([l,o]),le=t.getCoordinateFromPixel([a,o]),pe=new Qt({geometry:new vn([ie,se,me,le])});r.getSource().addFeature(pe),u=t.getCoordinateFromPixel(u);const be=new Qt({geometry:new _i([d.position,u])});r.getSource().addFeature(be),r.setStyle(new _t({fill:new ot({color:"rgb(26,58,91)"}),stroke:new Tt({color:"rgb(26,58,91)"}),text:new Pn({font:"16px sans-serif",text:d.text,fill:new ot({color:"#000"}),offsetX:0,offsetY:1})}))}}function vc(t,e){this.min=t,this.max=e}vc.prototype.intersects=function(t){const e=this.min,i=this.max,n=t.min,r=t.max;return r.x<=e.x||n.x>=i.x||r.y<=e.y||n.y>=i.y};function Ok(t,e){const i=Md(t),n=Md(e);return E7(i,n)}const zfe=function(t){let{map:e,paths:i,id:n,opts:r,vacuate:a,smokeMode:s,tracePointsModePlay:l,vacuateDistance:o,labelShow:u,labelStyle:h,showTracePoint:d}=t;r.id=n||He(),r.changeCarRotate=t.changeCarRotate,r.centerAtCar=t.centerAtCar;let c=i,f,g=e.getView().getZoom();return a?Sx(e,i,o,s,function(p){c=p,f=new et(e,i,c,a,l,u,h,d,r),f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows()}):(f=new et(e,i,c,a,l,u,h,d,r),f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows()),f.setPaths=function(p){i=p,f.arrowsLayer.getSource().clear();for(let v=0;v<f._timeOverlayList.length;v++)e.removeOverlay(f._timeOverlayList[v]);f.traceLayer.getSource().clear(),f.tracePassLayer.getSource().clear(),f.stop(),g=e.getView().getZoom(),a?Sx(e,i,o,s,function(v){c=v,f._pathInfo=c,f._vacuatePath=c,f._wholePathInfo=i,f._initFlag=1,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows()}):(f._pathInfo=i,f._vacuatePath=i,f._wholePathInfo=i,f._initFlag=1,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows())},f.clearPaths=function(){f._path=[],i=[],f.arrowsLayer.getSource().clear(),f.tracePassLayer.getSource().clear();for(let p=0;p<f._timeOverlayList.length;p++)e.removeOverlay(f._timeOverlayList[p]);f.traceLayer.getSource().clear(),this.carLayer.getFeatures().length>0&&this.carLayer.removeFeature(this.carMarker),typeof this.textLayer!="undefined"&&e.removeLayer(this.textLayer)},e.getView().on("change:resolution",function(){if(i.length!==0&&(g=e.getView().getZoom(),f.arrowsLayer.getSource().clear(),Math.round(g)===g))if(f._initFlag=2,f.createArrows(),a)Sx(e,i,o,s,function(p){c=p;for(let v=0;v<f._timeOverlayList.length;v++)e.removeOverlay(f._timeOverlayList[v]);f._pathInfo=c,f._vacuatePath=c,f._wholePathInfo=i,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.arrowsLayer.getSource().clear(),f.createArrows()});else{for(let p=0;p<f._timeOverlayList.length;p++)e.removeOverlay(f._timeOverlayList[p]);f._pathInfo=c,f._vacuatePath=c,f._wholePathInfo=i,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.arrowsLayer.getSource().clear(),f.createArrows()}}),f},Dfe={name:"v-track",render(t,e){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${He()}`}},paths:{type:Array,default(){return[]}},tracePointsModePlay:{type:String,default:"animation"},smokeMode:{type:String,default:"distance"},vacuate:{type:Boolean,default:!1},vacuateDistance:{type:[Number,void 0],default:10},labelShow:{type:Boolean,default:!1},showTracePoint:{type:Boolean,default:!0},changeCarRotate:{type:Boolean,default:!1},centerAtCar:{type:Boolean,default:!1},options:{type:Object,default(){return{}}},autoPlay:{type:Boolean,default:!1},labelStyle:{type:String,default:"timeContentClass"}},data(){return{track:null}},computed:{map(){return this.VMap.map}},watch:{paths:{handler(t){this.init(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.track.dispose(),this.track=null},methods:{init(t){if(t&&t.length>0||this.paths&&this.paths.length>0){const e=Qe(Oe({},this.$props),{map:this.map,paths:t||this.paths,opts:this.options});this.track=zfe(e),this.$emit("onLoad",this.track),this.autoPlay&&this.start()}},start(){this.track.start()},pause(){this.track.pause()},stop(){this.track.stop()},dispose(){this.track.dispose()}}};let Ofe,kfe;const kk={};var Fk=Oi(Dfe,Ofe,kfe,!1,Ffe,null,null,null);function Ffe(t){for(let e in kk)this[e]=kk[e]}Fk.options.__file="src/components/track/index.vue";const pc=function(){return Fk.exports}();pc.install=t=>{t.component(pc.name,pc)};const Nk=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Tx=1,mc=8;class Ax{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=n>>4;if(r!==Tx)throw new Error(`Got v${r} data when expected v${Tx}.`);const a=Nk[n&15];if(!a)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new Ax(l,s,a,e)}constructor(e,i=64,n=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const a=Nk.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-l%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,mc,e),this.coords=new this.ArrayType(this.data,mc+l+o,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(mc+s+l+o),this.ids=new this.IndexArrayType(this.data,mc,e),this.coords=new this.ArrayType(this.data,mc+l+o,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Tx<<4)+a]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ex(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:s,nodeSize:l}=this,o=[0,a.length-1,0],u=[];for(;o.length;){const h=o.pop()||0,d=o.pop()||0,c=o.pop()||0;if(d-c<=l){for(let v=c;v<=d;v++){const m=s[2*v],y=s[2*v+1];m>=e&&m<=n&&y>=i&&y<=r&&u.push(a[v])}continue}const f=c+d>>1,g=s[2*f],p=s[2*f+1];g>=e&&g<=n&&p>=i&&p<=r&&u.push(a[f]),(h===0?e<=g:i<=p)&&(o.push(c),o.push(f-1),o.push(1-h)),(h===0?n>=g:r>=p)&&(o.push(f+1),o.push(d),o.push(1-h))}return u}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:a,nodeSize:s}=this,l=[0,r.length-1,0],o=[],u=n*n;for(;l.length;){const h=l.pop()||0,d=l.pop()||0,c=l.pop()||0;if(d-c<=s){for(let v=c;v<=d;v++)qk(a[2*v],a[2*v+1],e,i)<=u&&o.push(r[v]);continue}const f=c+d>>1,g=a[2*f],p=a[2*f+1];qk(g,p,e,i)<=u&&o.push(r[f]),(h===0?e-n<=g:i-n<=p)&&(l.push(c),l.push(f-1),l.push(1-h)),(h===0?e+n>=g:i+n>=p)&&(l.push(f+1),l.push(d),l.push(1-h))}return o}}function Ex(t,e,i,n,r,a){if(r-n<=i)return;const s=n+r>>1;jk(t,e,s,n,r,a),Ex(t,e,i,n,s-1,1-a),Ex(t,e,i,s+1,r,1-a)}function jk(t,e,i,n,r,a){for(;r>n;){if(r-n>600){const u=r-n+1,h=i-n+1,d=Math.log(u),c=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*c*(u-c)/u)*(h-u/2<0?-1:1),g=Math.max(n,Math.floor(i-h*c/u+f)),p=Math.min(r,Math.floor(i+(u-h)*c/u+f));jk(t,e,i,g,p,a)}const s=e[2*i+a];let l=n,o=r;for(yc(t,e,n,i),e[2*r+a]>s&&yc(t,e,n,r);l<o;){for(yc(t,e,l,o),l++,o--;e[2*l+a]<s;)l++;for(;e[2*o+a]>s;)o--}e[2*n+a]===s?yc(t,e,n,o):(o++,yc(t,e,o,r)),o<=i&&(n=o+1),i<=o&&(r=o-1)}}function yc(t,e,i,n){Rx(t,i,n),Rx(e,2*i,2*n),Rx(e,2*i+1,2*n+1)}function Rx(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function qk(t,e,i,n){const r=t-i,a=e-n;return r*r+a*a}const Nfe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Bk=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),$s=2,Xa=3,Ix=4,Ya=5,Gk=6;class jfe{constructor(e){this.options=Object.assign(Object.create(Nfe),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:i,minZoom:n,maxZoom:r}=this.options,a=`prepare ${e.length} points`;this.points=e;const s=[];for(let o=0;o<e.length;o++){const u=e[o];if(!u.geometry)continue;const[h,d]=u.geometry.coordinates,c=Bk(Jg(h)),f=Bk(Qg(d));s.push(c,f,1/0,o,-1,1),this.options.reduce&&s.push(0)}let l=this.trees[r+1]=this._createTree(s);for(let o=r;o>=n;o--){const u=+Date.now();l=this.trees[o]=this._createTree(this._cluster(l,o))}return this}getClusters(e,i){let n=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let a=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,a=180;else if(n>a){const d=this.getClusters([n,r,180,s],i),c=this.getClusters([-180,r,a,s],i);return d.concat(c)}const l=this.trees[this._limitZoom(i)],o=l.range(Jg(n),Qg(s),Jg(a),Qg(r)),u=l.data,h=[];for(const d of o){const c=this.stride*d;h.push(u[c+Ya]>1?Vk(u,c,this.clusterProps):this.points[u[c+Xa]])}return h}getChildren(e){const i=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",a=this.trees[n];if(!a)throw new Error(r);const s=a.data;if(i*this.stride>=s.length)throw new Error(r);const l=this.options.radius/(this.options.extent*Math.pow(2,n-1)),o=s[i*this.stride],u=s[i*this.stride+1],h=a.within(o,u,l),d=[];for(const c of h){const f=c*this.stride;s[f+Ix]===e&&d.push(s[f+Ya]>1?Vk(s,f,this.clusterProps):this.points[s[f+Xa]])}if(d.length===0)throw new Error(r);return d}getLeaves(e,i,n){i=i||10,n=n||0;const r=[];return this._appendLeaves(r,e,i,n,0),r}getTile(e,i,n){const r=this.trees[this._limitZoom(e)],a=Math.pow(2,e),{extent:s,radius:l}=this.options,o=l/s,u=(n-o)/a,h=(n+1+o)/a,d={features:[]};return this._addTileFeatures(r.range((i-o)/a,u,(i+1+o)/a,h),r.data,i,n,a,d),i===0&&this._addTileFeatures(r.range(1-o/a,u,1,h),r.data,a,n,a,d),i===a-1&&this._addTileFeatures(r.range(0,u,o/a,h),r.data,-1,n,a,d),d.features.length?d:null}getClusterExpansionZoom(e){let i=this._getOriginZoom(e)-1;for(;i<=this.options.maxZoom;){const n=this.getChildren(e);if(i++,n.length!==1)break;e=n[0].properties.cluster_id}return i}_appendLeaves(e,i,n,r,a){const s=this.getChildren(i);for(const l of s){const o=l.properties;if(o&&o.cluster?a+o.point_count<=r?a+=o.point_count:a=this._appendLeaves(e,o.cluster_id,n,r,a):a<r?a++:e.push(l),e.length===n)break}return a}_createTree(e){const i=new Ax(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)i.add(e[n],e[n+1]);return i.finish(),i.data=e,i}_addTileFeatures(e,i,n,r,a,s){for(const l of e){const o=l*this.stride,u=i[o+Ya]>1;let h,d,c;if(u)h=Uk(i,o,this.clusterProps),d=i[o],c=i[o+1];else{const p=this.points[i[o+Xa]];h=p.properties;const[v,m]=p.geometry.coordinates;d=Jg(v),c=Qg(m)}const f={type:1,geometry:[[Math.round(this.options.extent*(d*a-n)),Math.round(this.options.extent*(c*a-r))]],tags:h};let g;u||this.options.generateId?g=i[o+Xa]:g=this.points[i[o+Xa]].id,g!==void 0&&(f.id=g),s.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,i){const{radius:n,extent:r,reduce:a,minPoints:s}=this.options,l=n/(r*Math.pow(2,i)),o=e.data,u=[],h=this.stride;for(let d=0;d<o.length;d+=h){if(o[d+$s]<=i)continue;o[d+$s]=i;const c=o[d],f=o[d+1],g=e.within(o[d],o[d+1],l),p=o[d+Ya];let v=p;for(const m of g){const y=m*h;o[y+$s]>i&&(v+=o[y+Ya])}if(v>p&&v>=s){let m=c*p,y=f*p,_,w=-1;const b=((d/h|0)<<5)+(i+1)+this.points.length;for(const C of g){const x=C*h;if(o[x+$s]<=i)continue;o[x+$s]=i;const S=o[x+Ya];m+=o[x]*S,y+=o[x+1]*S,o[x+Ix]=b,a&&(_||(_=this._map(o,d,!0),w=this.clusterProps.length,this.clusterProps.push(_)),a(_,this._map(o,x)))}o[d+Ix]=b,u.push(m/v,y/v,1/0,b,-1,v),a&&u.push(w)}else{for(let m=0;m<h;m++)u.push(o[d+m]);if(v>1)for(const m of g){const y=m*h;if(!(o[y+$s]<=i)){o[y+$s]=i;for(let _=0;_<h;_++)u.push(o[y+_])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,i,n){if(e[i+Ya]>1){const s=this.clusterProps[e[i+Gk]];return n?Object.assign({},s):s}const r=this.points[e[i+Xa]].properties,a=this.options.map(r);return n&&a===r?Object.assign({},a):a}}function Vk(t,e,i){return{type:"Feature",id:t[e+Xa],properties:Uk(t,e,i),geometry:{type:"Point",coordinates:[qfe(t[e]),Bfe(t[e+1])]}}}function Uk(t,e,i){const n=t[e+Ya],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,a=t[e+Gk],s=a===-1?{}:Object.assign({},i[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+Xa],point_count:n,point_count_abbreviated:r})}function Jg(t){return t/360+.5}function Qg(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function qfe(t){return(t-.5)*360}function Bfe(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var Hk=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t._t("default")],2)},Gfe=[];Hk._withStripped=!0;const Vfe={name:"v-super-cluster",extends:rr,inject:["VMap"],props:{layerId:{type:String,default(){return`cluster-layer-${He()}`}},features:{type:Array,default(){return[]}},FeatureStyle:{type:[Array,void 0],default(){}},cluster:{type:Object},overlay:{type:Object}},data(){return{layer:null,clusters:null,featureChildren:[],featureCluster:!1,total:0}},computed:{map(){return this.VMap.map}},watch:{features:{handler(){this.dispose(),this.init()},immediate:!1,deep:!0},visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.dispose()},methods:{getGeoFeatures(){return this.features.map(t=>({type:"Feature",geometry:{type:"Point",coordinates:t.coordinates},properties:t}))},styleFunction(t,e){const i=e.get("cluster")||0,n=e.get("point_count_abbreviated")||0;let r=t[n];if(i){if(!r){let a={};a={image:new Hi({radius:4,fill:new ot({color:"blue"})}),text:new Pn({font:"16px sans-serif",text:n.toString()})},Je(this.cluster,"style")?(r=Ot(this.cluster.style),r.getText().setText(n.toString())):r=new _t(a),t[n]=r}}else{const a=e.get("style");r=Ot(a)}return r},init(){this.clusters=new jfe(this.cluster),this.clusters.load(this.getGeoFeatures()),this.total=this.clusters.points.length;const t=this.map.getView().calculateExtent(this.map.getSize()),e=this.clusters.getClusters(t,this.map.getView().getZoom()),i={type:"FeatureCollection",features:e},n={};this.layer=new Ri(Qe(Oe({},this.$props),{source:new Ln({features:new Ow().readFeatures(i).map(r=>{const a=r.get("properties");if(a&&typeof a=="object")for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&r.set(s,a[s]);return r})}),style:r=>this.styleFunction(n,r)})),this.layer.set("cluster",!0),this.layer.set("id",this.layerId),this.layer.set("type","vector"),this.layer.set("users",!0),this.zIndex&&this.layer.setZIndex(this.zIndex),this.map.addLayer(this.layer),this.map.on("postrender",r=>{const a=this.clusters.getClusters(t,this.map.getView().getZoom()),s={type:"FeatureCollection",features:a};this.layer.getSource().clear(),this.layer.getSource().addFeatures(new Ow().readFeatures(s).map(l=>{const o=l.get("properties");if(o&&typeof o=="object")for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&l.set(u,o[u]);return l}))}),this.map.on("singleclick",r=>this.eventHandler("singleclick",r))},getFeatureAtPixel(t){return this.map.forEachSmFeatureAtPixel(t,(e,i)=>{if(i.get("id")===this.layer.get("id"))return e},{})},eventHandler(t,e){const{pixel:i}=e,n=this.getFeatureAtPixel(i);this.$emit(t,e,n)},getLeaves(t,e){return this.clusters.getLeaves(t,e)},dispose(){this.layer.getSource().clear(),this.map.removeLayer(this.layer)}}},$k={};var Wk=Oi(Vfe,Hk,Gfe,!1,Ufe,null,null,null);function Ufe(t){for(let e in $k)this[e]=$k[e]}Wk.options.__file="src/components/layers/cluster/index.vue";const _c=function(){return Wk.exports}();_c.install=t=>{t.component(_c.name,_c)};const Zk=[Bu,Gu,Vu,jo,Hu,$u,Ku,Ju,Qu,eh,th,pc,gc,_c],Mx=function(t){Mx.installed||Zk.forEach(e=>{t.component(e.name,e)})};typeof window!="undefined"&&window.Vue&&Mx(window.Vue);const Hfe=Oe({install:Mx},Zk);ht.VDraw=eh,ht.VEcharts=gc,ht.VGraphic=Qu,ht.VHeatmap=Ju,ht.VImage=$u,ht.VMap=Bu,ht.VMeasure=th,ht.VOverlay=Vu,ht.VOverview=Gu,ht.VRoute=Ku,ht.VSuperCluster=_c,ht.VTile=jo,ht.VTrack=pc,ht.VVector=Hu,ht.default=Hfe,Object.defineProperties(ht,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
209
|
+
***************************************************************************** */var _x=function(t,e){return _x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var r in n)n.hasOwnProperty(r)&&(i[r]=n[r])},_x(t,e)};function dfe(t,e){_x(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}var Hs=function(t){var e=typeof t;return t!==null&&(e==="object"||e==="function")},Tk=function(t,e){return Object.keys(e).forEach(function(i){Hs(e[i])&&Hs(t[i])?Tk(t[i],e[i]):t[i]=e[i]}),t},xx=function(t,e){for(var i=arguments,n=[],r=2;r<arguments.length;r++)n[r-2]=i[r];return function(){for(var a=arguments,s=[],l=0;l<arguments.length;l++)s[l]=a[l];return t.apply(e,n.concat(Array.prototype.slice.call(s)))}},Ak=function(t,e){for(var i=0,n,r=t.length;i<r;i++)if(t[i].index===e.index){n=i;break}return n===void 0?t.push(e):t[n]=e,t},Ek=function(){function t(e){return e?(e^Math.random()*16>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}return t()};function Rk(t,e){t.forEach(function(i){!e[i]||(e[i]=e[i].bind(e))})}function bx(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Yg(t,e){var i=new MouseEvent(t,{bubbles:!0,cancelable:!0,button:e.pointerEvent.button,buttons:e.pointerEvent.buttons,clientX:e.pointerEvent.clientX,clientY:e.pointerEvent.clientY,zrX:e.pointerEvent.offsetX,zrY:e.pointerEvent.offsetY,movementX:e.pointerEvent.movementX,movementY:e.pointerEvent.movementY,relatedTarget:e.pointerEvent.relatedTarget,screenX:e.pointerEvent.screenX,screenY:e.pointerEvent.screenY,view:window});return i.zrX=e.pointerEvent.offsetX,i.zrY=e.pointerEvent.offsetY,i.event=i,i}function ffe(t,e){for(var i=t.split("."),n=e.split("."),r=0;r<3;r++){var a=Number(i[r]),s=Number(n[r]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0}var gfe=function(t){return!t.UTF8Encoding},Ik=function(t,e,i){for(var n=[],r=[e[0],e[1]],a=r[0],s=r[1],l=0;l<t.length;l+=2){var o=t.charCodeAt(l)-64,u=t.charCodeAt(l+1)-64;o=o>>1^-(o&1),u=u>>1^-(u&1),o+=a,u+=s,a=o,s=u,n.push([o/i,u/i])}return n},vfe=function(t){if(gfe(t))return t;var e=t.UTF8Scale;e==null&&(e=1024);for(var i=t.features,n=0;n<i.length;n++)for(var r=i[n],a=r.geometry,s=[a.coordinates,a.encodeOffsets],l=s[0],o=s[1],u=0;u<l.length;u++){var h=l[u];if(a.type==="Polygon")l[u]=Ik(h,o[u],e);else if(a.type==="MultiPolygon")for(var d=0;d<h.length;d++){var c=h[d];h[d]=Ik(c,o[u][d],e)}}return t.UTF8Encoding=!1,t};function pfe(t){var e=vfe(t),i=Us.util.map(Us.util.filter(e.features,function(n){return n.geometry&&n.properties&&n.geometry.coordinates.length>0}),function(n){var r=n.properties,a=n.geometry,s=a.coordinates,l=[];return a.type==="Polygon"&&l.push(s[0]),a.type==="MultiPolygon"&&Us.util.each(s,function(o){o[0]&&l.push(o[0])}),{properties:r,type:"Feature",geometry:{type:"Polygon",coordinates:l}}});return{type:"FeatureCollection",crs:{},features:i}}var mfe=function(t,e,i){return e.center=i.dataToPoint(e.coordinates),e},yfe=function(t,e,i){return Hs(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(n,r){var a=i.dataToPoint(t.series[r].coordinates);return n.left=a[0]-parseFloat(n.width)/2,n.top=a[1]-parseFloat(n.height)/2,n})),e},_fe=function(t,e,i){return Hs(t.grid)&&!Array.isArray(t.grid)||Array.isArray(t.grid)&&(t.grid=t.grid.map(function(n,r){var a=i.dataToPoint(t.series[r].coordinates);return n.left=a[0]-parseFloat(n.width)/2,n.top=a[1]-parseFloat(n.height)/2,n})),e},xfe=Object.freeze({pie:mfe,bar:yfe,line:_fe}),wfe={forcedRerender:!1,forcedPrecomposeRerender:!1,hideOnZooming:!1,hideOnMoving:!1,hideOnRotating:!1,convertTypes:["pie","line","bar"],insertFirst:!1,stopEvent:!1,polyfillEvents:ffe(Nx,"6.1.1")<=0},bfe=function(t){dfe(e,t);function e(i,n,r){var a=this,s=Object.assign(wfe,n);return a=t.call(this,s)||this,a._options=s,a._chartOptions=i,a.set("chartOptions",i),a.$chart=null,a.$container=void 0,a._isRegistered=!1,a._initEvent=!1,a._incremental=[],a._coordinateSystem=null,a.coordinateSystemId="",a.prevVisibleState="",Rk(["redraw","onResize","onZoomEnd","onCenterChange","onDragRotateEnd","onMoveStart","onMoveEnd","mouseDown","mouseUp","onClick","mouseMove"],a),r&&a.setMap(r),a}return e.prototype.appendTo=function(i,n){n===void 0&&(n=!1),this.setMap(i,n)},e.prototype.getMap=function(){return this._map},e.prototype.setMap=function(i,n){var r=this;if(n===void 0&&(n=!1),i&&(n||i instanceof xa))this._map=i,this._map.once("postrender",function(){r.handleMapChanged()}),this._map.renderSync();else throw new Error("not ol map object")},e.prototype.getChartOptions=function(){return this.get("chartOptions")},e.prototype.setChartOptions=function(i){return i===void 0&&(i={}),this._chartOptions=i,this.set("chartOptions",i),this.clearAndRedraw(),this},e.prototype.appendData=function(i,n){return n===void 0&&(n=!0),i&&(n&&(this._incremental=Ak(this._incremental,{index:this._incremental.length,data:i.data,seriesIndex:i.seriesIndex})),this.$chart.appendData({data:i.data.copyWithin(),seriesIndex:i.seriesIndex})),this},e.prototype.clear=function(i){i||(this._incremental=[]),this.$chart&&this.$chart.clear()},e.prototype.remove=function(){this.clear(),this.$chart&&this.$chart.dispose(),this._initEvent&&this.$container&&(this.$container&&bx(this.$container),this.unBindEvent()),delete this.$chart,delete this._map},e.prototype.show=function(){this.setVisible(!0)},e.prototype.innerShow=function(){this.$container&&(this.$container.style.display=this.prevVisibleState,this.prevVisibleState="")},e.prototype.hide=function(){this.setVisible(!1)},e.prototype.innerHide=function(){this.$container&&(this.prevVisibleState=this.$container.style.display,this.$container.style.display="none")},e.prototype.isVisible=function(){return this.$container&&this.$container.style.display!=="none"},e.prototype.showLoading=function(){this.$chart&&this.$chart.showLoading()},e.prototype.hideLoading=function(){this.$chart&&this.$chart.hideLoading()},e.prototype.setZIndex=function(i){this.$container&&(typeof i=="number"&&(i=String(i)),this.$container.style.zIndex=i)},e.prototype.getZIndex=function(){return this.$container&&this.$container.style.zIndex},e.prototype.setVisible=function(i){i?(this.$container&&(this.$container.style.display=""),this._chartOptions=this.getChartOptions(),this.clearAndRedraw()):(this.$container&&(this.$container.style.display="none"),this.clear(!0),this._chartOptions={},this.clearAndRedraw())},e.prototype.render=function(){!this.$chart&&this.$container?(this.$chart=Us.init(this.$container),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1)),this.dispatchEvent({type:"load",source:this,value:this.$chart})):this.isVisible()&&this.redraw()},e.prototype.redraw=function(){this.clearAndRedraw()},e.prototype.updateViewSize=function(i){!this.$container||(this.$container.style.width=i[0]+"px",this.$container.style.height=i[1]+"px",this.$container.setAttribute("width",String(i[0])),this.$container.setAttribute("height",String(i[1])))},e.prototype.onResize=function(i){var n=this.getMap();if(n){var r=n.getSize();this.updateViewSize(r),this.clearAndRedraw(),i&&this.dispatchEvent({type:"change:size",source:this,value:r})}},e.prototype.onZoomEnd=function(){this._options.hideOnZooming&&this.innerShow();var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"zoomend",source:this,value:i.getView().getZoom()}))},e.prototype.onDragRotateEnd=function(){this._options.hideOnRotating&&this.innerShow();var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:rotation",source:this,value:i.getView().getRotation()}))},e.prototype.onMoveStart=function(){this._options.hideOnMoving&&this.innerHide();var i=this.getMap();i&&i.getView()&&this.dispatchEvent({type:"movestart",source:this,value:i.getView().getCenter()})},e.prototype.onMoveEnd=function(){this._options.hideOnMoving&&this.innerShow();var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"moveend",source:this,value:i.getView().getCenter()}))},e.prototype.onClick=function(i){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("click",i))},e.prototype.mouseDown=function(i){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("mousedown",i))},e.prototype.mouseUp=function(i){this.$chart&&this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("mouseup",i))},e.prototype.mouseMove=function(i){if(this.$chart)for(var n=i.originalEvent.target;n;){if(n.className==="ol-overlaycontainer-stopevent"){this.$chart.getZr().painter.getViewportRoot().dispatchEvent(Yg("mousemove",i));return}n=n.parentElement}},e.prototype.onCenterChange=function(){var i=this.getMap();i&&i.getView()&&(this.clearAndRedraw(),this.dispatchEvent({type:"change:center",source:this,value:i.getView().getCenter()}))},e.prototype.handleMapChanged=function(){var i=this.getMap();if(this._initEvent&&this.$container&&(this.$container&&bx(this.$container),this.unBindEvent()),this.$container||(this.createLayerContainer(),this.onResize(!1)),i){var n=this._options.stopEvent?i.getOverlayContainerStopEvent():i.getOverlayContainer();this._options.insertFirst?n.insertBefore(this.$container,n.childNodes[0]||null):n.appendChild(this.$container),this.render(),this.bindEvent(i)}},e.prototype.createLayerContainer=function(){this.$container=document.createElement("div"),this.$container.style.position="absolute",this.$container.style.top="0px",this.$container.style.left="0px",this.$container.style.right="0px",this.$container.style.bottom="0px",this.$container.style.pointerEvents="auto"},e.prototype.bindEvent=function(i){var n=i.getView();this._options.forcedPrecomposeRerender&&i.on("precompose",this.redraw),i.on("change:size",this.onResize),n.on("change:resolution",this.onZoomEnd),n.on("change:center",this.onCenterChange),n.on("change:rotation",this.onDragRotateEnd),i.on("movestart",this.onMoveStart),i.on("moveend",this.onMoveEnd),this._options.polyfillEvents&&(i.on("pointerdown",this.mouseDown),i.on("pointerup",this.mouseUp),i.on("pointermove",this.mouseMove),i.on("click",this.onClick)),this._initEvent=!0},e.prototype.unBindEvent=function(){var i=this.getMap();if(!!i){var n=i.getView();!n||(i.un("precompose",this.redraw),i.un("change:size",this.onResize),n.un("change:resolution",this.onZoomEnd),n.un("change:center",this.onCenterChange),n.un("change:rotation",this.onDragRotateEnd),i.un("movestart",this.onMoveStart),i.un("moveend",this.onMoveEnd),this._options.polyfillEvents&&(i.un("pointerdown",this.mouseDown),i.un("pointerup",this.mouseUp),i.un("pointermove",this.mouseMove),i.un("click",this.onClick)),this._initEvent=!1)}},e.prototype.clearAndRedraw=function(){if(!(!this.$chart||!this.isVisible())){if(this._options.forcedRerender&&this.$chart.clear(),this.$chart.resize(),this._chartOptions&&(this.registerMap(),this.$chart.setOption(this.convertData(this._chartOptions),!1),this._incremental&&this._incremental.length>0))for(var i=0;i<this._incremental.length;i++)this.appendData(this._incremental[i],!1);this.dispatchEvent({type:"redraw",source:this})}},e.prototype.registerMap=function(){if(this._isRegistered||(this.coordinateSystemId="openlayers_"+Ek(),Us.registerCoordinateSystem(this.coordinateSystemId,this.getCoordinateSystem(this._options)),this._isRegistered=!0),this._chartOptions){var i=this._chartOptions.series;if(i&&Hs(i)){var n=this._options.convertTypes;if(n)for(var r=i.length-1;r>=0;r--)n.indexOf(i[r].type)>-1||(i[r].coordinateSystem=this.coordinateSystemId),i[r].animation=!1}}},e.prototype.convertData=function(i){var n=i.series;if(n&&n.length>0){if(!this._coordinateSystem){var r=this.getCoordinateSystem(this._options);this._coordinateSystem=new r(this.getMap())}if(n&&Hs(n)){var a=this._options.convertTypes;if(a)for(var s=n.length-1;s>=0;s--)a.indexOf(n[s].type)>-1&&n[s]&&n[s].hasOwnProperty("coordinates")&&(n[s]=xfe[n[s].type](i,n[s],this._coordinateSystem))}}return i},e.prototype.getCoordinateSystem=function(i){var n=this.getMap(),r=this.coordinateSystemId,a=function(s){this.map=s,this._mapOffset=[0,0],this.dimensions=["lng","lat"],this.projCode=a.getProjectionCode(this.map)};return a.dimensions=a.prototype.dimensions||["lng","lat"],a.prototype.getZoom=function(){return this.map.getView().getZoom()},a.prototype.setZoom=function(s){return this.map.getView().setZoom(s)},a.prototype.getViewRectAfterRoam=function(){return this.getViewRect().clone()},a.prototype.setMapOffset=function(s){this._mapOffset=s},a.prototype.dataToPoint=function(s){var l;if(s&&Array.isArray(s)&&s.length>0){l=s.map(function(c){var f=0;return typeof c=="string"?f=Number(c):f=c,f});var o=i&&i.source||"EPSG:4326",u=i&&i.destination||this.projCode,h=this.map.getPixelFromCoordinate(Pr(l,o,u)),d=this._mapOffset;return[h[0]-d[0],h[1]-d[1]]}return[0,0]},a.prototype.pointToData=function(s){var l=this._mapOffset;return this.map.getCoordinateFromPixel([s[0]+l[0],s[1]+l[1]])},a.prototype.getViewRect=function(){var s=this.map.getSize();return new Us.graphic.BoundingRect(0,0,s[0],s[1])},a.prototype.getRoamTransform=function(){return Us.matrix.create()},a.prototype.prepareCustoms=function(){var s=this.getViewRect();return{coordSys:{type:r,x:s.x,y:s.y,width:s.width,height:s.height},api:{coord:xx(this.dataToPoint,this),size:xx(a.dataToCoordsSize,this)}}},a.create=function(s){s.eachSeries(function(l){l.get("coordinateSystem")===r&&(l.coordinateSystem=new a(n))})},a.getProjectionCode=function(s){var l="";return s?l=s.getView()&&s.getView().getProjection().getCode():l="EPSG:3857",l},a.dataToCoordsSize=function(s,l){var o=this;return l===void 0&&(l=[0,0]),[0,1].map(function(u){var h=l[u],d=[],c=[],f=s[u]/2;d[u]=h-f,c[u]=h+f,d[1-u]=l[1-u],c[1-u]=l[1-u];var g=o.dataToPoint(d)[u]-o.dataToPoint(c)[u];return Math.abs(g)},this)},a},e.prototype.dispatchEvent=function(i){return t.prototype.dispatchEvent.call(this,i)},e.prototype.set=function(i,n,r){return t.prototype.set.call(this,i,n,r)},e.prototype.get=function(i){return t.prototype.get.call(this,i)},e.prototype.unset=function(i,n){return t.prototype.unset.call(this,i,n)},e.prototype.on=function(i,n){return t.prototype.on.call(this,i,n)},e.prototype.un=function(i,n){return t.prototype.un.call(this,i,n)},e.formatGeoJSON=pfe,e.bind=xx,e.merge=Tk,e.uuid=Ek,e.bindAll=Rk,e.arrayAdd=Ak,e.removeNode=bx,e.isObject=Hs,e}(Gi);const Sfe={name:"v-echarts",extends:rr,inject:["VMap"],render(t,e){return null},props:{layerId:{type:String,default(){return`draw-layer-${He()}`}},options:{type:Object}},data(){return{layer:null}},computed:{map(){return this.VMap.map},map3d(){return this.VMap.map3d}},watch:{visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.dispose()},methods:{init(){this.layer=new bfe(this.options),this.zIndex&&this.layer.setZIndex(this.zIndex),this.layer.appendTo(this.map)},dispose(){this.layer.remove()}}};let Cfe,Tfe;const Mk={};var Lk=Oi(Sfe,Cfe,Tfe,!1,Afe,null,null,null);function Afe(t){for(let e in Mk)this[e]=Mk[e]}Lk.options.__file="src/components/layers/echarts/index.vue";const gc=function(){return Lk.exports}();gc.install=t=>{t.component(gc.name,gc)};function Efe(t,e){let i;return e.getLayers().forEach(n=>{n&&n.get("id")===t&&(i=n)}),i}const Lx=class{constructor(e,i,n,r,a,s,l,o,u){!i||i.length<1||(this.id=u.id,this.changeCarRotate=u.changeCarRotate,this.centerAtCar=u.centerAtCar,this._moving=!0,this._ismove=!1,this._map=e,this._labelShow=s,this._timeContentClass=l,this._vacuate=r,this._wholePathInfo=i,this._timeOverlayList=[],r?(this._pathInfo=n,this._convertPaths(n)):(this._pathInfo=i,this._convertPaths(i)),this._vacuatePath=n,this._path=[],this._passPath=[],this._pointIndexDistance=20,this._tracePoints=[],this._tracePointsModePlay=a,this._traceTimedivDom=e.traceTimedivDom,this._tracePointsFromTime=[],this._traceEnd=!1,this.traceLayer=new Ri({source:new Ln,zIndex:99}),this.traceLayer.set("isTrack",!0),e.addLayer(this.traceLayer),this.tracePassLayer=new Ri({source:new Ln,zIndex:100}),this.tracePassLayer.set("isTrack",!0),e.addLayer(this.tracePassLayer),this.arrowsLayer=new Ri({source:new Ln,zIndex:101}),this.arrowsLayer.set("isTrack",!0),e.addLayer(this.arrowsLayer),this.carLayer=new Ri({source:new Ln,zIndex:102}),this.carLayer.set("isTrack",!0),e.addLayer(this.carLayer),this.traceNodes=[],this.traceLineList=[],this.carMarker=null,this._carInfoWin=null,this._pointIndex=0,this._traceIndex=0,this._speedUp=1,this._intervalTraceFlag=null,this._intervalTimeFlag=null,this._opts={carIcon:{src:"",scale:1},speed:0,defaultContent:"",startIcon:{src:"",scale:1},endIcon:{src:"",scale:1},passFlag:!0,showInfoWin:!1,arrowPixel:50,tracePlay:!1},this._setOptions(u),this._initFlag=1,this._showTracePoint=o)}};let et=Lx;Zn(et,"track",Lx),et.prototype._setOptions=function(t){if(!!t)for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this._opts[e]=t[e])},et.prototype.getSpeed=function(){return this._opts.speed},et.prototype.getSpeedUp=function(){return this._speedUp},et.prototype.getPaths=function(){return this._pathInfo},et.prototype.getTraceIndex=function(){return this._pointIndex},et.prototype.setTraceIndex=function(t){this._pointIndex=t;const e=this._path[t];this.carMarker.setPosition(e)},et.prototype.getPercentnum=function(){const t=this._tracePoints,e=this.carMarker.getPosition();for(let i=0;i<t.length;i++)if(e.toString()===t[i].coordinate.toString())return parseFloat((i/t.length).toFixed(2))},et.prototype.setPercentnum=function(t){const e=this._tracePoints,i=this._tracePointsFromTime,n=Math.round(e.length*t),r=e[n].coordinate;this.carMarker.setPosition(r);for(let a=0;a<i.length;a++){const s=i[a].temBreakPointsFromTime;for(let l=0;l<s.length;l++)s[l].coordinate.toString()===r.toString()&&(this._traceIndex=l,this._pointIndex=a)}},et.prototype._showTimePopup=function(t){const e=this;e._traceTime=e._pathInfo[0].time,e._fromPause&&(e._traceTime=e._traceTimedivDom.innerText);const i=e._pathInfo[e._pathInfo.length-1].time,n=new Date(i).getTime();n>t.maxEndTime&&(t.maxEndTime=n),e._intervalTimeFlag=setInterval(function(){if(!e._traceEnd&&!e._fromPause&&!e._fromStop){if(e._traceTime=new Date(e._traceTime).getTime()+1e3*e._speedUp,t.maxEndTime<e._traceTime){e._traceEnd=!0,e._traceTimedivDom.innerText=i;return}e._traceTime%1e3===0&&(e._traceTime=Mfe(new Date(e._traceTime)),e._traceTimedivDom.innerText=e._traceTime)}},1e3)},et.prototype._setTraceTime=function(t){const e=this,i=e._tracePointsFromTime;if(e._traceTimedivDom.innerText=t,e._traceTime=t,e._opts.speed===0){let n=Number.MAX_VALUE;const r=new Date(e._traceTimedivDom.innerText).getTime();if(r>0||!isNaN(r))for(let a=0;a<i.length;a++){const s=i[a].temBreakPointsFromTime;for(let l=0;l<s.length;l++)Math.abs(r-s[l].thisTimeSecond)<n&&(n=Math.abs(r-s[l].thisTimeSecond),e._pointIndex=a,e._traceIndex=l)}e._fromStop&&(e._pointIndex=0,e._traceIndex=0),(e._traceTimedivDom.innerText===""||e._fromPause||e._fromStop)&&e._showTimePopup(e._map)}},et.prototype._convertPaths=function(t){this._path=[];for(let e=0;e<t.length;e++)this._path.push([t[e].longitude,t[e].latitude])},et.prototype.start=function(){this._moving=!0;const t=this,e=t.getTracePoints(1);t._tracePoints=e.breakPoints,t._tracePointsFromTime=e.breakPointsFromTime,!(t._path.length<1)&&(t._tracePointsModePlay==="skip"?t.tracePointsPlay():t._tracePointsModePlay==="animation"&&t.timePointsPlay())},et.prototype.tracePointsPlay=function(){const t=this,e=t._pathInfo,i=t._passPath;if(i.length===0&&t.tracePassLayer.getSource().clear(),!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop||t._pointIndex>=e.length)return;if(t._pointIndex+=t._speedUp,t._pointIndex>=e.length&&(t._pointIndex=e.length-1),t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._pointIndex===1&&i.push([e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude]),i.push([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const s=new Qt({geometry:new _i([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});s.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(s)}t._opts.showInfoWin&&(t._carInfoWin.getElement().innerText=e[t._pointIndex].info);const n=t._map.getView().calculateExtent(),r=t.carMarker.getPosition();!Ar(n,r)&&t.centerAtCar&&t._map.getView().animate({center:r})},1e3);else if(t._fromPause){if(!t._fromStop){if(t._pointIndex++,t.carMarker.setPosition([e[t._pointIndex].longitude,e[t._pointIndex].latitude]),t._opts.passFlag){const n=new Qt({geometry:new _i([[e[t._pointIndex-1].longitude,e[t._pointIndex-1].latitude],[e[t._pointIndex].longitude,e[t._pointIndex].latitude]])});n.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(n)}t._ismove=!1}}else return;this._fromPause=!1,this._fromStop=!1},et.prototype.timePointsPlay=function(){const t=this,e=t._tracePoints,i=t._tracePointsFromTime,n=t._passPath;if(n.length===0&&t.tracePassLayer.getSource().clear(),t._opts.speed===0){let r=Number.MAX_VALUE;const a=new Date(t._traceTimedivDom.innerText).getTime();if(a>0||!isNaN(a))for(let s=0;s<i.length;s++){const l=i[s].temBreakPointsFromTime;for(let o=0;o<l.length;o++)Math.abs(a-l[o].thisTimeSecond)<r&&(r=Math.abs(a-l[o].thisTimeSecond),t._pointIndex=s,t._traceIndex=o)}t._fromStop&&(t._pointIndex=0,t._traceIndex=0),(t._traceTimedivDom.innerText===""||t._fromPause||t._fromStop)&&t._showTimePopup(t._map)}if(!t._ismove)t._addMarker(),t._addInfoWin(),t._intervalTraceFlag=setInterval(function(){if(t._fromPause||t._fromStop)return;const r=t._opts.speed*1e3/3600;if(t._pointIndex>=i.length)return;const a=i[t._pointIndex].temBreakPointsFromTime,s=i[t._pointIndex].differenceTime,l=i[t._pointIndex].length;let o=0;if(r===0?o=(l/s/50).toFixed(2)*10*t._speedUp:o=(r/50).toFixed(2)*10,t._fromPause||t._fromStop||t._pointIndex>=e.length-1||t._pointIndex>=i.length)return;if(t._traceIndex+=o,t._traceIndex=Math.round(t._traceIndex),t._traceIndex>=a.length){t._traceIndex=a.length-1,t._pointIndex++;const c=a.slice(0,t._traceIndex);for(let p=0;p<c.length;p++)n.push(c[p].coordinate);if(t._opts.passFlag){const p=new Qt({geometry:new _i(n)});p.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}const f=Ok(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.carMarker.setPosition(a[t._traceIndex].coordinate),t.changeCarRotate&&t.carMarker.setRotateAngle(f);const g=t._troughPointIndex(a[t._traceIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0))),t._traceIndex=0}else{const c=a.slice(Math.round(t._traceIndex-o),t._traceIndex);for(let p=0;p<c.length;p++)n.push(c[p].coordinate);if(t._opts.passFlag){const p=new Qt({geometry:new _i(n)});p.setStyle(new _t({stroke:new Tt({color:t._opts.passlineColor,width:5})})),t.tracePassLayer.getSource().addFeature(p)}t.carMarker.setPosition(a[t._traceIndex].coordinate);const f=Ok(a[t._traceIndex-1].coordinate,a[t._traceIndex].coordinate);t.changeCarRotate&&t.carMarker.setRotateAngle(f);const g=t._troughPointIndex(e[t._pointIndex].coordinate);t._opts.showInfoWin&&(t._pathInfo[g]?(t._carInfoWin.getElement().innerText=t._pathInfo[g].info,t._carInfoWin.setPosition([t._pathInfo[g].longitude,t._pathInfo[g].latitude])):(t._carInfoWin.getElement().innerText="",t._carInfoWin.setPosition(void 0)))}const u=t._map.getView().calculateExtent(),h=t.carMarker.getPosition();!Ar(u,h)&&t.centerAtCar&&t._map.getView().animate({center:h})},200);else if(t._fromPause)t._fromStop||(t._traceIndex++,t._ismove=!1);else return;this._fromPause=!1,this._fromStop=!1},et.prototype.setSpeed=function(t){this._opts.speed=t},et.prototype.setSpeedUp=function(t){this._speedUp=t},et.prototype.stop=function(){this._moving=!1,this._ismove=!1,this._pointIndex=0,this._traceIndex=0,this._fromStop=!0,this._passPath=[],this.tracePassLayer.getSource().clear(),this.carMarker.setPosition([this._pathInfo[0].longitude,this._pathInfo[0].latitude]),clearInterval(this._intervalTraceFlag),clearInterval(this._intervalTimeFlag)},et.prototype.pause=function(){this._moving=!1,this._ismove=!0,this._fromPause=!0,clearInterval(this._intervalTimeFlag)},et.prototype._addMarker=function(){const t=this;this.carMarker&&(this.carLayer.getSource().getFeatures().length>0&&this.carLayer.getSource().removeFeature(this.carMarker),clearInterval(this._intervalTraceFlag));const e=Lfe(this._path[0],this._opts);this.carLayer.getSource().addFeature(e),this.carMarker=e,e.on=function(i,n){if(i==="move"){const r=setInterval(function(){if(!t._moving)return;const a=e.getPosition(),s=t._pathInfo;for(let l=0;l<s.length;l++)a.toString()===s[l].longitude+","+s[l].latitude&&(n(l),l===s.length-1&&clearInterval(r))},200)}}},et.prototype._addInfoWin=function(){const t=this;if(!t._opts.showInfoWin)return;const e=t.carMarker.getPosition();if(t._carInfoWin){t._carInfoWin.setPosition(e);return}const i=document.createElement("div");i.className="carOverlay-class",i.innerText="";const n=new md({element:document.getElementById(t._opts.overlay.element.toString()),position:e,stopEvent:!0,offset:[10,0]});t._carInfoWin=n,t._map.addOverlay(n)},et.prototype.getArrowPoints=function(t){const e=this._pathInfo,i=[];for(let n=0;n<e.length-1;n++){const r=[e[n].longitude,e[n].latitude],a=[e[n+1].longitude,e[n+1].latitude],s=this._map.getPixelFromCoordinate(r),l=this._map.getPixelFromCoordinate(a),u=zk([s,l]),h=Math.floor(u/t),d=this.getRotationFromPixel(s,l);for(let c=1;c<h+1;c++){const f=[s[0]+t*c*Math.cos(d),s[1]+t*c*Math.sin(d)],g=this._map.getCoordinateFromPixel(f);i.push({rotate:d,coordinate:g})}}return i},et.prototype.getTracePoints=function(t){const e=this._pathInfo,i=[],n=[];for(let r=0;r<e.length-1;r++){const a=[],s=[e[r].longitude,e[r].latitude],l=[e[r+1].longitude,e[r+1].latitude],o=e[r].time,u=e[r+1].time,h=new Date(o).getTime(),d=new Date(u).getTime(),c=d-h;if(c===0)continue;const f=l6(s),g=l6(l),v=zk([f,g]),m=Math.floor(v/t),y=this.getRotationFromPixel(f,g),_=this.getAngleFromPixel(f,g);for(let w=0;w<m+1;w++){const b=[f[0]+w*t*Math.cos(y),f[1]+w*t*Math.sin(y)],C=GF(b),x=h+Math.round(c/m)*w;i.push({rotate:_,coordinate:C,thisTimeSecond:x}),a.push({rotate:_,coordinate:C,thisTimeSecond:x})}v%t!==0&&(i.push({rotate:_,coordinate:l,thisTimeSecond:d}),a.push({rotate:_,coordinate:l,thisTimeSecond:d})),n.push({length:v,differenceTime:c/1e3,initTime:o,targetTime:u,temBreakPointsFromTime:a})}return{breakPoints:i,breakPointsFromTime:n}},et.prototype.getRotationFromPixel=function(t,e){if(!t)return!1;t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),r=Math.sqrt(i*i+n*n),a=Math.asin(n/r);let s=0;return e.y<t.y&&e.x===t.x?s=Math.PI*2/3:e.y>t.y&&e.x===t.x?s=Math.PI/2:e.y===t.y&&e.x<t.x?s=Math.PI:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=a:e.y>t.y&&e.x<t.x?s=Math.PI-a:e.y<t.y&&e.x<t.x?s=Math.PI+a:e.y<t.y&&e.x>t.x&&(s=Math.PI*2-a),s},et.prototype.getAngleFromPixel=function(t,e){t={x:t[0],y:t[1]},e={x:e[0],y:e[1]};const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y),r=Math.sqrt(i*i+n*n),a=Math.round(Math.asin(n/r)/Math.PI*180);let s=0;return e.y<t.y&&e.x===t.x?s=270:e.y>t.y&&e.x===t.x?s=90:e.y===t.y&&e.x<t.x?s=180:e.y===t.y&&e.x>t.x?s=0:e.y>t.y&&e.x>t.x?s=360-a:e.y>t.y&&e.x<t.x?s=180+a:e.y<t.y&&e.x<t.x?s=180-a:e.y<t.y&&e.x>t.x&&(s=a),s},et.prototype._troughPointIndex=function(t){const e=this._pointIndexDistance,i=this._path;for(let n=0;n<i.length;n++){const r=i[n];if(Ac(r,t)<e)return n}return-1},et.prototype._traceLineSytle=function(t){const e=this._opts,i=e.lineWidth?e.lineWidth:5,n=e.lineColor?e.lineColor:"blue";return{route:new _t({stroke:new Tt({width:i,color:n})}),node:new _t({image:new Hi({radius:5,stroke:new Tt({color:"white",width:0}),fill:new ot({color:"green"})})}),start:new _t({image:new an(this._opts.startIcon),text:new Pn({font:"13px Microsoft Yahei",fill:new ot({color:"#aa3300"}),stroke:new Tt({color:"#fff",width:2}),textAlign:"left"})}),end:new _t({image:new an(this._opts.endIcon),text:new Pn({font:"13px Microsoft Yahei",fill:new ot({color:"#aa3300"}),stroke:new Tt({color:"#fff",width:2}),textAlign:"left"})})}[t]},et.prototype._initLinesAndMarkers=function(){const t=this,e=t._pathInfo,i=t._wholePathInfo;if(t._convertPaths(e),t._initFlag===1){t.traceNodes=[];for(const n in i){const r=Number(n),a=[i[r].longitude,i[r].latitude],s=i[r].id;if(r>0&&r<i.length-1){const l=new Qt({geometry:new Ht(a)});l.set("id",s),l.set("number",parseInt(r)+1),t._showTracePoint&&t.traceNodes.push(l),l.set("type","node"),l.on("mouseover",function(o){t._map.getInfoWindowById(o.coordinate.toString())&&t._map.getInfoWindowById(o.coordinate.toString()).setPosition(o.coordinate)}),l.on("mouseout",function(o){t._map.getInfoWindowById(this.getPosition().toString())&&t._map.getInfoWindowById(this.getPosition().toString()).setPosition(void 0)})}else if(r===0){const l=new Qt({geometry:new Ht([i[r].longitude,i[r].latitude])});l.set("type","start"),l.set("id",s),l.set("number",parseInt(r)+1),t.traceNodes.push(l)}else if(r===i.length-1){const l=new Qt({geometry:new Ht([i[r].longitude,i[r].latitude+1e-8])});l.set("type","end"),l.set("id",s),l.set("number",parseInt(r)+1),t.traceNodes.push(l)}}for(let n=0;n<t._pathInfo.length-1;n++){const r=[t._pathInfo[n].longitude,t._pathInfo[n].latitude],a=[t._pathInfo[n+1].longitude,t._pathInfo[n+1].latitude],s=new Qt({geometry:new _i([r,a])});s.setStyle(t._traceLineSytle("route")),t.traceLayer.getSource().addFeature(s),t.traceLineList.push(s)}for(let n=0;n<t.traceNodes.length;n++){const r=t.traceNodes[n],a=t._traceLineSytle(r.get("type"));if(r.setStyle(a),r.getGeometry().getType()==="Point")for(let s=0;s<e.length;s++)r.get("id")===e[s].id&&t.traceLayer.getSource().addFeature(r)}}},et.prototype.setTraceLineColor=function(t){const e=this;e._opts.lineColor=t;const i=e.traceLineList;for(let n=0;n<i.length;n++)i[n].setStrokeColor(t);e.traceLayer.refresh()},et.prototype.setTraceLineWidth=function(t){const e=this;e._opts.lineWidth=t;const i=e.traceLineList;for(let n=0;n<i.length;n++)i[n].setStrokeWeight(t);e.traceLayer.refresh()},et.prototype._creatTimeOverlays=function(){const t=this,e=t._wholePathInfo,i=t._vacuatePath;if(t._timeOverlayList=[],t._labelShow){const n=[];for(let r=0;r<e.length;r++)for(let a=0;a<i.length;a++)if(i[a].longitude===e[r].longitude&&i[a].latitude===e[r].latitude){const s=[e[r].longitude,e[r].latitude];n.push({position:s,text:e[r].time})}typeof t.textLayer=="undefined"?(t.textLayer=Pfe(t._map,n,10),t.textLayer.set("id","lushuText"+new Date().getTime()),t._map.addLayer(t.textLayer)):typeof Efe(t.textLayer.get("id"),t._map)=="undefined"&&t._map.addLayer(t.textLayer)}},et.prototype.createArrows=function(){const t=this,e=t.getArrowPoints(t._opts.arrowPixel);for(let i=0;i<e.length;i++){const n=e[i].coordinate,r=e[i].rotate,a=new Qt({geometry:new Ht(n)});a.setStyle(new _t({image:new an({src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABfUlEQVQ4T3WTTSvFYRDFf8dLKIqytFckthTpJkQWlyhF2fgEVr6BheytpChEsqB08xbZWPgOJAs7ieRlNMzV//75P7vnmZkz58ycR2ZWD7QBF5KM1DGzTuBO0k065neZ2S3QBGwAU5I+iolmNgrsAI9An6SrNIgDnAE9EdgFJiS9+93MuoEToBx4AgYkXSZBHKAWOAS6IrAP5CW9BUge2AIqgJdg8guiSKoBDoDeDJBhwNlVBsiQpNPvGST0VgF7TjPeCsCIpNdo0g84O2fibx4r/AJEUjVwlJDjXbybU/eZjAGbMROXmC8BiKQ64BxoDyYLkuYTTCeB9WD/9B9AA3AMdGQAzALLAfCcluDF3r01itMS5oDFiP3MIUHNi90T7ko/XjyYGOIMsFJSXByimTVGQbFzegOuew0o+7PGKL4AmjM8MA2shua/RjIzX1suw8pucZfiUjOt/AC4BHfaeOoz+d63oziX9Zla3CzAkqTP9G8zM4/dS7r+7zt/Aaattn1kX8VgAAAAAElFTkSuQmCC",rotation:r,scale:.5})})),t.arrowsLayer.getSource().addFeature(a)}},et.prototype.windowAddMouseWheel=function(){const t=this,e=function(i){i=i||window.event,i.wheelDelta?(i.wheelDelta>0&&t.arrowsLayer.getSource().clear(),i.wheelDelta<0&&t.arrowsLayer.getSource().clear()):i.detail&&(i.detail>0&&t.arrowsLayer.getSource().clear(),i.detail<0&&t.arrowsLayer.getSource().clear())};document.addEventListener&&document.addEventListener("DOMMouseScroll",e,!1),window.onmousewheel=document.onmousewheel=e},et.prototype.dispose=function(){this._intervalTimeFlag&&(clearInterval(this._intervalTimeFlag),this._intervalTimeFlag=null),this._intervalTraceFlag&&(clearInterval(this._intervalTraceFlag),this._intervalTraceFlag=null);const e=this._map.getLayers().getArray().filter(i=>i.get("isTrack")&&i.get("isTrack")===!0);e&&e.length>0&&e.forEach(i=>{i.getSource().clear(),this._map.removeLayer(i)})};function Sx(t,e,i,n,r){n==="distance"?Pk(t,e,i,r):n==="track"&&Rfe(t,e,i,r)}function Pk(t,e,i,n){const r=[];e.forEach(function(s,l){r.push(s)});let a=!0;for(let s=0;s<r.length-1;s++)if(Kg(t,r[s],r[s+1])<i&&r.length>=3){a=!1,s+1<r.length-1||s===0?r.splice(s+1,1):r.splice(s,1);break}a?n(e):Pk(t,r,i,n)}function Rfe(t,e,i,n){const r=e;r.forEach(function(l,o){l.id=o});const a=Cx(t,r,[],0,r.length-1,i);a.push(r[0]),r.length>1&&a.push(r[r.length-1]);const s=a.sort(function(l,o){return l.id<o.id?-1:l.id>o.id?1:0});n(s)}const Cx=function(t,e,i,n,r,a){if(n<r){let s=0,l=0;const o=e[n],u=e[r];for(let h=n+1;h<r;h++){const d=Ife(t,o,u,e[h]);d>s&&(s=d,l=h)}s>=a&&(i.push(e[l]),Cx(t,e,i,n,l,a),Cx(t,e,i,l,r,a))}return i},Ife=function(t,e,i,n){const r=Math.abs(Kg(t,e,i)),a=Math.abs(Kg(t,e,n)),s=Math.abs(Kg(t,i,n)),l=(r+a+s)/2;return Math.sqrt(Math.abs(l*(l-r)*(l-a)*(l-s)))*2/r},Kg=function(t,e,i){const n=e.latitude,r=i.latitude,a=e.longitude,s=i.longitude,l=t.getPixelFromCoordinate([a,n]),o=t.getPixelFromCoordinate([s,r]);return Math.sqrt(Math.pow(o[0]-l[0],2)+Math.pow(o[1]-l[1],2))};var zk=function(t){let e=0;for(let i=0,n=t.length-1;i<n;++i)t[i+1]&&(e+=Math.sqrt(Math.pow(t[i+1][0]-t[i][0],2)+Math.pow(t[i+1][1]-t[i][1],2)));return e};function Mfe(t){let e=t.getHours(),i=t.getMinutes(),n=t.getSeconds();const r=t.getFullYear();let a=t.getMonth(),s=t.getDate();return e<10&&(e="0"+e),i<10&&(i="0"+i),n<10&&(n="0"+n),a=a+1,a<10&&(a="0"+a),s<10&&(s="0"+s),r+"-"+a+"-"+s+" "+e+":"+i+":"+n}function Lfe(t,e){const i=new Qt({geometry:new Ht(t)});return i.setStyle(new _t({image:new an(e.carIcon)})),i}function Pfe(t,e,i){const n=[],r=new Ri({source:new Ln});return t.getView().getZoom()>=i&&Dk(t,e,i,n,r),t.on("moveend",function(a){t.getView().getZoom()>=i?Dk(t,e,i,n,r):r.getSource().clear()}),r}function Dk(t,e,i,n,r){n=[],r.getSource().clear();for(let h=0;h<e.length;h++){const d=e[h],c=t.getPixelFromCoordinate(d.position);if(!Ar(t.getView().calculateExtent(),d.position))continue;const f=/[\u4e00-\u9fa5]/g,g=d.text.match(f)?d.text.match(f).length:0,p=d.text.length-g,v=g*15+p*8,m=c[0]+10,y=c[0]+v+20,_=c[1]-32,w=c[1]-12,b=[m,parseInt((_+w)/2)],C={x:m,y:_},x={x:y,y:w},S=c[0]-v-20,T=c[0]-10,E=c[1]-32,A=c[1]-12,R=[T,parseInt((E+A)/2)],I={x:S,y:E},L={x:T,y:A},M=c[0]-v-20,P=c[0]-10,O=c[1]+12,F=c[1]+32,q=[P,parseInt((O+F)/2)],j={x:M,y:O},z={x:P,y:F},D=c[0]+10,k=c[0]+v+20,N=c[1]+12,G=c[1]+32,B=[D,parseInt((N+G)/2)],V={x:D,y:N},U={x:k,y:G},H=new vc(C,x),Y=new vc(I,L),K=new vc(j,z),J=new vc(V,U);let Q="rightTop",te=!0;for(let ne=0;ne<4;ne++){for(let ae=0;ae<n.length;ae++){const de=n[ae];if(ne===0){if(te=de.intersects(H),!te)break}else if(ne===1){if(te=de.intersects(Y),!te)break}else if(ne===2){if(te=de.intersects(K),!te)break}else if(ne===3&&(te=de.intersects(J),!te))break}if(te){ne===0?Q="rightTop":ne===1?Q="leftTop":ne===2?Q="leftBom":ne===3&&(Q="rightBom");break}}var a,s,l,o,u;if(te)Q==="rightTop"?(n.push(H),u=b,a=m,s=_,l=y,o=w):Q==="leftTop"?(n.push(Y),u=R,a=S,s=E,l=T,o=A):Q==="rightBom"?(n.push(J),u=B,a=D,s=N,l=k,o=G):Q==="leftBom"&&(n.push(K),u=q,a=M,s=O,l=P,o=F);else continue;const ie=t.getCoordinateFromPixel([a,s]),se=t.getCoordinateFromPixel([l,s]),me=t.getCoordinateFromPixel([l,o]),le=t.getCoordinateFromPixel([a,o]),pe=new Qt({geometry:new vn([ie,se,me,le])});r.getSource().addFeature(pe),u=t.getCoordinateFromPixel(u);const be=new Qt({geometry:new _i([d.position,u])});r.getSource().addFeature(be),r.setStyle(new _t({fill:new ot({color:"rgb(26,58,91)"}),stroke:new Tt({color:"rgb(26,58,91)"}),text:new Pn({font:"16px sans-serif",text:d.text,fill:new ot({color:"#000"}),offsetX:0,offsetY:1})}))}}function vc(t,e){this.min=t,this.max=e}vc.prototype.intersects=function(t){const e=this.min,i=this.max,n=t.min,r=t.max;return r.x<=e.x||n.x>=i.x||r.y<=e.y||n.y>=i.y};function Ok(t,e){const i=Md(t),n=Md(e);return E7(i,n)}const zfe=function(t){let{map:e,paths:i,id:n,opts:r,vacuate:a,smokeMode:s,tracePointsModePlay:l,vacuateDistance:o,labelShow:u,labelStyle:h,showTracePoint:d}=t;r.id=n||He(),r.changeCarRotate=t.changeCarRotate,r.centerAtCar=t.centerAtCar;let c=i,f,g=e.getView().getZoom();return a?Sx(e,i,o,s,function(p){c=p,f=new et(e,i,c,a,l,u,h,d,r),f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows()}):(f=new et(e,i,c,a,l,u,h,d,r),f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows()),f.setPaths=function(p){i=p,f.arrowsLayer.getSource().clear();for(let v=0;v<f._timeOverlayList.length;v++)e.removeOverlay(f._timeOverlayList[v]);f.traceLayer.getSource().clear(),f.tracePassLayer.getSource().clear(),f.stop(),g=e.getView().getZoom(),a?Sx(e,i,o,s,function(v){c=v,f._pathInfo=c,f._vacuatePath=c,f._wholePathInfo=i,f._initFlag=1,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows()}):(f._pathInfo=i,f._vacuatePath=i,f._wholePathInfo=i,f._initFlag=1,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.createArrows())},f.clearPaths=function(){f._path=[],i=[],f.arrowsLayer.getSource().clear(),f.tracePassLayer.getSource().clear();for(let p=0;p<f._timeOverlayList.length;p++)e.removeOverlay(f._timeOverlayList[p]);f.traceLayer.getSource().clear(),this.carLayer.getFeatures().length>0&&this.carLayer.removeFeature(this.carMarker),typeof this.textLayer!="undefined"&&e.removeLayer(this.textLayer)},e.getView().on("change:resolution",function(){if(i.length!==0&&(g=e.getView().getZoom(),f.arrowsLayer.getSource().clear(),Math.round(g)===g))if(f._initFlag=2,f.createArrows(),a)Sx(e,i,o,s,function(p){c=p;for(let v=0;v<f._timeOverlayList.length;v++)e.removeOverlay(f._timeOverlayList[v]);f._pathInfo=c,f._vacuatePath=c,f._wholePathInfo=i,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.arrowsLayer.getSource().clear(),f.createArrows()});else{for(let p=0;p<f._timeOverlayList.length;p++)e.removeOverlay(f._timeOverlayList[p]);f._pathInfo=c,f._vacuatePath=c,f._wholePathInfo=i,f._initLinesAndMarkers(),u&&f._creatTimeOverlays(),f.arrowsLayer.getSource().clear(),f.createArrows()}}),f},Dfe={name:"v-track",render(t,e){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${He()}`}},paths:{type:Array,default(){return[]}},tracePointsModePlay:{type:String,default:"animation"},smokeMode:{type:String,default:"distance"},vacuate:{type:Boolean,default:!1},vacuateDistance:{type:[Number,void 0],default:10},labelShow:{type:Boolean,default:!1},showTracePoint:{type:Boolean,default:!0},changeCarRotate:{type:Boolean,default:!1},centerAtCar:{type:Boolean,default:!1},options:{type:Object,default(){return{}}},autoPlay:{type:Boolean,default:!1},labelStyle:{type:String,default:"timeContentClass"}},data(){return{track:null}},computed:{map(){return this.VMap.map}},watch:{paths:{handler(t){this.init(t)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.track.dispose(),this.track=null},methods:{init(t){if(t&&t.length>0||this.paths&&this.paths.length>0){const e=Qe(Oe({},this.$props),{map:this.map,paths:t||this.paths,opts:this.options});this.track=zfe(e),this.$emit("onLoad",this.track),this.autoPlay&&this.start()}},start(){this.track.start()},pause(){this.track.pause()},stop(){this.track.stop()},dispose(){this.track.dispose()}}};let Ofe,kfe;const kk={};var Fk=Oi(Dfe,Ofe,kfe,!1,Ffe,null,null,null);function Ffe(t){for(let e in kk)this[e]=kk[e]}Fk.options.__file="src/components/track/index.vue";const pc=function(){return Fk.exports}();pc.install=t=>{t.component(pc.name,pc)};const Nk=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Tx=1,mc=8;class Ax{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[i,n]=new Uint8Array(e,0,2);if(i!==219)throw new Error("Data does not appear to be in a KDBush format.");const r=n>>4;if(r!==Tx)throw new Error(`Got v${r} data when expected v${Tx}.`);const a=Nk[n&15];if(!a)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[l]=new Uint32Array(e,4,1);return new Ax(l,s,a,e)}constructor(e,i=64,n=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+i,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const a=Nk.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,l=e*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-l%8)%8;if(a<0)throw new Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,mc,e),this.coords=new this.ArrayType(this.data,mc+l+o,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(mc+s+l+o),this.ids=new this.IndexArrayType(this.data,mc,e),this.coords=new this.ArrayType(this.data,mc+l+o,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Tx<<4)+a]),new Uint16Array(this.data,2,1)[0]=i,new Uint32Array(this.data,4,1)[0]=e)}add(e,i){const n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=i,n}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ex(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,i,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:a,coords:s,nodeSize:l}=this,o=[0,a.length-1,0],u=[];for(;o.length;){const h=o.pop()||0,d=o.pop()||0,c=o.pop()||0;if(d-c<=l){for(let v=c;v<=d;v++){const m=s[2*v],y=s[2*v+1];m>=e&&m<=n&&y>=i&&y<=r&&u.push(a[v])}continue}const f=c+d>>1,g=s[2*f],p=s[2*f+1];g>=e&&g<=n&&p>=i&&p<=r&&u.push(a[f]),(h===0?e<=g:i<=p)&&(o.push(c),o.push(f-1),o.push(1-h)),(h===0?n>=g:r>=p)&&(o.push(f+1),o.push(d),o.push(1-h))}return u}within(e,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:a,nodeSize:s}=this,l=[0,r.length-1,0],o=[],u=n*n;for(;l.length;){const h=l.pop()||0,d=l.pop()||0,c=l.pop()||0;if(d-c<=s){for(let v=c;v<=d;v++)qk(a[2*v],a[2*v+1],e,i)<=u&&o.push(r[v]);continue}const f=c+d>>1,g=a[2*f],p=a[2*f+1];qk(g,p,e,i)<=u&&o.push(r[f]),(h===0?e-n<=g:i-n<=p)&&(l.push(c),l.push(f-1),l.push(1-h)),(h===0?e+n>=g:i+n>=p)&&(l.push(f+1),l.push(d),l.push(1-h))}return o}}function Ex(t,e,i,n,r,a){if(r-n<=i)return;const s=n+r>>1;jk(t,e,s,n,r,a),Ex(t,e,i,n,s-1,1-a),Ex(t,e,i,s+1,r,1-a)}function jk(t,e,i,n,r,a){for(;r>n;){if(r-n>600){const u=r-n+1,h=i-n+1,d=Math.log(u),c=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*c*(u-c)/u)*(h-u/2<0?-1:1),g=Math.max(n,Math.floor(i-h*c/u+f)),p=Math.min(r,Math.floor(i+(u-h)*c/u+f));jk(t,e,i,g,p,a)}const s=e[2*i+a];let l=n,o=r;for(yc(t,e,n,i),e[2*r+a]>s&&yc(t,e,n,r);l<o;){for(yc(t,e,l,o),l++,o--;e[2*l+a]<s;)l++;for(;e[2*o+a]>s;)o--}e[2*n+a]===s?yc(t,e,n,o):(o++,yc(t,e,o,r)),o<=i&&(n=o+1),i<=o&&(r=o-1)}}function yc(t,e,i,n){Rx(t,i,n),Rx(e,2*i,2*n),Rx(e,2*i+1,2*n+1)}function Rx(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function qk(t,e,i,n){const r=t-i,a=e-n;return r*r+a*a}const Nfe={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Bk=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),$s=2,Xa=3,Ix=4,Ya=5,Gk=6;class jfe{constructor(e){this.options=Object.assign(Object.create(Nfe),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:i,minZoom:n,maxZoom:r}=this.options,a=`prepare ${e.length} points`;this.points=e;const s=[];for(let o=0;o<e.length;o++){const u=e[o];if(!u.geometry)continue;const[h,d]=u.geometry.coordinates,c=Bk(Jg(h)),f=Bk(Qg(d));s.push(c,f,1/0,o,-1,1),this.options.reduce&&s.push(0)}let l=this.trees[r+1]=this._createTree(s);for(let o=r;o>=n;o--){const u=+Date.now();l=this.trees[o]=this._createTree(this._cluster(l,o))}return this}getClusters(e,i){let n=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let a=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,a=180;else if(n>a){const d=this.getClusters([n,r,180,s],i),c=this.getClusters([-180,r,a,s],i);return d.concat(c)}const l=this.trees[this._limitZoom(i)],o=l.range(Jg(n),Qg(s),Jg(a),Qg(r)),u=l.data,h=[];for(const d of o){const c=this.stride*d;h.push(u[c+Ya]>1?Vk(u,c,this.clusterProps):this.points[u[c+Xa]])}return h}getChildren(e){const i=this._getOriginId(e),n=this._getOriginZoom(e),r="No cluster with the specified id.",a=this.trees[n];if(!a)throw new Error(r);const s=a.data;if(i*this.stride>=s.length)throw new Error(r);const l=this.options.radius/(this.options.extent*Math.pow(2,n-1)),o=s[i*this.stride],u=s[i*this.stride+1],h=a.within(o,u,l),d=[];for(const c of h){const f=c*this.stride;s[f+Ix]===e&&d.push(s[f+Ya]>1?Vk(s,f,this.clusterProps):this.points[s[f+Xa]])}if(d.length===0)throw new Error(r);return d}getLeaves(e,i,n){i=i||10,n=n||0;const r=[];return this._appendLeaves(r,e,i,n,0),r}getTile(e,i,n){const r=this.trees[this._limitZoom(e)],a=Math.pow(2,e),{extent:s,radius:l}=this.options,o=l/s,u=(n-o)/a,h=(n+1+o)/a,d={features:[]};return this._addTileFeatures(r.range((i-o)/a,u,(i+1+o)/a,h),r.data,i,n,a,d),i===0&&this._addTileFeatures(r.range(1-o/a,u,1,h),r.data,a,n,a,d),i===a-1&&this._addTileFeatures(r.range(0,u,o/a,h),r.data,-1,n,a,d),d.features.length?d:null}getClusterExpansionZoom(e){let i=this._getOriginZoom(e)-1;for(;i<=this.options.maxZoom;){const n=this.getChildren(e);if(i++,n.length!==1)break;e=n[0].properties.cluster_id}return i}_appendLeaves(e,i,n,r,a){const s=this.getChildren(i);for(const l of s){const o=l.properties;if(o&&o.cluster?a+o.point_count<=r?a+=o.point_count:a=this._appendLeaves(e,o.cluster_id,n,r,a):a<r?a++:e.push(l),e.length===n)break}return a}_createTree(e){const i=new Ax(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)i.add(e[n],e[n+1]);return i.finish(),i.data=e,i}_addTileFeatures(e,i,n,r,a,s){for(const l of e){const o=l*this.stride,u=i[o+Ya]>1;let h,d,c;if(u)h=Uk(i,o,this.clusterProps),d=i[o],c=i[o+1];else{const p=this.points[i[o+Xa]];h=p.properties;const[v,m]=p.geometry.coordinates;d=Jg(v),c=Qg(m)}const f={type:1,geometry:[[Math.round(this.options.extent*(d*a-n)),Math.round(this.options.extent*(c*a-r))]],tags:h};let g;u||this.options.generateId?g=i[o+Xa]:g=this.points[i[o+Xa]].id,g!==void 0&&(f.id=g),s.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,i){const{radius:n,extent:r,reduce:a,minPoints:s}=this.options,l=n/(r*Math.pow(2,i)),o=e.data,u=[],h=this.stride;for(let d=0;d<o.length;d+=h){if(o[d+$s]<=i)continue;o[d+$s]=i;const c=o[d],f=o[d+1],g=e.within(o[d],o[d+1],l),p=o[d+Ya];let v=p;for(const m of g){const y=m*h;o[y+$s]>i&&(v+=o[y+Ya])}if(v>p&&v>=s){let m=c*p,y=f*p,_,w=-1;const b=((d/h|0)<<5)+(i+1)+this.points.length;for(const C of g){const x=C*h;if(o[x+$s]<=i)continue;o[x+$s]=i;const S=o[x+Ya];m+=o[x]*S,y+=o[x+1]*S,o[x+Ix]=b,a&&(_||(_=this._map(o,d,!0),w=this.clusterProps.length,this.clusterProps.push(_)),a(_,this._map(o,x)))}o[d+Ix]=b,u.push(m/v,y/v,1/0,b,-1,v),a&&u.push(w)}else{for(let m=0;m<h;m++)u.push(o[d+m]);if(v>1)for(const m of g){const y=m*h;if(!(o[y+$s]<=i)){o[y+$s]=i;for(let _=0;_<h;_++)u.push(o[y+_])}}}}return u}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,i,n){if(e[i+Ya]>1){const s=this.clusterProps[e[i+Gk]];return n?Object.assign({},s):s}const r=this.points[e[i+Xa]].properties,a=this.options.map(r);return n&&a===r?Object.assign({},a):a}}function Vk(t,e,i){return{type:"Feature",id:t[e+Xa],properties:Uk(t,e,i),geometry:{type:"Point",coordinates:[qfe(t[e]),Bfe(t[e+1])]}}}function Uk(t,e,i){const n=t[e+Ya],r=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,a=t[e+Gk],s=a===-1?{}:Object.assign({},i[a]);return Object.assign(s,{cluster:!0,cluster_id:t[e+Xa],point_count:n,point_count_abbreviated:r})}function Jg(t){return t/360+.5}function Qg(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function qfe(t){return(t-.5)*360}function Bfe(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var Hk=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t._t("default")],2)},Gfe=[];Hk._withStripped=!0;const Vfe={name:"v-super-cluster",extends:rr,inject:["VMap"],props:{layerId:{type:String,default(){return`cluster-layer-${He()}`}},features:{type:Array,default(){return[]}},FeatureStyle:{type:[Array,void 0],default(){}},cluster:{type:Object},overlay:{type:Object}},data(){return{layer:null,clusters:null,featureChildren:[],featureCluster:!1,total:0}},computed:{map(){return this.VMap.map}},watch:{features:{handler(){this.dispose(),this.init()},immediate:!1,deep:!0},visible:{handler(t){this.layer.setVisible(t)},immediate:!1},zIndex:{handler(t){this.layer.setZIndex(t)},immediate:!1},maxZoom:{handler(t){this.layer.setMaxZoom(t)},immediate:!1},minZoom:{handler(t){this.layer.setMinZoom(t)},immediate:!1},extent:{handler(t){this.layer.setExtent(t)},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.dispose()},methods:{getGeoFeatures(){return this.features.map(t=>({type:"Feature",geometry:{type:"Point",coordinates:t.coordinates},properties:t}))},styleFunction(t,e){const i=e.get("cluster")||0,n=e.get("point_count_abbreviated")||0;let r=t[n];if(i){if(!r){let a={};a={image:new Hi({radius:4,fill:new ot({color:"blue"})}),text:new Pn({font:"16px sans-serif",text:n.toString()})},Je(this.cluster,"style")?(r=Ot(this.cluster.style),r.getText().setText(n.toString())):r=new _t(a),t[n]=r}}else{const a=e.get("style");r=Ot(a)}return r},init(){this.clusters=new jfe(this.cluster),this.clusters.load(this.getGeoFeatures()),this.total=this.clusters.points.length;const t=this.map.getView().calculateExtent(this.map.getSize()),e=this.clusters.getClusters(t,this.map.getView().getZoom()),i={type:"FeatureCollection",features:e},n={};this.layer=new Ri(Qe(Oe({},this.$props),{source:new Ln({features:new Ow().readFeatures(i).map(r=>{const a=r.get("properties");if(a&&typeof a=="object")for(const s in a)Object.prototype.hasOwnProperty.call(a,s)&&r.set(s,a[s]);return r})}),style:r=>this.styleFunction(n,r)})),this.layer.set("cluster",!0),this.layer.set("id",this.layerId),this.layer.set("type","vector"),this.layer.set("users",!0),this.zIndex&&this.layer.setZIndex(this.zIndex),this.map.addLayer(this.layer),this.map.getView().on("change:resolution",()=>{this.map.once("moveend",r=>{const a=this.clusters.getClusters(t,this.map.getView().getZoom()),s={type:"FeatureCollection",features:a};this.layer.getSource().clear(),this.layer.getSource().addFeatures(new Ow().readFeatures(s).map(l=>{const o=l.get("properties");if(o&&typeof o=="object")for(const u in o)Object.prototype.hasOwnProperty.call(o,u)&&l.set(u,o[u]);return l}))})}),this.map.on("singleclick",r=>this.eventHandler("singleclick",r))},getFeatureAtPixel(t){return this.map.forEachSmFeatureAtPixel(t,(e,i)=>{if(i.get("id")===this.layer.get("id"))return e},{})},eventHandler(t,e){const{pixel:i}=e,n=this.getFeatureAtPixel(i);this.$emit(t,e,n)},getLeaves(t,e){return this.clusters.getLeaves(t,e)},dispose(){this.layer.getSource().clear(),this.map.removeLayer(this.layer)}}},$k={};var Wk=Oi(Vfe,Hk,Gfe,!1,Ufe,null,null,null);function Ufe(t){for(let e in $k)this[e]=$k[e]}Wk.options.__file="src/components/layers/cluster/index.vue";const _c=function(){return Wk.exports}();_c.install=t=>{t.component(_c.name,_c)};const Zk=[Bu,Gu,Vu,jo,Hu,$u,Ku,Ju,Qu,eh,th,pc,gc,_c],Mx=function(t){Mx.installed||Zk.forEach(e=>{t.component(e.name,e)})};typeof window!="undefined"&&window.Vue&&Mx(window.Vue);const Hfe=Oe({install:Mx},Zk);ht.VDraw=eh,ht.VEcharts=gc,ht.VGraphic=Qu,ht.VHeatmap=Ju,ht.VImage=$u,ht.VMap=Bu,ht.VMeasure=th,ht.VOverlay=Vu,ht.VOverview=Gu,ht.VRoute=Ku,ht.VSuperCluster=_c,ht.VTile=jo,ht.VTrack=pc,ht.VVector=Hu,ht.default=Hfe,Object.defineProperties(ht,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|