|
- import{g as h}from"./locationTransform.e2d22cb6.js";import{g as _,c as v,b as k}from"./index.511d224b.js";const y=k("div",{id:"mapDiv",style:{width:"100%",height:"100%"}},null,-1),f=[y],L={name:"TiandiTrack"},P=Object.assign(L,{setup(b,{expose:i}){var r=null,t=null;const c="https://mapapi.qq.com/web/miniprogram/demoCenter/images/marker-start.png",s="https://mapapi.qq.com/web/miniprogram/demoCenter/images/marker-end.png";function l(){r.stop()}function p(){r.start()}function m(){r.pause()}function d(a){var e=new T.TileLayer("https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=ab2519a9c15768b43c15013661be0c52");t=new T.Map("mapDiv",{layers:[e]}),t.centerAndZoom(new T.LngLat(116.31809,39.92027),12);const n=u(a);t.centerAndZoom(n[0],12),r=new T.CarTrack(t,{interval:5,speed:10,dynamicLine:!1,carstyle:{display:!0,iconUrl:"https://carrental.ningdatech.com/car.png",width:52,height:26},polylinestyle:{color:"#F24D4E",weight:55,opacity:1},Datas:n}),g(n[0],n[n.length-1])}function g(a,e){var n=new T.Marker(a,{icon:new T.Icon({iconUrl:c,iconSize:new T.Point(34,44),iconAnchor:new T.Point(12,31)})});t.addOverLay(n);var o=new T.Marker(e,{icon:new T.Icon({iconUrl:s,iconSize:new T.Point(34,44),iconAnchor:new T.Point(12,31)})});t.addOverLay(o)}i({initTrack:d,start:p,stop:l,pause:m});function u(a){return a.map(function(e,n){const o=h(e.lng,e.lat);var w=new T.LngLat(o[0],o[1]);return w})}return(a,e)=>(_(),v("div",null,f))}});export{P as _};
|