@heycar/heycars-map 0.3.13 → 0.3.15
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +127 -127
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
m -${o}, 0
|
|
69
69
|
a ${o},${o} 0 1,0 ${2*o},0
|
|
70
70
|
a ${o},${o} 0 1,0 -${2*o},0
|
|
71
|
-
`,strokeColor:"#38A3FE",fillColor:"#38A3FE",fillOpacity:1,strokeOpacity:1,strokeWeight:i/2,scale:1},repeat:`${i*2}px`}]}})}}),ze=h(e=>{const t=A();return()=>R(t.supplier==="gmap"?Ro:Eo,{attrs:e})}),Nn=e=>{const t=s.shallowRef([]),n=new AMap.Walking({});return Q(()=>({...e}),({from:a,to:i})=>{n.search(AMap.LngLat.from(a),AMap.LngLat.from(i),(o,r)=>{switch(o){case"complete":{let c=[];const l=r;if(!l.routes)return;const M=l.routes[0];for(const g of M.steps){const u=g.path.map(({lng:d,lat:I})=>[d,I]);c=c.concat(u)}t.value=c;return}case"no_data":t.value=[];return;default:throw r}})}),t},Sn=e=>{const t=s.shallowRef([]),n=new google.maps.DirectionsService;return Q(()=>({...e}),({from:a,to:i})=>{n.route({origin:{lng:a[0],lat:a[1]},destination:{lng:i[0],lat:i[1]},travelMode:google.maps.TravelMode.WALKING},(o,r)=>{switch(r){case google.maps.DirectionsStatus.OK:{let c=[];const M=o.routes[0].overview_path.map(g=>[g.lng(),g.lat()]);c=c.concat(M),t.value=c;return}case google.maps.DirectionsStatus.ZERO_RESULTS:case google.maps.DirectionsStatus.NOT_FOUND:t.value=[];return;default:throw new Error(r)}})}),t},zo=e=>{const{supplier:t}=A();return t==="gmap"?Sn(e):Nn(e)},Zo=h((e,{slots:t})=>{const n=Nn(e);return()=>{var a;return s.h("div",[(a=t.render)==null?void 0:a.call(t,s.reactive({path:n}))])}}),Oo=h((e,{slots:t})=>{const n=Sn(e);return()=>{var a;return s.h("div",[(a=t.render)==null?void 0:a.call(t,s.reactive({path:n}))])}}),Ze=h((e,{slots:t})=>{const{supplier:n}=A();return()=>R(n==="gmap"?Oo:Zo,{attrs:e,scopedSlots:t})}),je="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTE5IiBoZWlnaHQ9IjExOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cmFkaWFsR3JhZGllbnQgY3g9IjUwJSIgY3k9IjUwJSIgZng9IjUwJSIgZnk9IjUwJSIgcj0iNTAlIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBvZmZzZXQ9IjAlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzQ0NzFGRiIgb2Zmc2V0PSIxMDAlIi8+PC9yYWRpYWxHcmFkaWVudD48L2RlZnM+PGNpcmNsZSBjeD0iMTkxLjM5NCIgY3k9IjIzOCIgcj0iNTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMzIgLTE3OSkiIGZpbGw9InVybCgjcHJlZml4X19hKSIgZmlsbC1ydWxlPSJldmVub2RkIiBvcGFjaXR5PSIuMiIvPjwvc3ZnPg==";var wn="rrvp0y3",Le="rrvp0y2";const ko=h(e=>{const t=s.computed(()=>`<img src="${je}" class="${Le}">`),n=s.computed(()=>`<img src="${je}" class="${Le} ${wn}">`);return()=>s.h("div",[s.h(O,{attrs:{position:e.position,anchor:"bottom-center",content:t.value}}),s.h(O,{attrs:{position:e.position,anchor:"bottom-center",content:n.value}})])}),Go=h(e=>{const t=s.computed(()=>P("img",{class:Le,src:je})),n=s.computed(()=>P("img",{class:`${Le} ${wn}`,src:je}));return()=>{const a=x(e.position);return s.h("div",[s.h(k,{attrs:{position:a,content:t.value}}),s.h(k,{attrs:{position:a,content:n.value}})])}}),Dn=h(e=>{const t=A();return()=>R(t.supplier==="gmap"?Go:ko,{attrs:e})}),gt=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,title:a,registerOverlay:i}=e,o=w(n);return s.h("div",[s.h(b,{attrs:{type:"start",position:o,title:a,registerOverlay:i}}),s.h(Dn,{attrs:{position:o}}),s.h(E,{attrs:{position:o,label:n.name,hideIcon:!0}})])})),Wo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,carPosition:a,passengerPosition:i,renderTitle:o,registerOverlay:r}=e,c=w(n);return s.h("div",[!!i&&s.h(de,{attrs:{position:i,registerOverlay:r}}),s.h(b,{attrs:{type:"start",position:c,registerOverlay:r}}),s.h(E,{attrs:{position:c,label:n.name,hideIcon:!0}}),s.h(se,{attrs:{from:a,to:c,render:({path:l,distance:M,duration:g})=>[s.h(re,{attrs:{path:l}}),s.h(Ne,{attrs:{position:a,title:o({distance:M,duration:g})}})]}}),!!i&&s.h(Ze,{attrs:{from:i,to:c,render:({path:l})=>s.h(ze,{attrs:{path:l}})}})])})),Uo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,passengerPosition:a,title:i,registerOverlay:o}=e,r=w(n);return s.h("div",[s.h(b,{attrs:{type:"start",position:r,title:i,registerOverlay:o}}),s.h(E,{attrs:{position:r,label:n.name,hideIcon:!0}}),!!a&&s.h(de,{attrs:{position:a,registerOverlay:o}})])})),Bo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,carPosition:a,passengerPosition:i,title:o,registerOverlay:r}=e,c=w(n);return s.h("div",[s.h(Ne,{attrs:{position:a,title:o,registerOverlay:r}}),s.h(b,{attrs:{type:"start",position:c,registerOverlay:r}}),s.h(E,{attrs:{position:c,label:n.name,hideIcon:!0}}),!!i&&s.h(Ze,{attrs:{from:i,to:c,render:({path:l})=>s.h(ze,{attrs:{path:l}})}}),!!i&&s.h(de,{attrs:{position:i,size:"small",registerOverlay:r}})])})),Vo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{to:n,carPosition:a,renderTitle:i,registerOverlay:o}=e,r=w(n);return s.h("div",[s.h(b,{attrs:{type:"end",position:r,registerOverlay:o}}),s.h(E,{attrs:{position:r,label:n.name,hideIcon:!0}}),s.h(se,{attrs:{from:a,to:r,render:({path:c,distance:l,duration:M})=>[s.h(re,{attrs:{path:c}}),s.h(Ne,{attrs:{position:a,title:i({distance:l,duration:M}),registerOverlay:o}})]}})])})),Yo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,to:a,registerOverlay:i}=e,o=w(n),r=w(a);return s.h("div",[s.h(b,{attrs:{type:"start",position:o,registerOverlay:i}}),s.h(b,{attrs:{type:"end",position:r,registerOverlay:i}}),s.h(E,{attrs:{position:o,label:n.name,hideIcon:!0}}),s.h(E,{attrs:{position:r,label:a.name,hideIcon:!0}})])})),Pe=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,to:a,registerOverlay:i}=e,o=w(n),r=w(a);return s.h("div",[s.h(b,{attrs:{type:"start",position:o,registerOverlay:i}}),s.h(b,{attrs:{type:"end",position:r,registerOverlay:i}}),s.h(E,{attrs:{position:o,label:n.name,hideIcon:!0}}),s.h(E,{attrs:{position:r,label:a.name,hideIcon:!0}}),s.h(se,{attrs:{from:o,to:r,render:({path:c})=>s.h(re,{attrs:{path:c,done:!0}})}})])})),Ho=h(e=>{const{mapRef:t,setMap:n}=le(),{registerFitVeiw:a,setFitView:i}=ce({mapRef:t,autoFitTimeout:5e3,padding:[25,20,15,15]});return()=>{const{from:o,to:r}=e,c=dt(o)&&dt(r),l=c?w(o):[...Po],M=c?13:3;return s.h(oe,{attrs:{center:l,zoom:M,mapRef:n}},[c&&s.h(Pe,{attrs:{from:o,to:r,registerOverlay:a},on:{mapMounted:i}})])}}),Qo=["book-driverStartService","dispatched","driverStartService","inService","driverArrived"],Jo=ee(e=>{e.log&&console.log(e);const{from:t,interval:n,registerOverlay:a,mapRef:i,getDriverPosition:o,renderStartSerivceTitle:r,renderInServiceTitle:c}=e,{setFitView:l}=a,{geoPosition:M,geoError:g}=ue({geoDefaultPosition:w(t)}),u=s.ref(w(e.from));return s.watch(()=>e.driverStatus,(d,I,m)=>{if(!Qo.includes(d))return;const f=setInterval(()=>{o().then(v=>u.value=v)},n);m(()=>clearInterval(f))},{immediate:!0}),()=>{const{driverStatus:d,from:I,to:m,dispatchingTitle:f,bookDispatchingTitle:v,bookDispatchedTitle:y,driverArrivedTitle:p}=e,j=u.value,L=g.value?void 0:M.value;return s.h(oe,{attrs:{center:w(I),zoom:13,mapRef:i}},[d==="dispatching"?s.h(gt,{attrs:{from:I,title:f,registerOverlay:a},on:{mapMounted:l}}):d==="book-dispatching"?s.h(gt,{attrs:{from:I,title:v,registerOverlay:a},on:{mapMounted:l}}):d==="dispatched"||d==="driverStartService"||d==="book-driverStartService"?s.h(Wo,{attrs:{from:I,carPosition:j,passengerPosition:L,renderTitle:r,registerOverlay:a},on:{mapMounted:l}}):d==="book-dispatched"?s.h(Uo,{attrs:{from:I,passengerPosition:L,title:y,registerOverlay:a},on:{mapMounted:l}}):d==="inService"?s.h(Vo,{attrs:{to:m,carPosition:j,renderTitle:c,registerOverlay:a},on:{mapMounted:l}}):d==="driverArrived"?s.h(Bo,{attrs:{from:I,carPosition:j,passengerPosition:L,title:p,registerOverlay:a},on:{mapMounted:l}}):d==="canceled"||d==="canceling"?s.h(Yo,{attrs:{from:I,to:m,registerOverlay:a}}):d==="endService"||d==="completed"||d==="banlanceRefund"||d==="waitBanlanceRefund"||d==="rechargePayed"||d==="waitRechargePay"||d==="payed"||d==="waitpay"||d==="refund"||d==="confirmed"?s.h(Pe,{attrs:{from:I,to:m,registerOverlay:a},on:{mapMounted:l}}):s.h(Pe,{attrs:{from:I,to:m,registerOverlay:a},on:{mapMounted:l}})])}}).props(["bookDispatchedTitle","bookDispatchingTitle","dispatchingTitle","driverArrivedTitle","driverStatus","fallback","from","getDriverPosition","interval","loading","mapRef","renderInServiceTitle","renderStartSerivceTitle","to","registerOverlay"]),Fo=()=>{const e=A();return{apiMapDistance:(n,a)=>{if(e.status===q.SUCCESS)return AMap.GeometryUtil.distance(n,a)}}},Xo=()=>{const e=A();return{apiMapDistance:(n,a)=>{if(e.status===q.SUCCESS)return google.maps.geometry.spherical.computeDistanceBetween(x(n),x(a))}}},Se=()=>{const{supplier:e}=A();return e==="gmap"?Xo():Fo()},$o=e=>{const{city:t}=e,n=s.ref(t),{readyPromise:a}=A(),{apiMapDistance:i}=Se(),{geoPosition:o}=ue(),r=s.ref(""),c=s.ref([]),{update:l,idx:M}=F(),g=d=>{n.value=d,l()},u=d=>{r.value=d,l()};return s.watch(()=>M.value,async()=>{if(!r.value)return;await a,new AMap.PlaceSearch({city:n.value.name}).search(r.value,(I,m)=>{const f=o.value;switch(I){case"complete":{c.value=m.poiList.pois.map(v=>{const{lat:y,lng:p}=v.location;return{lat:y,lng:p,name:v.name,description:v.address,distance:f?i(f,[p,y]):void 0}});return}case"no_data":c.value=[];return;default:throw m}})},{immediate:!0}),{setKeyword:u,setCity:g,autoCompletePlaces:c}},_o=e=>{const{city:t}=e,n=s.ref({...t}),{readyPromise:a}=A(),{apiMapDistance:i}=Se(),{geoPosition:o}=ue(),r=s.ref(""),c=s.ref([]),{update:l,idx:M}=F(),g=I=>{n.value=I,l()},u=I=>{r.value=I,l()},d=document.createElement("div");return s.watch(()=>M.value,async()=>{if(!r.value)return;await a,new google.maps.places.PlacesService(d).textSearch({query:r.value,bounds:n.value.bound},(m,f)=>{const v=o.value;switch(f){case google.maps.places.PlacesServiceStatus.OK:c.value=m.map(({geometry:y,name:p,formatted_address:j})=>{var S,D,T,z;const L=(D=(S=y==null?void 0:y.location)==null?void 0:S.lng())!=null?D:0,C=(z=(T=y==null?void 0:y.location)==null?void 0:T.lat())!=null?z:0;return{lng:L,lat:C,name:p!=null?p:"",description:j!=null?j:"",distance:v?i(v,[L,C]):void 0}});return;case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.NOT_FOUND:c.value=[];return}})}),{setKeyword:u,setCity:g,autoCompletePlaces:c}},Ko=e=>{const{supplier:t}=A();return t==="gmap"?_o(e):$o(e)},qo=e=>{var i;const{cityNameRef:t,onChange:n}=e,a=s.reactive({name:(i=t.value)!=null?i:""});return s.watch(()=>t.value,o=>{const r=o!=null?o:"";a.name=r,n==null||n({name:r})}),a},er=e=>{var o;const{cityNameRef:t,onChange:n}=e,{readyPromise:a}=A(),i=s.reactive({name:(o=t.value)!=null?o:"",bound:{east:0,north:0,south:0,west:0}});return s.watchEffect(async()=>{var u,d;const r=t.value;if(!r)return;await a;const c=new google.maps.Geocoder,{results:l}=await c.geocode({address:r,componentRestrictions:{administrativeArea:"administrative_area_level_1"},language:_});if(l.length!==1)throw new Error("MyError: multiple city found");const{geometry:M}=l[0],g=(d=(u=M.bounds)==null?void 0:u.toJSON())!=null?d:M.viewport.toJSON();i.name=r,i.bound=g,n==null||n({name:r,bound:g})}),i},tr=e=>{const{supplier:t}=A();return t==="gmap"?er(e):qo(e)},nr=e=>{const{cityNameRef:t}=e,n=tr({cityNameRef:t,onChange:c=>o(c)}),{autoCompletePlaces:a,setKeyword:i,setCity:o}=Ko({city:n});return{autoCompletePlaces:a,setKeyword:i,setCity:o,handleKeywordInput:c=>{const l=c.target;i(l.value)}}},ar=()=>{const{setMap:e,mapRef:t}=le(),{registerFitVeiw:n,setFitView:a}=ce({mapRef:t,padding:[25,20,15,15]});return{setMap:e,registerFitVeiw:n,setFitView:a}},ir=()=>{const e=s.reactive({lng:0,lat:0,name:""}),t=s.ref([]),{apiMapDistance:n}=Se(),a=r=>o.panToGeoPositionByRecomend(r),i=r=>o.setCenterPlaceByUserSpecified(r),o={panToGeoPositionByRecomend:()=>{throw new Error("MyError: panToGeoPositionByRecomend used before assigned")},setCenterPlaceByUserSpecified:()=>{throw new Error("MyError: setCenterPlaceByRecomand used before assigned")},onChangeCenterPlace:r=>{Object.assign(e,{...r})},onChangeRecomendPlaces:r=>{t.value=[...r]}};return{mapContext:o,centerPlace:e,placeCandidates:t,panToGeoPositionByRecomend:a,setCenterPlaceByUserSpecified:i,apiMapDistance:n}},or=()=>{const{mapRef:e,setMap:t}=le(),{registerFitVeiw:n,setFitView:a}=ce({mapRef:e,autoFitTimeout:5e3,padding:[25,20,15,15]});return{setMap:t,registerFitVeiw:n,setFitView:a}};exports.AbsoluteAddressBox=Tt;exports.AddressBox=xi;exports.BusinessQuotingMap=io;exports.BusinessRecomendPlaceMap=Co;exports.BusinessTaxiEndMap=Ho;exports.BusinessTaxiServiceMap=Jo;exports.DrivingLine=re;exports.DrivingRoute=se;exports.HeycarMap=oe;exports.MapProvider=Ui;exports.PassengerCircle=de;exports.PickupPoints=hn;exports.PlaceCircle=E;exports.StartEndPoint=b;exports.TaxiCar=Ne;exports.WalkingLine=ze;exports.WalkingRoute=Ze;exports.WaveCircle=Dn;exports.useBusinessMapAutoComplete=nr;exports.useBusinessQuotingMap=ar;exports.useBusinessRecomendPlaceMap=ir;exports.useBusinessTaxiServiceMap=or;exports.useDrivingRoute=Yi;exports.useGeoLocation=ue;exports.useHeycarMap=le;exports.useMapAngle=Qi;exports.useMapDrag=gn;exports.useMapFitView=ce;exports.useMapGeometry=Se;exports.useMapPlace=lo;exports.useMapRecomendPlace=mn;exports.useWalkingRoute=zo;
|
|
71
|
+
`,strokeColor:"#38A3FE",fillColor:"#38A3FE",fillOpacity:1,strokeOpacity:1,strokeWeight:i/2,scale:1},repeat:`${i*2}px`}]}})}}),ze=h(e=>{const t=A();return()=>R(t.supplier==="gmap"?Ro:Eo,{attrs:e})}),Nn=e=>{const t=s.shallowRef([]),n=new AMap.Walking({});return Q(()=>({...e}),({from:a,to:i})=>{n.search(AMap.LngLat.from(a),AMap.LngLat.from(i),(o,r)=>{switch(o){case"complete":{let c=[];const l=r;if(!l.routes)return;const M=l.routes[0];for(const g of M.steps){const u=g.path.map(({lng:d,lat:I})=>[d,I]);c=c.concat(u)}t.value=c;return}case"no_data":t.value=[];return;default:throw r}})}),t},Sn=e=>{const t=s.shallowRef([]),n=new google.maps.DirectionsService;return Q(()=>({...e}),({from:a,to:i})=>{n.route({origin:{lng:a[0],lat:a[1]},destination:{lng:i[0],lat:i[1]},travelMode:google.maps.TravelMode.WALKING},(o,r)=>{switch(r){case google.maps.DirectionsStatus.OK:{let c=[];const M=o.routes[0].overview_path.map(g=>[g.lng(),g.lat()]);c=c.concat(M),t.value=c;return}case google.maps.DirectionsStatus.ZERO_RESULTS:case google.maps.DirectionsStatus.NOT_FOUND:t.value=[];return;default:throw new Error(r)}})}),t},zo=e=>{const{supplier:t}=A();return t==="gmap"?Sn(e):Nn(e)},Zo=h((e,{slots:t})=>{const n=Nn(e);return()=>{var a;return s.h("div",[(a=t.render)==null?void 0:a.call(t,s.reactive({path:n}))])}}),Oo=h((e,{slots:t})=>{const n=Sn(e);return()=>{var a;return s.h("div",[(a=t.render)==null?void 0:a.call(t,s.reactive({path:n}))])}}),Ze=h((e,{slots:t})=>{const{supplier:n}=A();return()=>R(n==="gmap"?Oo:Zo,{attrs:e,scopedSlots:t})}),je="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTE5IiBoZWlnaHQ9IjExOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cmFkaWFsR3JhZGllbnQgY3g9IjUwJSIgY3k9IjUwJSIgZng9IjUwJSIgZnk9IjUwJSIgcj0iNTAlIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjRkZGIiBvZmZzZXQ9IjAlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzQ0NzFGRiIgb2Zmc2V0PSIxMDAlIi8+PC9yYWRpYWxHcmFkaWVudD48L2RlZnM+PGNpcmNsZSBjeD0iMTkxLjM5NCIgY3k9IjIzOCIgcj0iNTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMzIgLTE3OSkiIGZpbGw9InVybCgjcHJlZml4X19hKSIgZmlsbC1ydWxlPSJldmVub2RkIiBvcGFjaXR5PSIuMiIvPjwvc3ZnPg==";var wn="rrvp0y3",Le="rrvp0y2";const ko=h(e=>{const t=s.computed(()=>`<img src="${je}" class="${Le}">`),n=s.computed(()=>`<img src="${je}" class="${Le} ${wn}">`);return()=>s.h("div",[s.h(O,{attrs:{position:e.position,anchor:"bottom-center",content:t.value}}),s.h(O,{attrs:{position:e.position,anchor:"bottom-center",content:n.value}})])}),Go=h(e=>{const t=s.computed(()=>P("img",{class:Le,src:je})),n=s.computed(()=>P("img",{class:`${Le} ${wn}`,src:je}));return()=>{const a=x(e.position);return s.h("div",[s.h(k,{attrs:{position:a,content:t.value}}),s.h(k,{attrs:{position:a,content:n.value}})])}}),Dn=h(e=>{const t=A();return()=>R(t.supplier==="gmap"?Go:ko,{attrs:e})}),gt=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,title:a,registerOverlay:i}=e,o=w(n);return s.h("div",[s.h(b,{attrs:{type:"start",position:o,title:a,registerOverlay:i}}),s.h(Dn,{attrs:{position:o}}),s.h(E,{attrs:{position:o,label:n.name,hideIcon:!0}})])})),Wo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,carPosition:a,passengerPosition:i,renderTitle:o,registerOverlay:r}=e,c=w(n);return s.h("div",[!!i&&s.h(de,{attrs:{position:i,registerOverlay:r}}),s.h(b,{attrs:{type:"start",position:c,registerOverlay:r}}),s.h(E,{attrs:{position:c,label:n.name,hideIcon:!0}}),s.h(se,{attrs:{from:a,to:c,render:({path:l,distance:M,duration:g})=>[s.h(re,{attrs:{path:l}}),s.h(Ne,{attrs:{position:a,title:o({distance:M,duration:g})}})]}}),!!i&&s.h(Ze,{attrs:{from:i,to:c,render:({path:l})=>s.h(ze,{attrs:{path:l}})}})])})),Uo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,passengerPosition:a,title:i,registerOverlay:o}=e,r=w(n);return s.h("div",[s.h(b,{attrs:{type:"start",position:r,title:i,registerOverlay:o}}),s.h(E,{attrs:{position:r,label:n.name,hideIcon:!0}}),!!a&&s.h(de,{attrs:{position:a,registerOverlay:o}})])})),Bo=h((e,{emit:t})=>(G(()=>t("mapMounted")),console.log("SectionDriverArrived:",e),()=>{const{from:n,carPosition:a,passengerPosition:i,title:o,registerOverlay:r}=e,c=w(n);return s.h("div",[s.h(Ne,{attrs:{position:a,title:o,registerOverlay:r}}),s.h(b,{attrs:{type:"start",position:c,registerOverlay:r}}),s.h(E,{attrs:{position:c,label:n.name,hideIcon:!0}}),!!i&&s.h(Ze,{attrs:{from:i,to:c,render:({path:l})=>s.h(ze,{attrs:{path:l}})}}),!!i&&s.h(de,{attrs:{position:i,size:"small",registerOverlay:r}})])})),Vo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{to:n,carPosition:a,renderTitle:i,registerOverlay:o}=e,r=w(n);return s.h("div",[s.h(b,{attrs:{type:"end",position:r,registerOverlay:o}}),s.h(E,{attrs:{position:r,label:n.name,hideIcon:!0}}),s.h(se,{attrs:{from:a,to:r,render:({path:c,distance:l,duration:M})=>[s.h(re,{attrs:{path:c}}),s.h(Ne,{attrs:{position:a,title:i({distance:l,duration:M}),registerOverlay:o}})]}})])})),Yo=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,to:a,registerOverlay:i}=e,o=w(n),r=w(a);return s.h("div",[s.h(b,{attrs:{type:"start",position:o,registerOverlay:i}}),s.h(b,{attrs:{type:"end",position:r,registerOverlay:i}}),s.h(E,{attrs:{position:o,label:n.name,hideIcon:!0}}),s.h(E,{attrs:{position:r,label:a.name,hideIcon:!0}})])})),Pe=h((e,{emit:t})=>(G(()=>t("mapMounted")),()=>{const{from:n,to:a,registerOverlay:i}=e,o=w(n),r=w(a);return s.h("div",[s.h(b,{attrs:{type:"start",position:o,registerOverlay:i}}),s.h(b,{attrs:{type:"end",position:r,registerOverlay:i}}),s.h(E,{attrs:{position:o,label:n.name,hideIcon:!0}}),s.h(E,{attrs:{position:r,label:a.name,hideIcon:!0}}),s.h(se,{attrs:{from:o,to:r,render:({path:c})=>s.h(re,{attrs:{path:c,done:!0}})}})])})),Ho=h(e=>{const{mapRef:t,setMap:n}=le(),{registerFitVeiw:a,setFitView:i}=ce({mapRef:t,autoFitTimeout:5e3,padding:[25,20,15,15]});return()=>{const{from:o,to:r}=e,c=dt(o)&&dt(r),l=c?w(o):[...Po],M=c?13:3;return s.h(oe,{attrs:{center:l,zoom:M,mapRef:n}},[c&&s.h(Pe,{attrs:{from:o,to:r,registerOverlay:a},on:{mapMounted:i}})])}}),Qo=["book-driverStartService","dispatched","driverStartService","inService","driverArrived"],Jo=ee(e=>{e.log&&console.log(e);const{from:t,interval:n,registerOverlay:a,mapRef:i,getDriverPosition:o,renderStartSerivceTitle:r,renderInServiceTitle:c}=e,{setFitView:l}=a,{geoPosition:M,geoError:g}=ue({geoDefaultPosition:w(t)}),u=s.ref(w(e.from));return s.watch(()=>e.driverStatus,(d,I,m)=>{if(!Qo.includes(d))return;const f=setInterval(()=>{o().then(v=>u.value=v)},n);m(()=>clearInterval(f))},{immediate:!0}),()=>{const{driverStatus:d,from:I,to:m,dispatchingTitle:f,bookDispatchingTitle:v,bookDispatchedTitle:y,driverArrivedTitle:p}=e,j=u.value,L=g.value?void 0:M.value;return s.h(oe,{attrs:{center:w(I),zoom:13,mapRef:i}},[d==="dispatching"?s.h(gt,{attrs:{from:I,title:f,registerOverlay:a},on:{mapMounted:l}}):d==="book-dispatching"?s.h(gt,{attrs:{from:I,title:v,registerOverlay:a},on:{mapMounted:l}}):d==="dispatched"||d==="driverStartService"||d==="book-driverStartService"?s.h(Wo,{attrs:{from:I,carPosition:j,passengerPosition:L,renderTitle:r,registerOverlay:a},on:{mapMounted:l}}):d==="book-dispatched"?s.h(Uo,{attrs:{from:I,passengerPosition:L,title:y,registerOverlay:a},on:{mapMounted:l}}):d==="inService"?s.h(Vo,{attrs:{to:m,carPosition:j,renderTitle:c,registerOverlay:a},on:{mapMounted:l}}):d==="driverArrived"?s.h(Bo,{attrs:{from:I,carPosition:j,passengerPosition:L,title:p,registerOverlay:a},on:{mapMounted:l}}):d==="canceled"||d==="canceling"?s.h(Yo,{attrs:{from:I,to:m,registerOverlay:a}}):d==="endService"||d==="completed"||d==="banlanceRefund"||d==="waitBanlanceRefund"||d==="rechargePayed"||d==="waitRechargePay"||d==="payed"||d==="waitpay"||d==="refund"||d==="confirmed"?s.h(Pe,{attrs:{from:I,to:m,registerOverlay:a},on:{mapMounted:l}}):s.h(Pe,{attrs:{from:I,to:m,registerOverlay:a},on:{mapMounted:l}})])}}).props(["bookDispatchedTitle","bookDispatchingTitle","dispatchingTitle","driverArrivedTitle","driverStatus","fallback","from","getDriverPosition","interval","loading","mapRef","renderInServiceTitle","renderStartSerivceTitle","to","registerOverlay"]),Fo=()=>{const e=A();return{apiMapDistance:(n,a)=>{if(e.status===q.SUCCESS)return AMap.GeometryUtil.distance(n,a)}}},Xo=()=>{const e=A();return{apiMapDistance:(n,a)=>{if(e.status===q.SUCCESS)return google.maps.geometry.spherical.computeDistanceBetween(x(n),x(a))}}},Se=()=>{const{supplier:e}=A();return e==="gmap"?Xo():Fo()},$o=e=>{const{city:t}=e,n=s.ref(t),{readyPromise:a}=A(),{apiMapDistance:i}=Se(),{geoPosition:o}=ue(),r=s.ref(""),c=s.ref([]),{update:l,idx:M}=F(),g=d=>{n.value=d,l()},u=d=>{r.value=d,l()};return s.watch(()=>M.value,async()=>{if(!r.value)return;await a,new AMap.PlaceSearch({city:n.value.name}).search(r.value,(I,m)=>{const f=o.value;switch(I){case"complete":{c.value=m.poiList.pois.map(v=>{const{lat:y,lng:p}=v.location;return{lat:y,lng:p,name:v.name,description:v.address,distance:f?i(f,[p,y]):void 0}});return}case"no_data":c.value=[];return;default:throw m}})},{immediate:!0}),{setKeyword:u,setCity:g,autoCompletePlaces:c}},_o=e=>{const{city:t}=e,n=s.ref({...t}),{readyPromise:a}=A(),{apiMapDistance:i}=Se(),{geoPosition:o}=ue(),r=s.ref(""),c=s.ref([]),{update:l,idx:M}=F(),g=I=>{n.value=I,l()},u=I=>{r.value=I,l()},d=document.createElement("div");return s.watch(()=>M.value,async()=>{if(!r.value)return;await a,new google.maps.places.PlacesService(d).textSearch({query:r.value,bounds:n.value.bound},(m,f)=>{const v=o.value;switch(f){case google.maps.places.PlacesServiceStatus.OK:c.value=m.map(({geometry:y,name:p,formatted_address:j})=>{var S,D,T,z;const L=(D=(S=y==null?void 0:y.location)==null?void 0:S.lng())!=null?D:0,C=(z=(T=y==null?void 0:y.location)==null?void 0:T.lat())!=null?z:0;return{lng:L,lat:C,name:p!=null?p:"",description:j!=null?j:"",distance:v?i(v,[L,C]):void 0}});return;case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.NOT_FOUND:c.value=[];return}})}),{setKeyword:u,setCity:g,autoCompletePlaces:c}},Ko=e=>{const{supplier:t}=A();return t==="gmap"?_o(e):$o(e)},qo=e=>{var i;const{cityNameRef:t,onChange:n}=e,a=s.reactive({name:(i=t.value)!=null?i:""});return s.watch(()=>t.value,o=>{const r=o!=null?o:"";a.name=r,n==null||n({name:r})}),a},er=e=>{var o;const{cityNameRef:t,onChange:n}=e,{readyPromise:a}=A(),i=s.reactive({name:(o=t.value)!=null?o:"",bound:{east:0,north:0,south:0,west:0}});return s.watchEffect(async()=>{var u,d;const r=t.value;if(!r)return;await a;const c=new google.maps.Geocoder,{results:l}=await c.geocode({address:r,componentRestrictions:{administrativeArea:"administrative_area_level_1"},language:_});if(l.length!==1)throw new Error("MyError: multiple city found");const{geometry:M}=l[0],g=(d=(u=M.bounds)==null?void 0:u.toJSON())!=null?d:M.viewport.toJSON();i.name=r,i.bound=g,n==null||n({name:r,bound:g})}),i},tr=e=>{const{supplier:t}=A();return t==="gmap"?er(e):qo(e)},nr=e=>{const{cityNameRef:t}=e,n=tr({cityNameRef:t,onChange:c=>o(c)}),{autoCompletePlaces:a,setKeyword:i,setCity:o}=Ko({city:n});return{autoCompletePlaces:a,setKeyword:i,setCity:o,handleKeywordInput:c=>{const l=c.target;i(l.value)}}},ar=()=>{const{setMap:e,mapRef:t}=le(),{registerFitVeiw:n,setFitView:a}=ce({mapRef:t,padding:[25,20,15,15]});return{setMap:e,registerFitVeiw:n,setFitView:a}},ir=()=>{const e=s.reactive({lng:0,lat:0,name:""}),t=s.ref([]),{apiMapDistance:n}=Se(),a=r=>o.panToGeoPositionByRecomend(r),i=r=>o.setCenterPlaceByUserSpecified(r),o={panToGeoPositionByRecomend:()=>{throw new Error("MyError: panToGeoPositionByRecomend used before assigned")},setCenterPlaceByUserSpecified:()=>{throw new Error("MyError: setCenterPlaceByRecomand used before assigned")},onChangeCenterPlace:r=>{Object.assign(e,{...r})},onChangeRecomendPlaces:r=>{t.value=[...r]}};return{mapContext:o,centerPlace:e,placeCandidates:t,panToGeoPositionByRecomend:a,setCenterPlaceByUserSpecified:i,apiMapDistance:n}},or=()=>{const{mapRef:e,setMap:t}=le(),{registerFitVeiw:n,setFitView:a}=ce({mapRef:e,autoFitTimeout:5e3,padding:[25,20,15,15]});return{setMap:t,registerFitVeiw:n,setFitView:a}};exports.AbsoluteAddressBox=Tt;exports.AddressBox=xi;exports.BusinessQuotingMap=io;exports.BusinessRecomendPlaceMap=Co;exports.BusinessTaxiEndMap=Ho;exports.BusinessTaxiServiceMap=Jo;exports.DrivingLine=re;exports.DrivingRoute=se;exports.HeycarMap=oe;exports.MapProvider=Ui;exports.PassengerCircle=de;exports.PickupPoints=hn;exports.PlaceCircle=E;exports.StartEndPoint=b;exports.TaxiCar=Ne;exports.WalkingLine=ze;exports.WalkingRoute=Ze;exports.WaveCircle=Dn;exports.useBusinessMapAutoComplete=nr;exports.useBusinessQuotingMap=ar;exports.useBusinessRecomendPlaceMap=ir;exports.useBusinessTaxiServiceMap=or;exports.useDrivingRoute=Yi;exports.useGeoLocation=ue;exports.useHeycarMap=le;exports.useMapAngle=Qi;exports.useMapDrag=gn;exports.useMapFitView=ce;exports.useMapGeometry=Se;exports.useMapPlace=lo;exports.useMapRecomendPlace=mn;exports.useWalkingRoute=zo;
|
package/dist/index.js
CHANGED
|
@@ -288,11 +288,11 @@ var mi = {
|
|
|
288
288
|
œ: "oe",
|
|
289
289
|
ʼn: "'n",
|
|
290
290
|
ſ: "s"
|
|
291
|
-
},
|
|
292
|
-
const
|
|
291
|
+
}, fi = Mi(mi);
|
|
292
|
+
const pi = fi;
|
|
293
293
|
var vi = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, yi = "\\u0300-\\u036f", ji = "\\ufe20-\\ufe2f", Li = "\\u20d0-\\u20ff", Ai = yi + ji + Li, Ni = "[" + Ai + "]", Si = RegExp(Ni, "g");
|
|
294
294
|
function hi(e) {
|
|
295
|
-
return e = xt(e), e && e.replace(vi,
|
|
295
|
+
return e = xt(e), e && e.replace(vi, pi).replace(Si, "");
|
|
296
296
|
}
|
|
297
297
|
var Di = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
298
298
|
function wi(e) {
|
|
@@ -341,7 +341,7 @@ function sa(e, t, n) {
|
|
|
341
341
|
function m(D) {
|
|
342
342
|
return g = D, s = setTimeout(y, t), d ? I(D) : r;
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function f(D) {
|
|
345
345
|
var C = D - u, Z = D - g, W = t - C;
|
|
346
346
|
return c ? ra(W, o - Z) : W;
|
|
347
347
|
}
|
|
@@ -352,17 +352,17 @@ function sa(e, t, n) {
|
|
|
352
352
|
function y() {
|
|
353
353
|
var D = Te();
|
|
354
354
|
if (v(D))
|
|
355
|
-
return
|
|
356
|
-
s = setTimeout(y,
|
|
355
|
+
return p(D);
|
|
356
|
+
s = setTimeout(y, f(D));
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function p(D) {
|
|
359
359
|
return s = void 0, l && i ? I(D) : (i = a = void 0, r);
|
|
360
360
|
}
|
|
361
361
|
function L() {
|
|
362
362
|
s !== void 0 && clearTimeout(s), g = 0, i = u = a = s = void 0;
|
|
363
363
|
}
|
|
364
364
|
function A() {
|
|
365
|
-
return s === void 0 ? r :
|
|
365
|
+
return s === void 0 ? r : p(Te());
|
|
366
366
|
}
|
|
367
367
|
function E() {
|
|
368
368
|
var D = Te(), C = v(D);
|
|
@@ -419,14 +419,14 @@ function re(e) {
|
|
|
419
419
|
}
|
|
420
420
|
const G = M, ie = "zh-CN";
|
|
421
421
|
var ua = "n8tgem1", ot = "n8tgem0", la = "n8tgem5", da = "n8tgem4", ga = "n8tgem2", Ia = "n8tgem3", Ma = "n8tgem7", ma = "n8tgem6";
|
|
422
|
-
const
|
|
422
|
+
const fa = j((e) => {
|
|
423
423
|
const t = h(() => {
|
|
424
424
|
var n;
|
|
425
425
|
return (n = e.value) == null ? void 0 : n.split(`
|
|
426
426
|
`).flatMap((i, a) => a === 0 ? i : [M("br"), i]);
|
|
427
427
|
});
|
|
428
428
|
return () => M("div", [t.value]);
|
|
429
|
-
}),
|
|
429
|
+
}), pa = j((e, {
|
|
430
430
|
emit: t
|
|
431
431
|
}) => {
|
|
432
432
|
const n = () => t("click");
|
|
@@ -452,7 +452,7 @@ const pa = j((e) => {
|
|
|
452
452
|
}
|
|
453
453
|
}, [M("div", {
|
|
454
454
|
class: ga
|
|
455
|
-
}, [M(
|
|
455
|
+
}, [M(fa, {
|
|
456
456
|
class: Ia,
|
|
457
457
|
attrs: {
|
|
458
458
|
value: a
|
|
@@ -550,8 +550,8 @@ function Ft(e) {
|
|
|
550
550
|
if (m && c.get(r))
|
|
551
551
|
return m === r;
|
|
552
552
|
c.set(o, r), c.set(r, o);
|
|
553
|
-
var
|
|
554
|
-
return c.delete(o), c.delete(r),
|
|
553
|
+
var f = i(o, r, c);
|
|
554
|
+
return c.delete(o), c.delete(r), f;
|
|
555
555
|
};
|
|
556
556
|
};
|
|
557
557
|
}
|
|
@@ -934,21 +934,21 @@ var Re = {}, ka = {
|
|
|
934
934
|
return new Promise(function(l, I) {
|
|
935
935
|
var m = [];
|
|
936
936
|
if (c.plugins)
|
|
937
|
-
for (var
|
|
938
|
-
r.AMapUI.plugins.indexOf(c.plugins[
|
|
937
|
+
for (var f = 0; f < c.plugins.length; f += 1)
|
|
938
|
+
r.AMapUI.plugins.indexOf(c.plugins[f]) == -1 && m.push(c.plugins[f]);
|
|
939
939
|
if (s.AMapUI === o.failed)
|
|
940
940
|
I("前次请求 AMapUI 失败");
|
|
941
941
|
else if (s.AMapUI === o.notload) {
|
|
942
|
-
s.AMapUI = o.loading, r.AMapUI.version = c.version || r.AMapUI.version,
|
|
942
|
+
s.AMapUI = o.loading, r.AMapUI.version = c.version || r.AMapUI.version, f = r.AMapUI.version;
|
|
943
943
|
var v = document.body || document.head, y = document.createElement("script");
|
|
944
|
-
y.type = "text/javascript", y.src = "https://webapi.amap.com/ui/" +
|
|
944
|
+
y.type = "text/javascript", y.src = "https://webapi.amap.com/ui/" + f + "/main.js", y.onerror = function(p) {
|
|
945
945
|
s.AMapUI = o.failed, I("请求 AMapUI 失败");
|
|
946
946
|
}, y.onload = function() {
|
|
947
947
|
if (s.AMapUI = o.loaded, m.length)
|
|
948
948
|
window.AMapUI.loadUI(m, function() {
|
|
949
|
-
for (var
|
|
950
|
-
var A = m[
|
|
951
|
-
window.AMapUI[A] = arguments[
|
|
949
|
+
for (var p = 0, L = m.length; p < L; p++) {
|
|
950
|
+
var A = m[p].split("/").slice(-1)[0];
|
|
951
|
+
window.AMapUI[A] = arguments[p];
|
|
952
952
|
}
|
|
953
953
|
for (l(); u.AMapUI.length; )
|
|
954
954
|
u.AMapUI.splice(0, 1)[0]();
|
|
@@ -959,13 +959,13 @@ var Re = {}, ka = {
|
|
|
959
959
|
}, v.appendChild(y);
|
|
960
960
|
} else
|
|
961
961
|
s.AMapUI === o.loaded ? c.version && c.version !== r.AMapUI.version ? I("不允许多个版本 AMapUI 混用") : m.length ? window.AMapUI.loadUI(m, function() {
|
|
962
|
-
for (var
|
|
963
|
-
var A = m[
|
|
964
|
-
window.AMapUI[A] = arguments[
|
|
962
|
+
for (var p = 0, L = m.length; p < L; p++) {
|
|
963
|
+
var A = m[p].split("/").slice(-1)[0];
|
|
964
|
+
window.AMapUI[A] = arguments[p];
|
|
965
965
|
}
|
|
966
966
|
l();
|
|
967
|
-
}) : l() : c.version && c.version !== r.AMapUI.version ? I("不允许多个版本 AMapUI 混用") : u.AMapUI.push(function(
|
|
968
|
-
|
|
967
|
+
}) : l() : c.version && c.version !== r.AMapUI.version ? I("不允许多个版本 AMapUI 混用") : u.AMapUI.push(function(p) {
|
|
968
|
+
p ? I(p) : m.length ? window.AMapUI.loadUI(m, function() {
|
|
969
969
|
for (var L = 0, A = m.length; L < A; L++) {
|
|
970
970
|
var E = m[L].split("/").slice(-1)[0];
|
|
971
971
|
window.AMapUI[E] = arguments[L];
|
|
@@ -981,13 +981,13 @@ var Re = {}, ka = {
|
|
|
981
981
|
I("前次请求 Loca 失败");
|
|
982
982
|
else if (s.Loca === o.notload) {
|
|
983
983
|
s.Loca = o.loading, r.Loca.version = c.version || r.Loca.version;
|
|
984
|
-
var m = r.Loca.version,
|
|
985
|
-
if (
|
|
984
|
+
var m = r.Loca.version, f = r.AMap.version.startsWith("2"), v = m.startsWith("2");
|
|
985
|
+
if (f && !v || !f && v)
|
|
986
986
|
I("JSAPI 与 Loca 版本不对应!!");
|
|
987
987
|
else {
|
|
988
|
-
|
|
988
|
+
f = r.key, v = document.body || document.head;
|
|
989
989
|
var y = document.createElement("script");
|
|
990
|
-
y.type = "text/javascript", y.src = "https://webapi.amap.com/loca?v=" + m + "&key=" +
|
|
990
|
+
y.type = "text/javascript", y.src = "https://webapi.amap.com/loca?v=" + m + "&key=" + f, y.onerror = function(p) {
|
|
991
991
|
s.Loca = o.failed, I("请求 AMapUI 失败");
|
|
992
992
|
}, y.onload = function() {
|
|
993
993
|
for (s.Loca = o.loaded, l(); u.Loca.length; )
|
|
@@ -995,8 +995,8 @@ var Re = {}, ka = {
|
|
|
995
995
|
}, v.appendChild(y);
|
|
996
996
|
}
|
|
997
997
|
} else
|
|
998
|
-
s.Loca === o.loaded ? c.version && c.version !== r.Loca.version ? I("不允许多个版本 Loca 混用") : l() : c.version && c.version !== r.Loca.version ? I("不允许多个版本 Loca 混用") : u.Loca.push(function(
|
|
999
|
-
|
|
998
|
+
s.Loca === o.loaded ? c.version && c.version !== r.Loca.version ? I("不允许多个版本 Loca 混用") : l() : c.version && c.version !== r.Loca.version ? I("不允许多个版本 Loca 混用") : u.Loca.push(function(p) {
|
|
999
|
+
p ? I(p) : I();
|
|
1000
1000
|
});
|
|
1001
1001
|
});
|
|
1002
1002
|
}
|
|
@@ -1014,18 +1014,18 @@ var Re = {}, ka = {
|
|
|
1014
1014
|
if (s.AMap == o.failed)
|
|
1015
1015
|
I("");
|
|
1016
1016
|
else if (s.AMap == o.notload) {
|
|
1017
|
-
var m = c.key,
|
|
1018
|
-
m ? (window.AMap && location.host !== "lbs.amap.com" && I("禁止多种API加载方式混用"), r.key = m, r.AMap.version =
|
|
1019
|
-
if (delete window.___onAPILoaded,
|
|
1020
|
-
s.AMap = o.failed, I(
|
|
1017
|
+
var m = c.key, f = c.version, v = c.plugins;
|
|
1018
|
+
m ? (window.AMap && location.host !== "lbs.amap.com" && I("禁止多种API加载方式混用"), r.key = m, r.AMap.version = f || r.AMap.version, r.AMap.plugins = v || r.AMap.plugins, s.AMap = o.loading, f = document.body || document.head, window.___onAPILoaded = function(p) {
|
|
1019
|
+
if (delete window.___onAPILoaded, p)
|
|
1020
|
+
s.AMap = o.failed, I(p);
|
|
1021
1021
|
else
|
|
1022
1022
|
for (s.AMap = o.loaded, n(c).then(function() {
|
|
1023
1023
|
l(window.AMap);
|
|
1024
1024
|
}).catch(I); g.length; )
|
|
1025
1025
|
g.splice(0, 1)[0]();
|
|
1026
|
-
}, v = document.createElement("script"), v.type = "text/javascript", v.src = "https://webapi.amap.com/maps?callback=___onAPILoaded&v=" + r.AMap.version + "&key=" + m + "&plugin=" + r.AMap.plugins.join(","), v.onerror = function(
|
|
1027
|
-
s.AMap = o.failed, I(
|
|
1028
|
-
},
|
|
1026
|
+
}, v = document.createElement("script"), v.type = "text/javascript", v.src = "https://webapi.amap.com/maps?callback=___onAPILoaded&v=" + r.AMap.version + "&key=" + m + "&plugin=" + r.AMap.plugins.join(","), v.onerror = function(p) {
|
|
1027
|
+
s.AMap = o.failed, I(p);
|
|
1028
|
+
}, f.appendChild(v)) : I("请填写key");
|
|
1029
1029
|
} else if (s.AMap == o.loaded)
|
|
1030
1030
|
if (c.key && c.key !== r.key)
|
|
1031
1031
|
I("多个不一致的 key");
|
|
@@ -1033,8 +1033,8 @@ var Re = {}, ka = {
|
|
|
1033
1033
|
I("不允许多个版本 JSAPI 混用");
|
|
1034
1034
|
else {
|
|
1035
1035
|
if (m = [], c.plugins)
|
|
1036
|
-
for (
|
|
1037
|
-
r.AMap.plugins.indexOf(c.plugins[
|
|
1036
|
+
for (f = 0; f < c.plugins.length; f += 1)
|
|
1037
|
+
r.AMap.plugins.indexOf(c.plugins[f]) == -1 && m.push(c.plugins[f]);
|
|
1038
1038
|
m.length ? window.AMap.plugin(m, function() {
|
|
1039
1039
|
n(c).then(function() {
|
|
1040
1040
|
l(window.AMap);
|
|
@@ -1050,8 +1050,8 @@ var Re = {}, ka = {
|
|
|
1050
1050
|
else {
|
|
1051
1051
|
var y = [];
|
|
1052
1052
|
if (c.plugins)
|
|
1053
|
-
for (
|
|
1054
|
-
r.AMap.plugins.indexOf(c.plugins[
|
|
1053
|
+
for (f = 0; f < c.plugins.length; f += 1)
|
|
1054
|
+
r.AMap.plugins.indexOf(c.plugins[f]) == -1 && y.push(c.plugins[f]);
|
|
1055
1055
|
d(function() {
|
|
1056
1056
|
y.length ? window.AMap.plugin(y, function() {
|
|
1057
1057
|
n(c).then(function() {
|
|
@@ -1453,7 +1453,7 @@ const $a = j((e, { slots: t, emit: n }) => {
|
|
|
1453
1453
|
n("dragEnd", [s, u]);
|
|
1454
1454
|
};
|
|
1455
1455
|
return () => {
|
|
1456
|
-
var m,
|
|
1456
|
+
var m, f, v;
|
|
1457
1457
|
const {
|
|
1458
1458
|
supplier: r,
|
|
1459
1459
|
gmapId: s,
|
|
@@ -1467,7 +1467,7 @@ const $a = j((e, { slots: t, emit: n }) => {
|
|
|
1467
1467
|
if (g === oe.LOADING)
|
|
1468
1468
|
return (m = t.loading) == null ? void 0 : m.call(t);
|
|
1469
1469
|
if (g === oe.FAILURE)
|
|
1470
|
-
return (
|
|
1470
|
+
return (f = t.fallback) == null ? void 0 : f.call(t);
|
|
1471
1471
|
const I = (v = t.default) == null ? void 0 : v.call(t);
|
|
1472
1472
|
switch (r) {
|
|
1473
1473
|
case "gmap":
|
|
@@ -1677,11 +1677,11 @@ const $a = j((e, { slots: t, emit: n }) => {
|
|
|
1677
1677
|
switch (r) {
|
|
1678
1678
|
case google.maps.DirectionsStatus.OK: {
|
|
1679
1679
|
let c = [], l = 0, I = 0;
|
|
1680
|
-
const m = o.routes[0],
|
|
1680
|
+
const m = o.routes[0], f = m.overview_path.map((v) => [
|
|
1681
1681
|
v.lng(),
|
|
1682
1682
|
v.lat()
|
|
1683
1683
|
]);
|
|
1684
|
-
c = c.concat(
|
|
1684
|
+
c = c.concat(f);
|
|
1685
1685
|
for (const v of m.legs)
|
|
1686
1686
|
l += (u = (s = v.distance) == null ? void 0 : s.value) != null ? u : 0, I += (d = (g = v.duration) == null ? void 0 : g.value) != null ? d : 0;
|
|
1687
1687
|
t.path = c, t.distance = l, t.duration = I;
|
|
@@ -1815,13 +1815,13 @@ const oo = (e) => {
|
|
|
1815
1815
|
const d = t.value;
|
|
1816
1816
|
if (!d)
|
|
1817
1817
|
return;
|
|
1818
|
-
const c = window.innerWidth / 100, [l, I, m,
|
|
1818
|
+
const c = window.innerWidth / 100, [l, I, m, f] = (v = e.padding) != null ? v : [0, 0, 0, 0];
|
|
1819
1819
|
i(
|
|
1820
1820
|
() => d.fitBounds(a.getBound(), {
|
|
1821
1821
|
top: l * c,
|
|
1822
1822
|
right: I * c,
|
|
1823
1823
|
bottom: m * c,
|
|
1824
|
-
left:
|
|
1824
|
+
left: f * c
|
|
1825
1825
|
})
|
|
1826
1826
|
);
|
|
1827
1827
|
}, s = {
|
|
@@ -1871,7 +1871,7 @@ const ro = j((e, {
|
|
|
1871
1871
|
var a;
|
|
1872
1872
|
return M("div", [(a = t.default) == null ? void 0 : a.call(t)]);
|
|
1873
1873
|
};
|
|
1874
|
-
}), mn = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSI3Mi4zMzklIiB5MT0iNTAlIiB4Mj0iMCUiIHkyPSI1MCUiIGlkPSJwcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9IiNGRjg0NDciIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkY4QjRBIiBvZmZzZXQ9IjUwLjU5NiUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZBOTVBIiBvZmZzZXQ9IjEwMCUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiAzMC4yMTVjMi4xMzQgMCAzLjg2My0uODkzIDMuODYzLTEuOTk1IDAtMS4xLTEuNzMtMS45OTQtMy44NjMtMS45OTQtMi4xMzQgMC0zLjg2My44OTMtMy44NjMgMS45OTQgMCAxLjEwMiAxLjczIDEuOTk1IDMuODYzIDEuOTk1eiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSAyNy4wMDZjMi4xMjggMC0uOS0zLjc0MyA1LjYyMS02LjY0M0MxOS44NDIgMTguNDUzIDIyIDE0Ljk1MyAyMiAxMC45NSAyMiA0LjkwMiAxNy4wNzUgMCAxMSAwUzAgNC45MDIgMCAxMC45NWMwIDMuOTE4IDIuMDY4IDcuMzU2IDUuMTc3IDkuMjlDMTEuNzUgMjMuMjg0IDkuMDYgMjcuMDA3IDExIDI3LjAwN3oiIHN0cm9rZT0iI0ZGRiIgZmlsbD0idXJsKCNwcmVmaXhfX2EpIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSIvPjx0ZXh0IGZvbnQtZmFtaWx5PSJQaW5nRmFuZ1NDLVNlbWlib2xkLCBQaW5nRmFuZyBTQyIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9IjUwMCIgZmlsbD0iI0ZGRiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxLjIxNSkiPjx0c3BhbiB4PSI1IiB5PSIxNS40NDkiPue7iDwvdHNwYW4+PC90ZXh0PjwvZz48L3N2Zz4=",
|
|
1874
|
+
}), mn = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSI3Mi4zMzklIiB5MT0iNTAlIiB4Mj0iMCUiIHkyPSI1MCUiIGlkPSJwcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9IiNGRjg0NDciIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkY4QjRBIiBvZmZzZXQ9IjUwLjU5NiUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZBOTVBIiBvZmZzZXQ9IjEwMCUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiAzMC4yMTVjMi4xMzQgMCAzLjg2My0uODkzIDMuODYzLTEuOTk1IDAtMS4xLTEuNzMtMS45OTQtMy44NjMtMS45OTQtMi4xMzQgMC0zLjg2My44OTMtMy44NjMgMS45OTQgMCAxLjEwMiAxLjczIDEuOTk1IDMuODYzIDEuOTk1eiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSAyNy4wMDZjMi4xMjggMC0uOS0zLjc0MyA1LjYyMS02LjY0M0MxOS44NDIgMTguNDUzIDIyIDE0Ljk1MyAyMiAxMC45NSAyMiA0LjkwMiAxNy4wNzUgMCAxMSAwUzAgNC45MDIgMCAxMC45NWMwIDMuOTE4IDIuMDY4IDcuMzU2IDUuMTc3IDkuMjlDMTEuNzUgMjMuMjg0IDkuMDYgMjcuMDA3IDExIDI3LjAwN3oiIHN0cm9rZT0iI0ZGRiIgZmlsbD0idXJsKCNwcmVmaXhfX2EpIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSIvPjx0ZXh0IGZvbnQtZmFtaWx5PSJQaW5nRmFuZ1NDLVNlbWlib2xkLCBQaW5nRmFuZyBTQyIgZm9udC1zaXplPSIxMiIgZm9udC13ZWlnaHQ9IjUwMCIgZmlsbD0iI0ZGRiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMSAxLjIxNSkiPjx0c3BhbiB4PSI1IiB5PSIxNS40NDkiPue7iDwvdHNwYW4+PC90ZXh0PjwvZz48L3N2Zz4=", fn = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSIwJSIgeTE9IjUwJSIgeDI9IjEyOS41OTklIiB5Mj0iNTAlIiBpZD0icHJlZml4X19hIj48c3RvcCBzdG9wLWNvbG9yPSIjMzZBOEZGIiBvZmZzZXQ9IjAlIi8+PHN0b3Agc3RvcC1jb2xvcj0iIzQ4NzFGMSIgb2Zmc2V0PSIxMDAlIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTIgMzAuMjE1YzEuOTUgMCAzLjUzMi0uODE2IDMuNTMyLTEuODIzIDAtMS4wMDctMS41ODEtMS44MjMtMy41MzItMS44MjMtMS45NSAwLTMuNTMyLjgxNi0zLjUzMiAxLjgyMyAwIDEuMDA3IDEuNTgxIDEuODIzIDMuNTMyIDEuODIzeiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSAyN2MyLjEyOCAwLS45LTMuNzQyIDUuNjIxLTYuNjQxIDMuMjIxLTEuOTEgNS4zNzktNS40MSA1LjM3OS05LjQxMkMyMiA0LjkwMSAxNy4wNzUgMCAxMSAwUzAgNC45MDEgMCAxMC45NDdjMCAzLjkxOCAyLjA2OCA3LjM1NSA1LjE3NyA5LjI5QzExLjc1IDIzLjI3NyA5LjA2IDI3IDExIDI3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
|
|
1875
1875
|
function so(e, t, n) {
|
|
1876
1876
|
return t in e ? Object.defineProperty(e, t, {
|
|
1877
1877
|
value: n,
|
|
@@ -1890,7 +1890,7 @@ function mt(e, t) {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
return n;
|
|
1892
1892
|
}
|
|
1893
|
-
function
|
|
1893
|
+
function ft(e) {
|
|
1894
1894
|
for (var t = 1; t < arguments.length; t++) {
|
|
1895
1895
|
var n = arguments[t] != null ? arguments[t] : {};
|
|
1896
1896
|
t % 2 ? mt(Object(n), !0).forEach(function(i) {
|
|
@@ -1909,7 +1909,7 @@ var co = (e, t, n) => {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
return !0;
|
|
1911
1911
|
}, q = (e) => (t) => {
|
|
1912
|
-
var n = e.defaultClassName, i =
|
|
1912
|
+
var n = e.defaultClassName, i = ft(ft({}, e.defaultVariants), t);
|
|
1913
1913
|
for (var a in i) {
|
|
1914
1914
|
var o, r = (o = i[a]) !== null && o !== void 0 ? o : e.defaultVariants[a];
|
|
1915
1915
|
if (r != null) {
|
|
@@ -1925,16 +1925,16 @@ var co = (e, t, n) => {
|
|
|
1925
1925
|
for (var [g, d] of e.compoundVariants)
|
|
1926
1926
|
co(g, i, e.defaultVariants) && (n += " " + d);
|
|
1927
1927
|
return n;
|
|
1928
|
-
}, X = q({ defaultClassName: "", variantClassNames: { type: { start: "_4a4ovk6", end: "_4a4ovk7" } }, defaultVariants: {}, compoundVariants: [] }),
|
|
1928
|
+
}, X = q({ defaultClassName: "", variantClassNames: { type: { start: "_4a4ovk6", end: "_4a4ovk7" } }, defaultVariants: {}, compoundVariants: [] }), pn = "_4a4ovk1", vn = "_4a4ovk4", yn = "_4a4ovk5", jn = "_4a4ovk3", fe = "_4a4ovk0", Ln = "_4a4ovk2";
|
|
1929
1929
|
const uo = j((e) => {
|
|
1930
1930
|
const t = h(() => {
|
|
1931
1931
|
var a;
|
|
1932
|
-
const n = e.type === "start" ?
|
|
1932
|
+
const n = e.type === "start" ? fn : mn, i = e.description ? Se(e.description).map((o) => o.type === "normal" ? o.value : `<span class="${yn}">${o.value}</span>`).join("") : "";
|
|
1933
1933
|
return !e.description && !e.title ? `<img src="${n}" class="${X({
|
|
1934
1934
|
type: e.type
|
|
1935
1935
|
})}">` : e.description ? `
|
|
1936
|
-
<div class="${
|
|
1937
|
-
<div class="${
|
|
1936
|
+
<div class="${fe}">
|
|
1937
|
+
<div class="${pn}">
|
|
1938
1938
|
<div class="${jn}">${(a = e.title) != null ? a : ""}</div>
|
|
1939
1939
|
<div class="${vn}">${i}</div>
|
|
1940
1940
|
</div>
|
|
@@ -1943,7 +1943,7 @@ const uo = j((e) => {
|
|
|
1943
1943
|
})}">
|
|
1944
1944
|
</div>
|
|
1945
1945
|
` : `
|
|
1946
|
-
<div class="${
|
|
1946
|
+
<div class="${fe}">
|
|
1947
1947
|
<div class="${Ln}">${e.title}</div>
|
|
1948
1948
|
<img src="${n}" class="${X({
|
|
1949
1949
|
type: e.type
|
|
@@ -1962,16 +1962,16 @@ const uo = j((e) => {
|
|
|
1962
1962
|
}), lo = j((e) => {
|
|
1963
1963
|
const t = h(() => {
|
|
1964
1964
|
var a;
|
|
1965
|
-
const n = e.type === "start" ?
|
|
1965
|
+
const n = e.type === "start" ? fn : mn, i = e.description ? Se(e.description).map((o) => o.type === "normal" ? o.value : `<span class="${yn}">${o.value}</span>`).join("") : "";
|
|
1966
1966
|
return !e.description && !e.title ? R("img", {
|
|
1967
1967
|
class: X({
|
|
1968
1968
|
type: e.type
|
|
1969
1969
|
}),
|
|
1970
1970
|
src: n
|
|
1971
1971
|
}) : e.description ? R("div", {
|
|
1972
|
-
class:
|
|
1972
|
+
class: fe
|
|
1973
1973
|
}, `
|
|
1974
|
-
<div class="${
|
|
1974
|
+
<div class="${pn}">
|
|
1975
1975
|
<div class="${jn}">${(a = e.title) != null ? a : ""}</div>
|
|
1976
1976
|
<div class="${vn}">${i}</div>
|
|
1977
1977
|
</div>
|
|
@@ -1979,7 +1979,7 @@ const uo = j((e) => {
|
|
|
1979
1979
|
type: e.type
|
|
1980
1980
|
})}">
|
|
1981
1981
|
`) : R("div", {
|
|
1982
|
-
class:
|
|
1982
|
+
class: fe
|
|
1983
1983
|
}, `
|
|
1984
1984
|
<div class="${Ln}">${e.title}</div>
|
|
1985
1985
|
<img src="${n}" class="${X({
|
|
@@ -2072,17 +2072,17 @@ const uo = j((e) => {
|
|
|
2072
2072
|
}), c = w([d.value.longitude, d.value.latitude]);
|
|
2073
2073
|
return b(
|
|
2074
2074
|
() => !0,
|
|
2075
|
-
(m,
|
|
2075
|
+
(m, f, v) => {
|
|
2076
2076
|
s.value = !0;
|
|
2077
2077
|
const y = navigator.geolocation.watchPosition(
|
|
2078
|
-
(
|
|
2079
|
-
const L =
|
|
2078
|
+
(p) => {
|
|
2079
|
+
const L = p.coords, A = [p.coords.longitude, p.coords.latitude];
|
|
2080
2080
|
d.value = L, c.value = A, s.value && (s.value = !1, u.value = !0, n == null || n({ position: A, coordinate: L })), t == null || t({ position: A, coordinate: L });
|
|
2081
2081
|
},
|
|
2082
|
-
(
|
|
2083
|
-
s.value = !1, g.value =
|
|
2082
|
+
(p) => {
|
|
2083
|
+
s.value = !1, g.value = p;
|
|
2084
2084
|
const L = e == null ? void 0 : e.geoDefaultPosition;
|
|
2085
|
-
L && !r && (r = !0, i == null || i({ position: L })), a == null || a(
|
|
2085
|
+
L && !r && (r = !0, i == null || i({ position: L })), a == null || a(p);
|
|
2086
2086
|
},
|
|
2087
2087
|
{ timeout: go, maximumAge: 0, enableHighAccuracy: !1 }
|
|
2088
2088
|
);
|
|
@@ -2131,7 +2131,7 @@ const uo = j((e) => {
|
|
|
2131
2131
|
]), ae(t, {}, r, [
|
|
2132
2132
|
"onDragEnd"
|
|
2133
2133
|
]), { centerRef: i, isDragging: a };
|
|
2134
|
-
},
|
|
2134
|
+
}, fo = (e) => {
|
|
2135
2135
|
const { mapRef: t, onChange: n } = e, i = w([0, 0]), a = w(!1), o = () => {
|
|
2136
2136
|
me(() => {
|
|
2137
2137
|
a.value = !0;
|
|
@@ -2147,9 +2147,9 @@ const uo = j((e) => {
|
|
|
2147
2147
|
]), _(t, {}, r, [
|
|
2148
2148
|
"onDragEnd"
|
|
2149
2149
|
]), { centerRef: i, isDragging: a };
|
|
2150
|
-
},
|
|
2150
|
+
}, po = (e) => {
|
|
2151
2151
|
const { supplier: t } = N();
|
|
2152
|
-
return t === "gmap" ?
|
|
2152
|
+
return t === "gmap" ? fo(e) : mo(e);
|
|
2153
2153
|
}, ee = () => {
|
|
2154
2154
|
const e = w(0);
|
|
2155
2155
|
return { idx: e, update: () => {
|
|
@@ -2161,11 +2161,11 @@ const uo = j((e) => {
|
|
|
2161
2161
|
lat: a.value[1],
|
|
2162
2162
|
name: ""
|
|
2163
2163
|
}), { idx: s, update: u } = ee(), g = (l) => {
|
|
2164
|
-
const I = new AMap.Geocoder({ lang: ie }), { lng: m, lat:
|
|
2165
|
-
I.getAddress(new AMap.LngLat(m,
|
|
2164
|
+
const I = new AMap.Geocoder({ lang: ie }), { lng: m, lat: f } = l;
|
|
2165
|
+
I.getAddress(new AMap.LngLat(m, f), (v, y) => {
|
|
2166
2166
|
if (v !== "complete")
|
|
2167
2167
|
return;
|
|
2168
|
-
const { addressComponent:
|
|
2168
|
+
const { addressComponent: p } = y.regeocode, L = p.city ? p.city : p.province, A = p.province;
|
|
2169
2169
|
n == null || n({ cityName: L, cityParentName: A, countryName: "" });
|
|
2170
2170
|
});
|
|
2171
2171
|
}, d = (l) => {
|
|
@@ -2178,10 +2178,10 @@ const uo = j((e) => {
|
|
|
2178
2178
|
async () => {
|
|
2179
2179
|
await o;
|
|
2180
2180
|
const l = new AMap.Geocoder({ lang: ie }), [I, m] = a.value;
|
|
2181
|
-
l.getAddress(new AMap.LngLat(I, m), (
|
|
2182
|
-
switch (
|
|
2181
|
+
l.getAddress(new AMap.LngLat(I, m), (f, v) => {
|
|
2182
|
+
switch (f) {
|
|
2183
2183
|
case "complete": {
|
|
2184
|
-
const { formattedAddress: y, addressComponent:
|
|
2184
|
+
const { formattedAddress: y, addressComponent: p } = v.regeocode, L = p.city ? p.city : p.province, A = p.province;
|
|
2185
2185
|
r.name = y, r.lng = I, r.lat = m, t == null || t({ lng: I, lat: m, name: y }), n == null || n({ cityName: L, cityParentName: A, countryName: "" });
|
|
2186
2186
|
return;
|
|
2187
2187
|
}
|
|
@@ -2204,15 +2204,15 @@ const uo = j((e) => {
|
|
|
2204
2204
|
}, d = (l) => {
|
|
2205
2205
|
u.lng = l.lng, u.lat = l.lat, u.name = l.name;
|
|
2206
2206
|
}, c = async (l) => {
|
|
2207
|
-
const I = new google.maps.Geocoder(), { lng: m, lat:
|
|
2208
|
-
n == null || n({ cityName: y, cityParentName:
|
|
2207
|
+
const I = new google.maps.Geocoder(), { lng: m, lat: f } = l, { results: v } = await I.geocode({ language: ie, location: { lng: m, lat: f } }), y = It(v[0]), p = v.slice(-2)[0].address_components[0].long_name, L = v.slice(-1)[0].address_components[0].long_name;
|
|
2208
|
+
n == null || n({ cityName: y, cityParentName: p, countryName: L });
|
|
2209
2209
|
};
|
|
2210
2210
|
return b(
|
|
2211
2211
|
() => r.value,
|
|
2212
2212
|
async () => {
|
|
2213
2213
|
await o;
|
|
2214
|
-
const l = new google.maps.Geocoder(), [I, m] = a.value, { results:
|
|
2215
|
-
u.lng = I, u.lat = m, u.name = v, t == null || t({ lng: I, lat: m, name: v }), n == null || n({ cityName: y, cityParentName:
|
|
2214
|
+
const l = new google.maps.Geocoder(), [I, m] = a.value, { results: f } = await l.geocode({ language: ie, location: { lng: I, lat: m } }), v = f[0].formatted_address, y = It(f[0]), p = f.slice(-2)[0].address_components[0].long_name, L = f.slice(-1)[0].address_components[0].long_name;
|
|
2215
|
+
u.lng = I, u.lat = m, u.name = v, t == null || t({ lng: I, lat: m, name: v }), n == null || n({ cityName: y, cityParentName: p, countryName: L });
|
|
2216
2216
|
}
|
|
2217
2217
|
), { place: u, updatePlace: g, setPlace: d, updateCity: c };
|
|
2218
2218
|
}, Ir = (e) => {
|
|
@@ -2233,11 +2233,11 @@ const uo = j((e) => {
|
|
|
2233
2233
|
}
|
|
2234
2234
|
return { shortestPlace: i, shortestDistance: n };
|
|
2235
2235
|
}, jo = (e) => {
|
|
2236
|
-
const { pointRef: t, getRecomendPlace: n, getLimit: i, context: a, onChange: o, onChangePlace: r, onChangeCity: s } = e, u = w(!0), g = w([]), { idx: d, update: c } = ee(), { readyPromise: l } = N(), { place: I, updatePlace: m, setPlace:
|
|
2236
|
+
const { pointRef: t, getRecomendPlace: n, getLimit: i, context: a, onChange: o, onChangePlace: r, onChangeCity: s } = e, u = w(!0), g = w([]), { idx: d, update: c } = ee(), { readyPromise: l } = N(), { place: I, updatePlace: m, setPlace: f, updateCity: v } = An({
|
|
2237
2237
|
pointRef: t,
|
|
2238
2238
|
onChange: r,
|
|
2239
2239
|
onChangeCity: s
|
|
2240
|
-
}), y = P({ ...I }),
|
|
2240
|
+
}), y = P({ ...I }), p = h(() => {
|
|
2241
2241
|
const L = t.value;
|
|
2242
2242
|
return g.value.some(
|
|
2243
2243
|
(A) => _t(x(A), L)
|
|
@@ -2259,18 +2259,18 @@ const uo = j((e) => {
|
|
|
2259
2259
|
recomendPlace: y,
|
|
2260
2260
|
placeCandidates: g,
|
|
2261
2261
|
availableRef: u,
|
|
2262
|
-
isElectedRef:
|
|
2262
|
+
isElectedRef: p,
|
|
2263
2263
|
updateRecomandPlace: c,
|
|
2264
2264
|
updatePlace: m,
|
|
2265
|
-
setPlace:
|
|
2265
|
+
setPlace: f,
|
|
2266
2266
|
updateCity: v
|
|
2267
2267
|
};
|
|
2268
2268
|
}, Lo = (e) => {
|
|
2269
|
-
const { pointRef: t, getRecomendPlace: n, getLimit: i, context: a, onChange: o, onChangePlace: r, onChangeCity: s } = e, u = w(!0), g = w([]), { idx: d, update: c } = ee(), { readyPromise: l } = N(), { place: I, updatePlace: m, setPlace:
|
|
2269
|
+
const { pointRef: t, getRecomendPlace: n, getLimit: i, context: a, onChange: o, onChangePlace: r, onChangeCity: s } = e, u = w(!0), g = w([]), { idx: d, update: c } = ee(), { readyPromise: l } = N(), { place: I, updatePlace: m, setPlace: f, updateCity: v } = Nn({
|
|
2270
2270
|
pointRef: t,
|
|
2271
2271
|
onChange: r,
|
|
2272
2272
|
onChangeCity: s
|
|
2273
|
-
}), y = P({ ...I }),
|
|
2273
|
+
}), y = P({ ...I }), p = h(() => {
|
|
2274
2274
|
const L = t.value;
|
|
2275
2275
|
return g.value.some(
|
|
2276
2276
|
(A) => _t(x(A), L)
|
|
@@ -2292,10 +2292,10 @@ const uo = j((e) => {
|
|
|
2292
2292
|
recomendPlace: y,
|
|
2293
2293
|
placeCandidates: g,
|
|
2294
2294
|
availableRef: u,
|
|
2295
|
-
isElectedRef:
|
|
2295
|
+
isElectedRef: p,
|
|
2296
2296
|
updateRecomandPlace: c,
|
|
2297
2297
|
updatePlace: m,
|
|
2298
|
-
setPlace:
|
|
2298
|
+
setPlace: f,
|
|
2299
2299
|
updateCity: v
|
|
2300
2300
|
};
|
|
2301
2301
|
}, Ao = (e) => {
|
|
@@ -2368,14 +2368,14 @@ const So = j((e) => {
|
|
|
2368
2368
|
}, wo = () => {
|
|
2369
2369
|
const e = ce();
|
|
2370
2370
|
return { apiMapLngLatToVw: (n) => {
|
|
2371
|
-
var c, l, I, m,
|
|
2372
|
-
const [i, a] = n, o = (c = e == null ? void 0 : e.value) == null ? void 0 : c.getProjection(), r = o == null ? void 0 : o.fromLatLngToPoint({ lng: i, lat: a }), s = (l = r == null ? void 0 : r.x) != null ? l : 0, u = (I = r == null ? void 0 : r.y) != null ? I : 0, d = 2 ** ((
|
|
2371
|
+
var c, l, I, m, f;
|
|
2372
|
+
const [i, a] = n, o = (c = e == null ? void 0 : e.value) == null ? void 0 : c.getProjection(), r = o == null ? void 0 : o.fromLatLngToPoint({ lng: i, lat: a }), s = (l = r == null ? void 0 : r.x) != null ? l : 0, u = (I = r == null ? void 0 : r.y) != null ? I : 0, d = 2 ** ((f = (m = e == null ? void 0 : e.value) == null ? void 0 : m.getZoom()) != null ? f : 0);
|
|
2373
2373
|
return [s * d, u * d];
|
|
2374
2374
|
} };
|
|
2375
2375
|
}, xo = () => {
|
|
2376
2376
|
const { supplier: e } = N();
|
|
2377
2377
|
return e === "gmap" ? wo() : Do();
|
|
2378
|
-
},
|
|
2378
|
+
}, pt = (e) => e === "left" ? "right" : "left", Co = (e) => {
|
|
2379
2379
|
const { widthLimit: t, heightLimit: n } = e, { apiMapLngLatToVw: i } = xo(), a = (r, s) => {
|
|
2380
2380
|
const u = 100 / window.innerWidth, [g, d] = i(r), [c, l] = i(s);
|
|
2381
2381
|
return [(c - g) * u, (l - d) * u];
|
|
@@ -2390,25 +2390,25 @@ const So = j((e) => {
|
|
|
2390
2390
|
for (let l = 0; l < u; l++) {
|
|
2391
2391
|
const { index: I } = s[l];
|
|
2392
2392
|
if (l === u - 1) {
|
|
2393
|
-
g[I] = c ?
|
|
2393
|
+
g[I] = c ? pt(d) : "right";
|
|
2394
2394
|
continue;
|
|
2395
2395
|
}
|
|
2396
2396
|
if (l === 0) {
|
|
2397
|
-
const [y,
|
|
2398
|
-
c = y > -t && y < t &&
|
|
2397
|
+
const [y, p] = a(s[l].point, s[l + 1].point);
|
|
2398
|
+
c = y > -t && y < t && p > -n && p < n;
|
|
2399
2399
|
const L = c && y > 0 ? "left" : "right";
|
|
2400
2400
|
g[I] = L, d = L;
|
|
2401
2401
|
continue;
|
|
2402
2402
|
}
|
|
2403
|
-
const [m,
|
|
2404
|
-
g[I] = v, d = v, c = m > -t && m < t &&
|
|
2403
|
+
const [m, f] = a(s[l].point, s[l + 1].point), v = c ? pt(d) : "right";
|
|
2404
|
+
g[I] = v, d = v, c = m > -t && m < t && f > -n && f < n;
|
|
2405
2405
|
}
|
|
2406
2406
|
o.value = g;
|
|
2407
2407
|
}
|
|
2408
2408
|
), o;
|
|
2409
2409
|
};
|
|
2410
2410
|
var Ze = /* @__PURE__ */ ((e) => (e.topLeft = "top-left", e.topCenter = "top-center", e.topRight = "top-right", e.middleLeft = "middle-left", e.center = "center", e.middleRight = "middle-right", e.bottomLeft = "bottom-left", e.bottomCenter = "bottom-center", e.bottomRight = "bottom-right", e))(Ze || {});
|
|
2411
|
-
var vt = q({ defaultClassName: "", variantClassNames: { textAlign: { left: "fhyw83", right: "fhyw84" } }, defaultVariants: {}, compoundVariants: [] }), yt = q({ defaultClassName: "fhyw85", variantClassNames: { textAlign: { left: "fhyw86", right: "fhyw87" } }, defaultVariants: {}, compoundVariants: [] }), Dn = "fhyw8b", wn = q({ defaultClassName: "fhyw80", variantClassNames: { textAlign: { left: "fhyw81", right: "fhyw82" } }, defaultVariants: {}, compoundVariants: [] }),
|
|
2411
|
+
var vt = q({ defaultClassName: "", variantClassNames: { textAlign: { left: "fhyw83", right: "fhyw84" } }, defaultVariants: {}, compoundVariants: [] }), yt = q({ defaultClassName: "fhyw85", variantClassNames: { textAlign: { left: "fhyw86", right: "fhyw87" } }, defaultVariants: {}, compoundVariants: [] }), Dn = "fhyw8b", wn = q({ defaultClassName: "fhyw80", variantClassNames: { textAlign: { left: "fhyw81", right: "fhyw82" } }, defaultVariants: {}, compoundVariants: [] }), pe = q({ defaultClassName: "fhyw88", variantClassNames: { hideIcon: { true: "fhyw89", false: "fhyw8a" } }, defaultVariants: {}, compoundVariants: [] });
|
|
2412
2412
|
const Po = j((e, {
|
|
2413
2413
|
emit: t
|
|
2414
2414
|
}) => {
|
|
@@ -2423,7 +2423,7 @@ const Po = j((e, {
|
|
|
2423
2423
|
<div class="${wn({
|
|
2424
2424
|
textAlign: n.value
|
|
2425
2425
|
})}">
|
|
2426
|
-
<img class="${
|
|
2426
|
+
<img class="${pe({
|
|
2427
2427
|
hideIcon: r
|
|
2428
2428
|
})} ${vt({
|
|
2429
2429
|
textAlign: n.value
|
|
@@ -2435,7 +2435,7 @@ const Po = j((e, {
|
|
|
2435
2435
|
const {
|
|
2436
2436
|
hideIcon: r = !1
|
|
2437
2437
|
} = e;
|
|
2438
|
-
return `<img class="${
|
|
2438
|
+
return `<img class="${pe({
|
|
2439
2439
|
hideIcon: r
|
|
2440
2440
|
})} ${vt({
|
|
2441
2441
|
textAlign: n.value
|
|
@@ -2470,7 +2470,7 @@ const Po = j((e, {
|
|
|
2470
2470
|
textAlign: n.value
|
|
2471
2471
|
})}`
|
|
2472
2472
|
}, `
|
|
2473
|
-
<img class="${
|
|
2473
|
+
<img class="${pe({
|
|
2474
2474
|
hideIcon: r
|
|
2475
2475
|
})}" src="${U}">
|
|
2476
2476
|
<div class="${Dn}">${e.label}</div>
|
|
@@ -2480,7 +2480,7 @@ const Po = j((e, {
|
|
|
2480
2480
|
hideIcon: r = !1
|
|
2481
2481
|
} = e;
|
|
2482
2482
|
return R("img", {
|
|
2483
|
-
class: `${
|
|
2483
|
+
class: `${pe({
|
|
2484
2484
|
hideIcon: r
|
|
2485
2485
|
})} ${yt({
|
|
2486
2486
|
textAlign: n.value
|
|
@@ -2561,12 +2561,12 @@ const Po = j((e, {
|
|
|
2561
2561
|
l.source = "api", A(S);
|
|
2562
2562
|
}, m = (S) => {
|
|
2563
2563
|
l.source = "api", E(S), D(S), C();
|
|
2564
|
-
},
|
|
2564
|
+
}, f = (S) => {
|
|
2565
2565
|
l.source = "api", d.lng = S.lng, d.lat = S.lat, d.name = S.name;
|
|
2566
2566
|
}, {
|
|
2567
2567
|
geoPosition: v,
|
|
2568
2568
|
geoError: y,
|
|
2569
|
-
geoLoading:
|
|
2569
|
+
geoLoading: p
|
|
2570
2570
|
} = Ce({
|
|
2571
2571
|
geoDefaultPosition: n,
|
|
2572
2572
|
onLoad: async (S) => {
|
|
@@ -2581,7 +2581,7 @@ const Po = j((e, {
|
|
|
2581
2581
|
a.setCenterPlaceByUserSpecified = m, a.panToGeoPositionByRecomend = () => y.value ? !1 : (I(v.value), !0);
|
|
2582
2582
|
const {
|
|
2583
2583
|
isDragging: L
|
|
2584
|
-
} =
|
|
2584
|
+
} = po({
|
|
2585
2585
|
mapRef: o,
|
|
2586
2586
|
onChange: (S) => {
|
|
2587
2587
|
l.source = "drag", u(), A(S), t("changeByDrag", S);
|
|
@@ -2637,7 +2637,7 @@ const Po = j((e, {
|
|
|
2637
2637
|
zoom: 18,
|
|
2638
2638
|
mapRef: r
|
|
2639
2639
|
}
|
|
2640
|
-
}, [!
|
|
2640
|
+
}, [!p.value && !y.value && M(be, {
|
|
2641
2641
|
attrs: {
|
|
2642
2642
|
position: v.value
|
|
2643
2643
|
}
|
|
@@ -2647,9 +2647,9 @@ const Po = j((e, {
|
|
|
2647
2647
|
renderLabel: (Xe) => Ea(Xe, d) ? void 0 : Xe.name
|
|
2648
2648
|
},
|
|
2649
2649
|
on: {
|
|
2650
|
-
click:
|
|
2650
|
+
click: f
|
|
2651
2651
|
}
|
|
2652
|
-
}),
|
|
2652
|
+
}), p.value ? null : M(pa, {
|
|
2653
2653
|
attrs: {
|
|
2654
2654
|
title: S,
|
|
2655
2655
|
description: de,
|
|
@@ -3022,7 +3022,7 @@ const Yo = j((e) => {
|
|
|
3022
3022
|
})]);
|
|
3023
3023
|
})), Xo = j((e, {
|
|
3024
3024
|
emit: t
|
|
3025
|
-
}) => (H(() => t("mapMounted")), () => {
|
|
3025
|
+
}) => (H(() => t("mapMounted")), console.log("SectionDriverArrived:", e), () => {
|
|
3026
3026
|
const {
|
|
3027
3027
|
from: n,
|
|
3028
3028
|
carPosition: i,
|
|
@@ -3191,7 +3191,7 @@ const Yo = j((e) => {
|
|
|
3191
3191
|
})
|
|
3192
3192
|
}
|
|
3193
3193
|
})]);
|
|
3194
|
-
})),
|
|
3194
|
+
})), fr = j((e) => {
|
|
3195
3195
|
const {
|
|
3196
3196
|
mapRef: t,
|
|
3197
3197
|
setMap: n
|
|
@@ -3225,7 +3225,7 @@ const Yo = j((e) => {
|
|
|
3225
3225
|
}
|
|
3226
3226
|
})]);
|
|
3227
3227
|
};
|
|
3228
|
-
}), Ko = ["book-driverStartService", "dispatched", "driverStartService", "inService", "driverArrived"],
|
|
3228
|
+
}), Ko = ["book-driverStartService", "dispatched", "driverStartService", "inService", "driverArrived"], pr = re((e) => {
|
|
3229
3229
|
e.log && console.log(e);
|
|
3230
3230
|
const {
|
|
3231
3231
|
from: t,
|
|
@@ -3246,10 +3246,10 @@ const Yo = j((e) => {
|
|
|
3246
3246
|
return b(() => e.driverStatus, (l, I, m) => {
|
|
3247
3247
|
if (!Ko.includes(l))
|
|
3248
3248
|
return;
|
|
3249
|
-
const
|
|
3249
|
+
const f = setInterval(() => {
|
|
3250
3250
|
o().then((v) => c.value = v);
|
|
3251
3251
|
}, n);
|
|
3252
|
-
m(() => clearInterval(
|
|
3252
|
+
m(() => clearInterval(f));
|
|
3253
3253
|
}, {
|
|
3254
3254
|
immediate: !0
|
|
3255
3255
|
}), () => {
|
|
@@ -3257,10 +3257,10 @@ const Yo = j((e) => {
|
|
|
3257
3257
|
driverStatus: l,
|
|
3258
3258
|
from: I,
|
|
3259
3259
|
to: m,
|
|
3260
|
-
dispatchingTitle:
|
|
3260
|
+
dispatchingTitle: f,
|
|
3261
3261
|
bookDispatchingTitle: v,
|
|
3262
3262
|
bookDispatchedTitle: y,
|
|
3263
|
-
driverArrivedTitle:
|
|
3263
|
+
driverArrivedTitle: p
|
|
3264
3264
|
} = e, L = c.value, A = d.value ? void 0 : g.value;
|
|
3265
3265
|
return M(he, {
|
|
3266
3266
|
attrs: {
|
|
@@ -3271,7 +3271,7 @@ const Yo = j((e) => {
|
|
|
3271
3271
|
}, [l === "dispatching" ? M(Lt, {
|
|
3272
3272
|
attrs: {
|
|
3273
3273
|
from: I,
|
|
3274
|
-
title:
|
|
3274
|
+
title: f,
|
|
3275
3275
|
registerOverlay: i
|
|
3276
3276
|
},
|
|
3277
3277
|
on: {
|
|
@@ -3322,7 +3322,7 @@ const Yo = j((e) => {
|
|
|
3322
3322
|
from: I,
|
|
3323
3323
|
carPosition: L,
|
|
3324
3324
|
passengerPosition: A,
|
|
3325
|
-
title:
|
|
3325
|
+
title: p,
|
|
3326
3326
|
registerOverlay: i
|
|
3327
3327
|
},
|
|
3328
3328
|
on: {
|
|
@@ -3384,18 +3384,18 @@ const Yo = j((e) => {
|
|
|
3384
3384
|
if (!r.value)
|
|
3385
3385
|
return;
|
|
3386
3386
|
await i, new AMap.PlaceSearch({ city: n.value.name }).search(r.value, (I, m) => {
|
|
3387
|
-
const
|
|
3387
|
+
const f = o.value;
|
|
3388
3388
|
switch (I) {
|
|
3389
3389
|
case "complete": {
|
|
3390
3390
|
s.value = m.poiList.pois.map(
|
|
3391
3391
|
(v) => {
|
|
3392
|
-
const { lat: y, lng:
|
|
3392
|
+
const { lat: y, lng: p } = v.location;
|
|
3393
3393
|
return {
|
|
3394
3394
|
lat: y,
|
|
3395
|
-
lng:
|
|
3395
|
+
lng: p,
|
|
3396
3396
|
name: v.name,
|
|
3397
3397
|
description: v.address,
|
|
3398
|
-
distance:
|
|
3398
|
+
distance: f ? a(f, [p, y]) : void 0
|
|
3399
3399
|
};
|
|
3400
3400
|
}
|
|
3401
3401
|
);
|
|
@@ -3429,17 +3429,17 @@ const Yo = j((e) => {
|
|
|
3429
3429
|
query: r.value,
|
|
3430
3430
|
bounds: n.value.bound
|
|
3431
3431
|
},
|
|
3432
|
-
(m,
|
|
3432
|
+
(m, f) => {
|
|
3433
3433
|
const v = o.value;
|
|
3434
|
-
switch (
|
|
3434
|
+
switch (f) {
|
|
3435
3435
|
case google.maps.places.PlacesServiceStatus.OK:
|
|
3436
|
-
s.value = m.map(({ geometry: y, name:
|
|
3436
|
+
s.value = m.map(({ geometry: y, name: p, formatted_address: L }) => {
|
|
3437
3437
|
var D, C, Z, W;
|
|
3438
3438
|
const A = (C = (D = y == null ? void 0 : y.location) == null ? void 0 : D.lng()) != null ? C : 0, E = (W = (Z = y == null ? void 0 : y.location) == null ? void 0 : Z.lat()) != null ? W : 0;
|
|
3439
3439
|
return {
|
|
3440
3440
|
lng: A,
|
|
3441
3441
|
lat: E,
|
|
3442
|
-
name:
|
|
3442
|
+
name: p != null ? p : "",
|
|
3443
3443
|
description: L != null ? L : "",
|
|
3444
3444
|
distance: v ? a(v, [A, E]) : void 0
|
|
3445
3445
|
};
|
|
@@ -3550,12 +3550,12 @@ const Yo = j((e) => {
|
|
|
3550
3550
|
return { setMap: t, registerFitVeiw: n, setFitView: i };
|
|
3551
3551
|
};
|
|
3552
3552
|
export {
|
|
3553
|
-
|
|
3553
|
+
pa as AbsoluteAddressBox,
|
|
3554
3554
|
cr as AddressBox,
|
|
3555
3555
|
gr as BusinessQuotingMap,
|
|
3556
3556
|
Mr as BusinessRecomendPlaceMap,
|
|
3557
|
-
|
|
3558
|
-
|
|
3557
|
+
fr as BusinessTaxiEndMap,
|
|
3558
|
+
pr as BusinessTaxiServiceMap,
|
|
3559
3559
|
De as DrivingLine,
|
|
3560
3560
|
we as DrivingRoute,
|
|
3561
3561
|
he as HeycarMap,
|
|
@@ -3576,7 +3576,7 @@ export {
|
|
|
3576
3576
|
Ce as useGeoLocation,
|
|
3577
3577
|
Pe as useHeycarMap,
|
|
3578
3578
|
dr as useMapAngle,
|
|
3579
|
-
|
|
3579
|
+
po as useMapDrag,
|
|
3580
3580
|
xe as useMapFitView,
|
|
3581
3581
|
He as useMapGeometry,
|
|
3582
3582
|
Ir as useMapPlace,
|