import{X as y,d as k,i as x,Y as P,o as _,g as m,M as O}from"./index-5748179b.js";import{M as C}from"./index-50b8deca.js";const j="_info_1olg7_1",U={info:j};var L={},z={get exports(){return L},set exports(l){L=l}};(function(l,g){(function(w,c){l.exports=c()})(y,function(){function w(n){var s=[];return n.AMapUI&&s.push(c(n.AMapUI)),n.Loca&&s.push(A(n.Loca)),Promise.all(s)}function c(n){return new Promise(function(s,e){var o=[];if(n.plugins)for(var i=0;i{B.load({key:"501e5bfaf7cfc5d3d53a9a4d9466d8b9",version:"2.0",plugins:["AMap.ToolBar","AMap.Driving"],AMapUI:{version:"1.1",plugins:[]},Loca:{version:"2.0.0"}}).then(c=>{let A=null;g.value=new c.Map("gpsContainer",{resizeEnable:!0,zoom:16,zooms:[2,22],center:[114.34371,30.55939]}),c.plugin(["AMap.Geocoder","AMap.GeometryUtil"],function(){if(l.lnglat&&l.lnglat.length>0){g.value.setCenter(l.lnglat,!0),a(),t(l.lnglat,"教学点","addressMark");const v=new c.Circle({center:new c.LngLat(...l.lnglat),radius:l.attendance_range,strokeColor:"#00B2A7",strokeOpacity:1,strokeWeight:2,fillColor:"#A3FFF9",fillOpacity:.14});g.value.add(v),g.value.setFitView()}l.signOutLongitudeLatitude&&l.signOutLongitudeLatitude.length>0&&(console.log("signOutLongitudeLatitude",l.signOutLongitudeLatitude),t(l.signOutLongitudeLatitude,"签退点","signOutMark")),console.log(l,"selectMapAddress"),l.signInMark&&l.addressMark&&(d(l.addressMark,l.signInMark,"top"),console.log("连线 设置签到点与教学点的距离")),l.signOutMark&&l.addressMark&&(d(l.addressMark,l.signOutMark,"bottom"),console.log("连线 设置签退点与教学点的距离"))});function t(v,h,n){new c.Icon({size:[25,34],image:"https://daya.ks3-cn-beijing.ksyun.com/202211/TO13VtW.png",imageSize:[25,34]}),A=new c.Marker({position:new c.LngLat(...v),title:h}),A.setLabel({content:`
${h}
`,direction:"top"}),l[n]=A,A.setMap(g),g.value.add(A)}function a(){A&&(A.setMap(null),A=null)}function d(v,h,n){const s=new c.Polyline({strokeColor:"#01C1B5",strokeWeight:3,isOutline:!1,outlineColor:"#01C1B5"});s.setMap(g.value);const e=v.getPosition(),o=h.getPosition(),i=e.divideBy(2).add(o.divideBy(2)),r=Math.round(e.distance(o)),p=[e,o];s.setPath(p);const u=M([e.lng,o.lng],[o.lng,e.lng]);if(console.log(u,"aaaaaaa"),n=="top"){console.log(e,o,i,r,"computed",n);const f=new c.Text({text:r+"M",style:{"font-size":"12px"}});f.setPosition(i),f.setMap(g.value)}else{const f=new c.Text({text:r+"M",angle:u,style:{"font-size":"12px"}});f.setPosition(i),f.setMap(g.value)}}function M(v,h){const n=g.value.lngLatToContainer(v),s=g.value.lngLatToContainer(h),e=s.x-n.x,o=s.y-n.y;return console.log(360*Math.atan2(o,e)/(2*Math.PI)),360*Math.atan2(o,e)/(2*Math.PI)-45}}).catch(()=>{})};return _(()=>{w()}),()=>m("div",{class:U["amap-gps"]},[m(C,{position:"top"},{default:()=>[m(O,null,null)]}),m("div",{id:"gpsContainer",style:{width:"100%",height:"calc(100vh - var(--header-height))",position:"relative"}},null)])}});export{T as default};