v-ol-map 1.4.10 → 1.4.11
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 -0
- package/lib/ol-map.umd.js.map +1 -0
- package/package.json +1 -1
package/lib/ol-map.umd.js
CHANGED
|
@@ -129,3 +129,4 @@
|
|
|
129
129
|
gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;
|
|
130
130
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
131
131
|
}`,uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(pa);function W_(i){for(var e=1,t=256,n=$t(e,t),r=n.createLinearGradient(0,0,e,t),o=1/(i.length-1),a=0,s=i.length;a<s;++a)r.addColorStop(a*o,i[a]);return n.fillStyle=r,n.fillRect(0,0,e,t),n.canvas}const X_=$_,Y_={name:"v-heatmap",render(i,e){return null},extends:_i,inject:["VMap"],data(){return{layer:null}},props:{layerId:{type:String,default(){return`heatmap-layer-${Y()}`}},source:{type:[Object,void 0],default(){return{features:[]}}},features:{type:Array,default(){return[]}},blur:{type:Number,default:15},radius:{type:Number,default:8},weight:{type:[String,Function],default:"weight"},gradient:{type:Array,default(){return["#00f","#0ff","#0f0","#ff0","#f00"]}}},watch:{features:{handler(i){if(this.layer.getSource().clear(),i&&i.length>0){const e=We(i,this.map);this.layer.getSource().addFeatures(e)}},immediate:!1},blur:{handler(i){this.layer.setBlur(i)},immediate:!1},radius:{handler(i){this.layer.setRadius(i)},immediate:!1},gradient:{handler(i){this.layer.setGradient(i)},immediate:!1,deep:!0},visible:{handler(i){this.layer.setVisible(i)},immediate:!1},zIndex:{handler(i){this.layer.setZIndex(i)},immediate:!1},maxZoom:{handler(i){this.layer.setMaxZoom(i)},immediate:!1},minZoom:{handler(i){this.layer.setMinZoom(i)},immediate:!1},extent:{handler(i){this.layer.setExtent(i)},immediate:!1}},computed:{map(){return this.VMap.map}},mounted(){const i=ho(this.source,this.map);if(this.source.features.length<=0&&this.features.length>0){const t=We(this.features,this.map);i.addFeatures(t)}const e=gt(H({},this.$props),{source:i});this.layer=new X_(e),this.layer.set("id",this.layerId),this.layer.set("type","heatmap"),this.layer.set("users",!0),this.layer.setZIndex(1),this.map.addLayer(this.layer)},beforeDestroy(){this.layer.getSource().clear(),this.map.removeLayer(this.layer)}};let Z_,H_;const gg={};var K_=Ee(Y_,Z_,H_,!1,J_,null,null,null);function J_(i){for(let e in gg)this[e]=gg[e]}const wo=function(){return K_.exports}();wo.install=i=>{i.component(wo.name,wo)};const Q_={name:"v-graphic",render(i,e){return null},extends:_i,inject:["VMap"],data(){return{layer:null}},props:{layerId:{type:String,default(){return`graphic-layer-${Y()}`}},features:{type:Array,default(){return[]}},featureStyle:{type:Object}},computed:{map(){return this.VMap.map}},watch:{features:{handler(i){this.layer.getSource().refresh()},immediate:!1},visible:{handler(i){this.layer.setVisible(i)},immediate:!1},zIndex:{handler(i){this.layer.setZIndex(i)},immediate:!1},maxZoom:{handler(i){this.layer.setMaxZoom(i)},immediate:!1},minZoom:{handler(i){this.layer.setMinZoom(i)},immediate:!1},extent:{handler(i){this.layer.setExtent(i)},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.layer.dispose()},methods:{init(){let i;this.featureStyle?Z7(this.featureStyle.icon).then(e=>{i=this.setSource(e),this.setLayer(i)}):(i=this.setSource(),this.setLayer(i))},setSource(i){const e=new $l({canvasFunction:(t,n,r,o,a)=>{const s=[],u=document.createElement("canvas"),l=o[0]/r,h=o[1]/r,c=Sh(u.getContext("2d"),{size:[l,h]});i&&c.setStyle(i);const g=this.map.getSize(),f=[(l-g[0])/2,(h-g[1])/2],d=-this.map.getView().getRotation(),p=this.map.getPixelFromCoordinate(this.map.getView().getCenter());return this.features.length>0&&this.features.forEach(y=>{const v=y.coordinates,_=this.map.getPixelFromCoordinate(v),m=function(C,T,S){return[Math.cos(T)*(C[0]-S[0])-Math.sin(T)*(C[1]-S[1])+S[0],Math.sin(T)*(C[0]-S[0])+Math.cos(T)*(C[1]-S[1])+S[1]]}(function(C,T,S){return[(C[0]-T[0])*S+T[0],(C[1]-T[1])*S+T[1]]}(_,p,1),d,p),x=[m[0]+f[0],m[1]+f[1]],w=new Lt(x,"XY"),E=new Nt(w);E._coordinates=v;for(const C in y)Object.prototype.hasOwnProperty.call(y,C)&&E.set(C,y[C]);ft(y,"style")?(i=Qt(y.style),c.drawFeature(E,i)):c.drawGeometry(w),E._style=i,s.push(E)}),e.set("graphics",s),u}});return e},setLayer(i){const e=gt(H({},this.$props),{source:i});this.layer=new vl(e),this.layer.set("id",this.layerId),this.layer.set("type","graphic"),this.layer.set("users",!0),this.layer.setZIndex(1),this.map.addLayer(this.layer)}}};let tm,em;const fg={};var nm=Ee(Q_,tm,em,!1,im,null,null,null);function im(i){for(let e in fg)this[e]=fg[e]}const Co=function(){return nm.exports}();Co.install=i=>{i.component(Co.name,Co)};const rm={name:"v-draw",extends:_i,inject:["VMap"],render(i,e){return null},props:{layerId:{type:String,default(){return`draw-layer-${Y()}`}},features:{type:Array,default(){return[]}},source:{type:Object,default(){return{features:[]}}},featureStyle:{type:[Object,Boolean],default(){return!1}},type:{type:String,default:""},clickTolerance:{type:Number,default:6},dragVertexDelay:{type:Number,default:500},snapTolerance:{type:Number,default:12},stopClick:{type:Boolean,default(){return!1}},maxPoints:{type:Number,default:void 0},minPoints:{type:Number,default:void 0},endRight:{type:Boolean,default(){return!1}},editable:{type:Boolean,default(){return!1}},clear:{type:Boolean,default(){return!1}},wrapX:{type:Boolean,default(){return!1}},finishCondition:{type:Object},geometryFunction:{type:Function},geometryName:{type:String},condition:{type:Object},freehand:{type:Boolean,default(){return!1}},freehandCondition:{type:Object}},data(){return{layer:null,draw:null,modify:null,select:null}},computed:{map(){return this.VMap.map}},watch:{type:{handler(i){this.dispose(),i&&this.initDraw()},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.dispose()},methods:{init(){const i=ho(this.source,this.map);if(this.source.features.length<=0&&this.features.length>0){const t=We(this.features,this.map);i.addFeatures(t)}const e=gt(H({},this.$props),{source:i});this.layer=new ae(e),this.layer.setStyle(t=>t.get("style")?Qt(t.get("style")):this.featureStyle?Qt(this.featureStyle):Qt({fill:{color:"rgba(67,126,255,0.15)"},stroke:{color:"rgba(67,126,255,1)",width:1}})),this.layer.set("id",this.layerId),this.layer.set("type","draw"),this.layer.set("users",!0),this.layer.setZIndex(1),this.map.addLayer(this.layer),this.type&&this.initDraw()},initDraw(){const i={source:this.layer.getSource(),type:this.type,freehand:this.freehand,clickTolerance:this.clickTolerance,features:We(this.features,this.map),dragVertexDelay:this.dragVertexDelay,snapTolerance:this.snapTolerance,stopClick:this.stopClick,maxPoints:this.maxPoints,minPoints:this.minPoints,wrapX:this.wrapX,geometryName:this.geometryName,geometryFunction:this.geometryFunction};if(this.type==="Rectangle"){const e=gt(H({},i),{type:"Circle",geometryFunction:N8()});this.draw=new ao(e)}else if(this.type==="Square"){const e=gt(H({},i),{type:"Circle",geometryFunction:q8(4)});this.draw=new ao(e)}else if(this.type.indexOf("Star")>-1){const e=this.type.split("-")[1]||5,t=function(r,o){const a=r[0],s=r[r.length-1],u=a[0]-s[0],l=a[1]-s[1],h=Math.sqrt(u*u+l*l),c=Math.atan2(l,u),g=[],f=Number(e)*2;for(let d=0;d<f;++d){const p=c+d*2*Math.PI/f,y=d%2===0?1:.5,v=h*y*Math.cos(p),_=h*y*Math.sin(p);g.push([a[0]+v,a[1]+_])}return g.push(g[0].slice()),o?o.setCoordinates([g]):o=new cn([g]),o},n=gt(H({},i),{type:"Circle",geometryFunction:t});this.draw=new ao(n)}else this.draw=new ao(i);this.draw.set("type","draw"),this.map.addInteraction(this.draw),this.endRight&&this.map.on("contextmenu",e=>{this.draw.setActive(!1)}),this.clear&&this.draw.on("drawstart",e=>{this.layer.getSource().clear()}),this.draw.on("drawstart",e=>{this.$emit("drawstart",e,this.map)}),this.draw.on("drawend",e=>{this.$emit("drawend",e,this.map)}),this.editable&&(this.select=new pc,this.select.set("type","select"),this.map.addInteraction(this.select),this.modify=new Z2({features:this.select.getFeatures()}),this.modify.set("type","modify"),this.map.addInteraction(this.modify),this.modify.on("modifystart",e=>{this.$emit("modifystart",e,this.map)}),this.modify.on("modifyend",e=>{this.$emit("modifyend",e,this.map)}))},dispose(){this.layer.getSource().clear(),this.map.removeInteraction(this.draw),this.map.removeInteraction(this.select),this.map.removeInteraction(this.modify)}}};let om,am;const dg={};var sm=Ee(rm,om,am,!1,um,null,null,null);function um(i){for(let e in dg)this[e]=dg[e]}const Eo=function(){return sm.exports}();Eo.install=i=>{i.component(Eo.name,Eo)};const lm={name:"v-measure",extends:_i,inject:["VMap"],render(i,e){return null},props:{layerId:{type:String,default(){return`measure-layer-${Y()}`}},features:{type:Array,default(){return[]}},source:{type:Object,default(){return{features:[]}}},featureStyle:{type:[Object,Boolean],default(){return!1}},type:{type:String,default:""},clear:{type:Boolean,default:!1},segments:{type:Boolean,default:!1},endRight:{type:Boolean,default:!0}},data(){return{layer:null,draw:null,modify:null,select:null}},computed:{map(){return this.VMap.map}},watch:{type:{handler(i){this.dispose(),i&&this.init()},immediate:!1}},mounted(){this.init()},beforeDestroy(){this.map.removeLayer(this.layer),this.dispose()},methods:{init(){const i=ho(this.source,this.map);if(this.source.features.length<=0&&this.features.length>0){const y=We(this.features,this.map);i.addFeatures(y)}const e=new Et({fill:new it({color:"rgba(255, 255, 255, 0.2)"}),stroke:new mt({color:"rgba(0, 0, 0, 0.5)",lineDash:[10,10],width:2}),image:new qe({radius:5,stroke:new mt({color:"rgba(0, 0, 0, 0.7)"}),fill:new it({color:"rgba(255, 255, 255, 0.2)"})})}),t=new Et({text:new Ge({font:"14px Calibri,sans-serif",fill:new it({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new it({color:"rgba(0, 0, 0, 0.7)"}),padding:[3,3,3,3],textBaseline:"bottom",offsetY:-15}),image:new _2({radius:8,points:3,angle:Math.PI,displacement:[0,10],fill:new it({color:"rgba(0, 0, 0, 0.7)"})})}),n=new Et({text:new Ge({font:"12px Calibri,sans-serif",fill:new it({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new it({color:"rgba(0, 0, 0, 0.4)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})}),r=new Et({image:new qe({radius:5,stroke:new mt({color:"rgba(0, 0, 0, 0.7)"}),fill:new it({color:"rgba(0, 0, 0, 0.4)"})}),text:new Ge({text:"\u7F16\u8F91\u6D4B\u91CF",font:"12px Calibri,sans-serif",fill:new it({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new it({color:"rgba(0, 0, 0, 0.7)"}),padding:[2,2,2,2],textAlign:"left",offsetX:15})}),o=new Et({text:new Ge({font:"12px Calibri,sans-serif",fill:new it({color:"rgba(255, 255, 255, 1)"}),backgroundFill:new it({color:"rgba(0, 0, 0, 0.4)"}),padding:[2,2,2,2],textBaseline:"bottom",offsetY:-12}),image:new _2({radius:6,points:3,angle:Math.PI,displacement:[0,8],fill:new it({color:"rgba(0, 0, 0, 0.4)"})})}),a=[o],s=function(y){const v=F3(y,{projection:"EPSG:4326"});let _;return v>100?_=Math.round(v/1e3*100)/100+" km":_=Math.round(v*100)/100+" m",_},u=function(y){const v=M3(y,{projection:"EPSG:4326"});let _;return v>1e4?_=Math.round(v/1e6*100)/100+" km\xB2":_=Math.round(v*100)/100+" m\xB2",_};this.modify=new Z2({source:i,style:r});let l;const h=(y,v,_,m)=>{const x=[e],w=y.getGeometry(),E=w.getType();let C,T,S;if((!_||_===E)&&(E==="Polygon"?(C=w.getInteriorPoint(),T=u(w),S=new Jt(w.getCoordinates()[0])):E==="LineString"&&(C=new Lt(w.getLastCoordinate()),T=s(w),S=w)),v&&S){let b=0;S.forEachSegment(function(O,j){const R=new Jt([O,j]),P=s(R);a.length-1<b&&a.push(o.clone());const A=new Lt(R.getCoordinateAt(.5));a[b].setGeometry(A),a[b].getText().setText(P),x.push(a[b]),b++})}return T&&(t.setGeometry(C),t.getText().setText(T),x.push(t)),m&&E==="Point"&&!this.modify.getOverlay().getSource().getFeatures().length&&(l=w,n.getText().setText(m),x.push(n)),x},c=gt(H({},this.$props),{source:i});this.layer=new ae(c),this.layer.setStyle(y=>h(y,this.segments)),this.layer.set("id",this.layerId),this.layer.set("type","measure"),this.layer.set("users",!0),this.layer.setZIndex(1),this.map.addLayer(this.layer),this.modify.set("type","measure"),this.map.addInteraction(this.modify);const g=this.type,f="\u70B9\u51FB\u7EE7\u7EED\u6D4B\u91CF"+(g==="Polygon"?"\u9762\u79EF":"\u957F\u5EA6"),d="\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF";let p=d;this.draw=new ao({source:i,type:g,style:y=>h(y,this.segments,g,p)}),this.draw.set("type","measure"),this.draw.set("measureDraw",!0),this.draw.on("drawstart",y=>{this.clear&&i.clear(),this.modify.setActive(!1),p=f,this.$emit("measurestart",y,this.map)}),this.draw.on("drawend",y=>{r.setGeometry(l),this.modify.setActive(!0),this.map.once("pointermove",()=>{r.setGeometry()}),p=d,this.endRight&&this.draw.setActive(!1),this.$emit("measureend",y,this.map)}),this.modify.setActive(!0),this.map.addInteraction(this.draw)},dispose(){this.layer.getSource().clear(),this.map.removeInteraction(this.draw),this.map.removeInteraction(this.select),this.map.removeInteraction(this.modify),this.map.removeLayer(this.layer)}}};let hm,cm;const pg={};var gm=Ee(lm,hm,cm,!1,fm,null,null,null);function fm(i){for(let e in pg)this[e]=pg[e]}const To=function(){return gm.exports}();To.install=i=>{i.component(To.name,To)};function dm(i,e){let t;return e.getLayers().forEach(n=>{n&&n.get("id")===i&&(t=n)}),t}const o3=class{constructor(e,t,n,r,o,a,s,u,l){!t||t.length<1||(this.id=l.id,this.changeCarRotate=l.changeCarRotate,this.centerAtCar=l.centerAtCar,this._moving=!0,this._ismove=!1,this._map=e,this._labelShow=a,this._timeContentClass=s,this._vacuate=r,this._wholePathInfo=t,this._timeOverlayList=[],r?(this._pathInfo=n,this._convertPaths(n)):(this._pathInfo=t,this._convertPaths(t)),this._vacuatePath=n,this._path=[],this._passPath=[],this._pointIndexDistance=20,this._tracePoints=[],this._tracePointsModePlay=o,this._traceTimedivDom=e.traceTimedivDom,this._tracePointsFromTime=[],this._traceEnd=!1,this.traceLayer=new ae({source:new hn,zIndex:99}),this.traceLayer.set("isTrack",!0),e.addLayer(this.traceLayer),this.tracePassLayer=new ae({source:new hn,zIndex:100}),this.tracePassLayer.set("isTrack",!0),e.addLayer(this.tracePassLayer),this.arrowsLayer=new ae({source:new hn,zIndex:101}),this.arrowsLayer.set("isTrack",!0),e.addLayer(this.arrowsLayer),this.carLayer=new ae({source:new hn,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(l),this._initFlag=1,this._showTracePoint=u)}};let K=o3;Ae(K,"track",o3),K.prototype._setOptions=function(i){if(!!i)for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(this._opts[e]=i[e])},K.prototype.getSpeed=function(){return this._opts.speed},K.prototype.getSpeedUp=function(){return this._speedUp},K.prototype.getPaths=function(){return this._pathInfo},K.prototype.getTraceIndex=function(){return this._pointIndex},K.prototype.setTraceIndex=function(i){this._pointIndex=i;const e=this._path[i];this.carMarker.setPosition(e)},K.prototype.getPercentnum=function(){const i=this._tracePoints,e=this.carMarker.getPosition();for(let t=0;t<i.length;t++)if(e.toString()===i[t].coordinate.toString())return parseFloat((t/i.length).toFixed(2))},K.prototype.setPercentnum=function(i){const e=this._tracePoints,t=this._tracePointsFromTime,n=Math.round(e.length*i),r=e[n].coordinate;this.carMarker.setPosition(r);for(let o=0;o<t.length;o++){const a=t[o].temBreakPointsFromTime;for(let s=0;s<a.length;s++)a[s].coordinate.toString()===r.toString()&&(this._traceIndex=s,this._pointIndex=o)}},K.prototype._showTimePopup=function(i){const e=this;e._traceTime=e._pathInfo[0].time,e._fromPause&&(e._traceTime=e._traceTimedivDom.innerText);const t=e._pathInfo[e._pathInfo.length-1].time,n=new Date(t).getTime();n>i.maxEndTime&&(i.maxEndTime=n),e._intervalTimeFlag=setInterval(function(){if(!e._traceEnd&&!e._fromPause&&!e._fromStop){if(e._traceTime=new Date(e._traceTime).getTime()+1e3*e._speedUp,i.maxEndTime<e._traceTime){e._traceEnd=!0,e._traceTimedivDom.innerText=t;return}e._traceTime%1e3===0&&(e._traceTime=vm(new Date(e._traceTime)),e._traceTimedivDom.innerText=e._traceTime)}},1e3)},K.prototype._setTraceTime=function(i){const e=this,t=e._tracePointsFromTime;if(e._traceTimedivDom.innerText=i,e._traceTime=i,e._opts.speed===0){let n=Number.MAX_VALUE;const r=new Date(e._traceTimedivDom.innerText).getTime();if(r>0||!isNaN(r))for(let o=0;o<t.length;o++){const a=t[o].temBreakPointsFromTime;for(let s=0;s<a.length;s++)Math.abs(r-a[s].thisTimeSecond)<n&&(n=Math.abs(r-a[s].thisTimeSecond),e._pointIndex=o,e._traceIndex=s)}e._fromStop&&(e._pointIndex=0,e._traceIndex=0),(e._traceTimedivDom.innerText===""||e._fromPause||e._fromStop)&&e._showTimePopup(e._map)}},K.prototype._convertPaths=function(i){this._path=[];for(let e=0;e<i.length;e++)this._path.push([i[e].longitude,i[e].latitude])},K.prototype.start=function(){this._moving=!0;const i=this,e=i.getTracePoints(1);i._tracePoints=e.breakPoints,i._tracePointsFromTime=e.breakPointsFromTime,!(i._path.length<1)&&(i._tracePointsModePlay==="skip"?i.tracePointsPlay():i._tracePointsModePlay==="animation"&&i.timePointsPlay())},K.prototype.tracePointsPlay=function(){const i=this,e=i._pathInfo,t=i._passPath;if(t.length===0&&i.tracePassLayer.getSource().clear(),!i._ismove)i._addMarker(),i._addInfoWin(),i._intervalTraceFlag=setInterval(function(){if(i._fromPause||i._fromStop||i._pointIndex>=e.length)return;if(i._pointIndex+=i._speedUp,i._pointIndex>=e.length&&(i._pointIndex=e.length-1),i.carMarker.setPosition([e[i._pointIndex].longitude,e[i._pointIndex].latitude]),i._pointIndex===1&&t.push([e[i._pointIndex-1].longitude,e[i._pointIndex-1].latitude]),t.push([e[i._pointIndex].longitude,e[i._pointIndex].latitude]),i._opts.passFlag){const a=new Nt({geometry:new Jt([[e[i._pointIndex-1].longitude,e[i._pointIndex-1].latitude],[e[i._pointIndex].longitude,e[i._pointIndex].latitude]])});a.setStyle(new Et({stroke:new mt({color:i._opts.passlineColor,width:5})})),i.tracePassLayer.getSource().addFeature(a)}i._opts.showInfoWin&&(i._carInfoWin.getElement().innerText=e[i._pointIndex].info);const n=i._map.getView().calculateExtent(),r=i.carMarker.getPosition();!ze(n,r)&&i.centerAtCar&&i._map.getView().animate({center:r})},1e3);else if(i._fromPause){if(!i._fromStop){if(i._pointIndex++,i.carMarker.setPosition([e[i._pointIndex].longitude,e[i._pointIndex].latitude]),i._opts.passFlag){const n=new Nt({geometry:new Jt([[e[i._pointIndex-1].longitude,e[i._pointIndex-1].latitude],[e[i._pointIndex].longitude,e[i._pointIndex].latitude]])});n.setStyle(new Et({stroke:new mt({color:i._opts.passlineColor,width:5})})),i.tracePassLayer.getSource().addFeature(n)}i._ismove=!1}}else return;this._fromPause=!1,this._fromStop=!1},K.prototype.timePointsPlay=function(){const i=this,e=i._tracePoints,t=i._tracePointsFromTime,n=i._passPath;if(n.length===0&&i.tracePassLayer.getSource().clear(),i._opts.speed===0){let r=Number.MAX_VALUE;const o=new Date(i._traceTimedivDom.innerText).getTime();if(o>0||!isNaN(o))for(let a=0;a<t.length;a++){const s=t[a].temBreakPointsFromTime;for(let u=0;u<s.length;u++)Math.abs(o-s[u].thisTimeSecond)<r&&(r=Math.abs(o-s[u].thisTimeSecond),i._pointIndex=a,i._traceIndex=u)}i._fromStop&&(i._pointIndex=0,i._traceIndex=0),(i._traceTimedivDom.innerText===""||i._fromPause||i._fromStop)&&i._showTimePopup(i._map)}if(!i._ismove)i._addMarker(),i._addInfoWin(),i._intervalTraceFlag=setInterval(function(){if(i._fromPause||i._fromStop)return;const r=i._opts.speed*1e3/3600;if(i._pointIndex>=t.length)return;const o=t[i._pointIndex].temBreakPointsFromTime,a=t[i._pointIndex].differenceTime,s=t[i._pointIndex].length;let u=0;if(r===0?u=(s/a/50).toFixed(2)*10*i._speedUp:u=(r/50).toFixed(2)*10,i._fromPause||i._fromStop||i._pointIndex>=e.length-1||i._pointIndex>=t.length)return;if(i._traceIndex+=u,i._traceIndex=Math.round(i._traceIndex),i._traceIndex>=o.length){i._traceIndex=o.length-1,i._pointIndex++;const g=o.slice(0,i._traceIndex);for(let d=0;d<g.length;d++)n.push(g[d].coordinate);if(i._opts.passFlag){const d=new Nt({geometry:new Jt(n)});d.setStyle(new Et({stroke:new mt({color:i._opts.passlineColor,width:5})})),i.tracePassLayer.getSource().addFeature(d)}i.carMarker.setPosition(o[i._traceIndex].coordinate),i.changeCarRotate&&i.carMarker.setRotateAngle(o[i._traceIndex].rotate);const f=i._troughPointIndex(o[i._traceIndex].coordinate);i._opts.showInfoWin&&(i._pathInfo[f]?(i._carInfoWin.getElement().innerText=i._pathInfo[f].info,i._carInfoWin.setPosition([i._pathInfo[f].longitude,i._pathInfo[f].latitude])):(i._carInfoWin.getElement().innerText="",i._carInfoWin.setPosition(void 0))),i._traceIndex=0}else{const g=o.slice(Math.round(i._traceIndex-u),i._traceIndex);for(let d=0;d<g.length;d++)n.push(g[d].coordinate);if(i._opts.passFlag){const d=new Nt({geometry:new Jt(n)});d.setStyle(new Et({stroke:new mt({color:i._opts.passlineColor,width:5})})),i.tracePassLayer.getSource().addFeature(d)}i.carMarker.setPosition(o[i._traceIndex].coordinate),i.changeCarRotate&&i.carMarker.setRotateAngle(o[i._traceIndex].rotate);const f=i._troughPointIndex(e[i._pointIndex].coordinate);i._opts.showInfoWin&&(i._pathInfo[f]?(i._carInfoWin.getElement().innerText=i._pathInfo[f].info,i._carInfoWin.setPosition([i._pathInfo[f].longitude,i._pathInfo[f].latitude])):(i._carInfoWin.getElement().innerText="",i._carInfoWin.setPosition(void 0)))}const l=i._map.getView().calculateExtent(),h=i.carMarker.getPosition();!ze(l,h)&&i.centerAtCar&&i._map.getView().animate({center:h})},200);else if(i._fromPause)i._fromStop||(i._traceIndex++,i._ismove=!1);else return;this._fromPause=!1,this._fromStop=!1},K.prototype.setSpeed=function(i){this._opts.speed=i},K.prototype.setSpeedUp=function(i){this._speedUp=i},K.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)},K.prototype.pause=function(){this._moving=!1,this._ismove=!0,this._fromPause=!0,clearInterval(this._intervalTimeFlag)},K.prototype._addMarker=function(){const i=this;this.carMarker&&(this.carLayer.getSource().getFeatures().length>0&&this.carLayer.getSource().removeFeature(this.carMarker),clearInterval(this._intervalTraceFlag));const e=_m(this._path[0],this._opts);this.carLayer.getSource().addFeature(e),this.carMarker=e,e.on=function(t,n){if(t==="move"){const r=setInterval(function(){if(!i._moving)return;const o=e.getPosition(),a=i._pathInfo;for(let s=0;s<a.length;s++)o.toString()===a[s].longitude+","+a[s].latitude&&(n(s),s===a.length-1&&clearInterval(r))},200)}}},K.prototype._addInfoWin=function(){const i=this;if(!i._opts.showInfoWin)return;const e=i.carMarker.getPosition();if(i._carInfoWin){i._carInfoWin.setPosition(e);return}const t=document.createElement("div");t.className="carOverlay-class",t.innerText="";const n=new wa({element:document.getElementById(i._opts.overlay.element.toString()),position:e,stopEvent:!0,offset:[10,0]});i._carInfoWin=n,i._map.addOverlay(n)},K.prototype.getArrowPoints=function(i){const e=this._pathInfo,t=[];for(let n=0;n<e.length-1;n++){const r=[e[n].longitude,e[n].latitude],o=[e[n+1].longitude,e[n+1].latitude],a=this._map.getPixelFromCoordinate(r),s=this._map.getPixelFromCoordinate(o),l=vg([a,s]),h=Math.floor(l/i),c=this.getRotationFromPixel(a,s);for(let g=1;g<h+1;g++){const f=[a[0]+i*g*Math.cos(c),a[1]+i*g*Math.sin(c)],d=this._map.getCoordinateFromPixel(f);t.push({rotate:c,coordinate:d})}}return t},K.prototype.getTracePoints=function(i){const e=this._pathInfo,t=[],n=[];for(let r=0;r<e.length-1;r++){const o=[],a=[e[r].longitude,e[r].latitude],s=[e[r+1].longitude,e[r+1].latitude],u=e[r].time,l=e[r+1].time,h=new Date(u).getTime(),c=new Date(l).getTime(),g=c-h;if(g===0)continue;const f=G3(a),d=G3(s),y=vg([f,d]),v=Math.floor(y/i),_=this.getRotationFromPixel(f,d),m=this.getAngleFromPixel(f,d);for(let x=0;x<v+1;x++){const w=[f[0]+x*i*Math.cos(_),f[1]+x*i*Math.sin(_)],E=bf(w),C=h+Math.round(g/v)*x;t.push({rotate:m,coordinate:E,thisTimeSecond:C}),o.push({rotate:m,coordinate:E,thisTimeSecond:C})}y%i!==0&&(t.push({rotate:m,coordinate:s,thisTimeSecond:c}),o.push({rotate:m,coordinate:s,thisTimeSecond:c})),n.push({length:y,differenceTime:g/1e3,initTime:u,targetTime:l,temBreakPointsFromTime:o})}return{breakPoints:t,breakPointsFromTime:n}},K.prototype.getRotationFromPixel=function(i,e){if(!i)return!1;i={x:i[0],y:i[1]},e={x:e[0],y:e[1]};const t=Math.abs(e.x-i.x),n=Math.abs(e.y-i.y),r=Math.sqrt(t*t+n*n),o=Math.asin(n/r);let a=0;return e.y<i.y&&e.x===i.x?a=Math.PI*2/3:e.y>i.y&&e.x===i.x?a=Math.PI/2:e.y===i.y&&e.x<i.x?a=Math.PI:e.y===i.y&&e.x>i.x?a=0:e.y>i.y&&e.x>i.x?a=o:e.y>i.y&&e.x<i.x?a=Math.PI-o:e.y<i.y&&e.x<i.x?a=Math.PI+o:e.y<i.y&&e.x>i.x&&(a=Math.PI*2-o),a},K.prototype.getAngleFromPixel=function(i,e){i={x:i[0],y:i[1]},e={x:e[0],y:e[1]};const t=Math.abs(e.x-i.x),n=Math.abs(e.y-i.y),r=Math.sqrt(t*t+n*n),o=Math.round(Math.asin(n/r)/Math.PI*180);let a=0;return e.y<i.y&&e.x===i.x?a=270:e.y>i.y&&e.x===i.x?a=90:e.y===i.y&&e.x<i.x?a=180:e.y===i.y&&e.x>i.x?a=0:e.y>i.y&&e.x>i.x?a=360-o:e.y>i.y&&e.x<i.x?a=180+o:e.y<i.y&&e.x<i.x?a=180-o:e.y<i.y&&e.x>i.x&&(a=o),a},K.prototype._troughPointIndex=function(i){const e=this._pointIndexDistance,t=this._path;for(let n=0;n<t.length;n++){const r=t[n];if(Uo(r,i)<e)return n}return-1},K.prototype._traceLineSytle=function(i){const e=this._opts,t=e.lineWidth?e.lineWidth:5,n=e.lineColor?e.lineColor:"blue";return{route:new Et({stroke:new mt({width:t,color:n})}),node:new Et({image:new qe({radius:5,stroke:new mt({color:"white",width:0}),fill:new it({color:"green"})})}),start:new Et({image:new Ne(this._opts.startIcon),text:new Ge({font:"13px Microsoft Yahei",fill:new it({color:"#aa3300"}),stroke:new mt({color:"#fff",width:2}),textAlign:"left"})}),end:new Et({image:new Ne(this._opts.endIcon),text:new Ge({font:"13px Microsoft Yahei",fill:new it({color:"#aa3300"}),stroke:new mt({color:"#fff",width:2}),textAlign:"left"})})}[i]},K.prototype._initLinesAndMarkers=function(){const i=this,e=i._pathInfo,t=i._wholePathInfo;if(i._convertPaths(e),i._initFlag===1){i.traceNodes=[];for(const n in t){const r=Number(n),o=[t[r].longitude,t[r].latitude],a=t[r].id;if(r>0&&r<t.length-1){const s=new Nt({geometry:new Lt(o)});s.set("id",a),s.set("number",parseInt(r)+1),i._showTracePoint&&i.traceNodes.push(s),s.set("type","node"),s.on("mouseover",function(u){i._map.getInfoWindowById(u.coordinate.toString())&&i._map.getInfoWindowById(u.coordinate.toString()).setPosition(u.coordinate)}),s.on("mouseout",function(u){i._map.getInfoWindowById(this.getPosition().toString())&&i._map.getInfoWindowById(this.getPosition().toString()).setPosition(void 0)})}else if(r===0){const s=new Nt({geometry:new Lt([t[r].longitude,t[r].latitude])});s.set("type","start"),s.set("id",a),s.set("number",parseInt(r)+1),i.traceNodes.push(s)}else if(r===t.length-1){const s=new Nt({geometry:new Lt([t[r].longitude,t[r].latitude+1e-8])});s.set("type","end"),s.set("id",a),s.set("number",parseInt(r)+1),i.traceNodes.push(s)}}for(let n=0;n<i._pathInfo.length-1;n++){const r=[i._pathInfo[n].longitude,i._pathInfo[n].latitude],o=[i._pathInfo[n+1].longitude,i._pathInfo[n+1].latitude],a=new Nt({geometry:new Jt([r,o])});a.setStyle(i._traceLineSytle("route")),i.traceLayer.getSource().addFeature(a),i.traceLineList.push(a)}for(let n=0;n<i.traceNodes.length;n++){const r=i.traceNodes[n],o=i._traceLineSytle(r.get("type"));if(r.setStyle(o),r.getGeometry().getType()==="Point")for(let a=0;a<e.length;a++)r.get("id")===e[a].id&&i.traceLayer.getSource().addFeature(r)}}},K.prototype.setTraceLineColor=function(i){const e=this;e._opts.lineColor=i;const t=e.traceLineList;for(let n=0;n<t.length;n++)t[n].setStrokeColor(i);e.traceLayer.refresh()},K.prototype.setTraceLineWidth=function(i){const e=this;e._opts.lineWidth=i;const t=e.traceLineList;for(let n=0;n<t.length;n++)t[n].setStrokeWeight(i);e.traceLayer.refresh()},K.prototype._creatTimeOverlays=function(){const i=this,e=i._wholePathInfo,t=i._vacuatePath;if(i._timeOverlayList=[],i._labelShow){const n=[];for(let r=0;r<e.length;r++)for(let o=0;o<t.length;o++)if(t[o].longitude===e[r].longitude&&t[o].latitude===e[r].latitude){const a=[e[r].longitude,e[r].latitude];n.push({position:a,text:e[r].time})}typeof i.textLayer=="undefined"?(i.textLayer=mm(i._map,n,10),i.textLayer.set("id","lushuText"+new Date().getTime()),i._map.addLayer(i.textLayer)):typeof dm(i.textLayer.get("id"),i._map)=="undefined"&&i._map.addLayer(i.textLayer)}},K.prototype.createArrows=function(){const i=this,e=i.getArrowPoints(i._opts.arrowPixel);for(let t=0;t<e.length;t++){const n=e[t].coordinate,r=e[t].rotate,o=new Nt({geometry:new Lt(n)});o.setStyle(new Et({image:new Ne({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})})),i.arrowsLayer.getSource().addFeature(o)}},K.prototype.windowAddMouseWheel=function(){const i=this,e=function(t){t=t||window.event,t.wheelDelta?(t.wheelDelta>0&&i.arrowsLayer.getSource().clear(),t.wheelDelta<0&&i.arrowsLayer.getSource().clear()):t.detail&&(t.detail>0&&i.arrowsLayer.getSource().clear(),t.detail<0&&i.arrowsLayer.getSource().clear())};document.addEventListener&&document.addEventListener("DOMMouseScroll",e,!1),window.onmousewheel=document.onmousewheel=e},K.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(t=>t.get("isTrack")&&t.get("isTrack")===!0);e&&e.length>0&&e.forEach(t=>{t.getSource().clear(),this._map.removeLayer(t)})};function n3(i,e,t,n,r){n==="distance"?yg(i,e,t,r):n==="track"&&pm(i,e,t,r)}function yg(i,e,t,n){const r=[];e.forEach(function(a,s){r.push(a)});let o=!0;for(let a=0;a<r.length-1;a++)if(es(i,r[a],r[a+1])<t&&r.length>=3){o=!1,a+1<r.length-1||a===0?r.splice(a+1,1):r.splice(a,1);break}o?n(e):yg(i,r,t,n)}function pm(i,e,t,n){const r=e;r.forEach(function(s,u){s.id=u});const o=i3(i,r,[],0,r.length-1,t);o.push(r[0]),r.length>1&&o.push(r[r.length-1]);const a=o.sort(function(s,u){return s.id<u.id?-1:s.id>u.id?1:0});n(a)}const i3=function(i,e,t,n,r,o){if(n<r){let a=0,s=0;const u=e[n],l=e[r];for(let h=n+1;h<r;h++){const c=ym(i,u,l,e[h]);c>a&&(a=c,s=h)}a>=o&&(t.push(e[s]),i3(i,e,t,n,s,o),i3(i,e,t,s,r,o))}return t},ym=function(i,e,t,n){const r=Math.abs(es(i,e,t)),o=Math.abs(es(i,e,n)),a=Math.abs(es(i,t,n)),s=(r+o+a)/2;return Math.sqrt(Math.abs(s*(s-r)*(s-o)*(s-a)))*2/r},es=function(i,e,t){const n=e.latitude,r=t.latitude,o=e.longitude,a=t.longitude,s=i.getPixelFromCoordinate([o,n]),u=i.getPixelFromCoordinate([a,r]);return Math.sqrt(Math.pow(u[0]-s[0],2)+Math.pow(u[1]-s[1],2))};var vg=function(i){let e=0;for(let t=0,n=i.length-1;t<n;++t)i[t+1]&&(e+=Math.sqrt(Math.pow(i[t+1][0]-i[t][0],2)+Math.pow(i[t+1][1]-i[t][1],2)));return e};function vm(i){let e=i.getHours(),t=i.getMinutes(),n=i.getSeconds();const r=i.getFullYear();let o=i.getMonth(),a=i.getDate();return e<10&&(e="0"+e),t<10&&(t="0"+t),n<10&&(n="0"+n),o=o+1,o<10&&(o="0"+o),a<10&&(a="0"+a),r+"-"+o+"-"+a+" "+e+":"+t+":"+n}function _m(i,e){const t=new Nt({geometry:new Lt(i)});return t.setStyle(new Et({image:new Ne(e.carIcon)})),t}function mm(i,e,t){const n=[],r=new ae({source:new hn});return i.getView().getZoom()>=t&&_g(i,e,t,n,r),i.on("moveend",function(o){i.getView().getZoom()>=t?_g(i,e,t,n,r):r.getSource().clear()}),r}function _g(i,e,t,n,r){n=[],r.getSource().clear();for(let h=0;h<e.length;h++){const c=e[h],g=i.getPixelFromCoordinate(c.position);if(!ze(i.getView().calculateExtent(),c.position))continue;const f=/[\u4e00-\u9fa5]/g,d=c.text.match(f)?c.text.match(f).length:0,p=c.text.length-d,y=d*15+p*8,v=g[0]+10,_=g[0]+y+20,m=g[1]-32,x=g[1]-12,w=[v,parseInt((m+x)/2)],E={x:v,y:m},C={x:_,y:x},T=g[0]-y-20,S=g[0]-10,b=g[1]-32,O=g[1]-12,j=[S,parseInt((b+O)/2)],R={x:T,y:b},P={x:S,y:O},A=g[0]-y-20,I=g[0]-10,M=g[1]+12,k=g[1]+32,$=[I,parseInt((M+k)/2)],Z={x:A,y:M},st={x:I,y:k},z=g[0]+10,dt=g[0]+y+20,ut=g[1]+12,X=g[1]+32,jt=[z,parseInt((ut+X)/2)],Ut={x:z,y:ut},St={x:dt,y:X},wn=new So(E,C),Zt=new So(R,P),Hn=new So(Z,st),xe=new So(Ut,St);let le="rightTop",Dt=!0;for(let he=0;he<4;he++){for(let Le=0;Le<n.length;Le++){const Cn=n[Le];if(he===0){if(Dt=Cn.intersects(wn),!Dt)break}else if(he===1){if(Dt=Cn.intersects(Zt),!Dt)break}else if(he===2){if(Dt=Cn.intersects(Hn),!Dt)break}else if(he===3&&(Dt=Cn.intersects(xe),!Dt))break}if(Dt){he===0?le="rightTop":he===1?le="leftTop":he===2?le="leftBom":he===3&&(le="rightBom");break}}var o,a,s,u,l;if(Dt)le==="rightTop"?(n.push(wn),l=w,o=v,a=m,s=_,u=x):le==="leftTop"?(n.push(Zt),l=j,o=T,a=b,s=S,u=O):le==="rightBom"?(n.push(xe),l=jt,o=z,a=ut,s=dt,u=X):le==="leftBom"&&(n.push(Hn),l=$,o=A,a=M,s=I,u=k);else continue;const Kn=i.getCoordinateFromPixel([o,a]),xr=i.getCoordinateFromPixel([s,a]),wr=i.getCoordinateFromPixel([s,u]),wi=i.getCoordinateFromPixel([o,u]),Ci=new Nt({geometry:new cn([Kn,xr,wr,wi])});r.getSource().addFeature(Ci),l=i.getCoordinateFromPixel(l);const He=new Nt({geometry:new Jt([c.position,l])});r.getSource().addFeature(He),r.setStyle(new Et({fill:new it({color:"rgb(26,58,91)"}),stroke:new mt({color:"rgb(26,58,91)"}),text:new Ge({font:"16px sans-serif",text:c.text,fill:new it({color:"#000"}),offsetX:0,offsetY:1})}))}}function So(i,e){this.min=i,this.max=e}So.prototype.intersects=function(i){const e=this.min,t=this.max,n=i.min,r=i.max;return r.x<=e.x||n.x>=t.x||r.y<=e.y||n.y>=t.y};const xm=function(i={}){const e=i.map?i.map:{};let t=i.paths?i.paths:[];const n=i.id?i.id:Y(),r=i.options?i.options:{};r.id=n;const o=!1;r.changeCarRotate=i.changeCarRotate?i.changeCarRotate:o,r.centerAtCar=i.centerAtCar?i.centerAtCar:!1;const a=i.vacuate?i.vacuate:!1,s=i.smokeMode?i.smokeMode:"distance",u=i.tracePointsModePlay?i.tracePointsModePlay:"animation",l=i.vacuateDistance?i.vacuateDistance:10,h=i.labelShow?i.labelShow:!1,c=i.labelStyle?i.labelStyle:"timeContentClass",g=i.showTracePoint!==!1;let f=t,d,p=e.getView().getZoom();return a?n3(e,t,l,s,function(y){f=y,d=new K(e,t,f,a,u,h,c,g,r),d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()}):(d=new K(e,t,f,a,u,h,c,g,r),d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()),d.setPaths=function(y){t=y,d.arrowsLayer.getSource().clear();for(let v=0;v<d._timeOverlayList.length;v++)e.removeOverlay(d._timeOverlayList[v]);d.traceLayer.getSource().clear(),d.tracePassLayer.getSource().clear(),d.stop(),p=e.getView().getZoom(),a?n3(e,t,l,s,function(v){f=v,d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=t,d._initFlag=1,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows()}):(d._pathInfo=t,d._vacuatePath=t,d._wholePathInfo=t,d._initFlag=1,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.createArrows())},d.clearPaths=function(){d._path=[],t=[],d.arrowsLayer.getSource().clear(),d.tracePassLayer.getSource().clear();for(let y=0;y<d._timeOverlayList.length;y++)e.removeOverlay(d._timeOverlayList[y]);d.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(t.length!==0&&(p=e.getView().getZoom(),d.arrowsLayer.getSource().clear(),Math.round(p)===p))if(d._initFlag=2,d.createArrows(),a)n3(e,t,l,s,function(y){f=y;for(let v=0;v<d._timeOverlayList.length;v++)e.removeOverlay(d._timeOverlayList[v]);d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=t,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.arrowsLayer.getSource().clear(),d.createArrows()});else{for(let y=0;y<d._timeOverlayList.length;y++)e.removeOverlay(d._timeOverlayList[y]);d._pathInfo=f,d._vacuatePath=f,d._wholePathInfo=t,d._initLinesAndMarkers(),h&&d._creatTimeOverlays(),d.arrowsLayer.getSource().clear(),d.createArrows()}}),d},wm={name:"v-track",render(i,e){return null},inject:["VMap"],props:{id:{type:String,default(){return`track-${Y()}`}},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:void 0},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{}}}},data(){return{track:null}},computed:{map(){return this.VMap.map}},watch:{paths:{handler(i){this.init(i)},immediate:!1,deep:!0}},mounted(){this.init()},beforeDestroy(){this.track.dispose(),this.track=null},methods:{init(i){if(i&&i.length>0||this.paths&&this.paths.length>0){const e=gt(H({},this.$props),{map:this.map,paths:i||this.paths});this.track=xm(e),this.$emit("onLoad",this.track)}},start(){this.track.start()},pause(){this.track.pause()},stop(){this.track.stop()},dispose(){this.track.dispose()}}};let Cm,Em;const mg={};var Tm=Ee(wm,Cm,Em,!1,Sm,null,null,null);function Sm(i){for(let e in mg)this[e]=mg[e]}const bo=function(){return Tm.exports}();bo.install=i=>{i.component(bo.name,bo)};const xg=[co,go,fo,hr,po,xo,wo,Co,Eo,To,bo],r3=function(i){r3.installed||xg.forEach(e=>{i.component(e.name,e)})};typeof window!="undefined"&&window.Vue&&r3(window.Vue);const bm=H({install:r3},xg);rt.VDraw=Eo,rt.VGraphic=Co,rt.VHeatmap=wo,rt.VMap=co,rt.VMeasure=To,rt.VOverlay=fo,rt.VOverview=go,rt.VRoute=xo,rt.VTile=hr,rt.VTrack=bo,rt.VVector=po,rt.default=bm,Object.defineProperties(rt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
132
|
+
//# sourceMappingURL=ol-map.umd.js.map
|