@heycar/heycars-map 0.4.8 → 0.4.9
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/dist/index.cjs +70 -24
- package/dist/index.js +70 -24
- package/dist/utils/helper.d.ts +1 -0
- package/dist/utils/singleGeoWatch.d.ts +13 -0
- package/dist/utils/waitQueue.d.ts +7 -0
- package/package.json +1 -1
- package/todo.md +7 -13
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
+
var __publicField = (obj, key, value) => {
|
|
5
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
9
|
const Vue = require("vue");
|
|
4
10
|
const style = "";
|
|
@@ -2213,7 +2219,7 @@ const ADrivingLine = defineSetup(function ADrivingLine2(props) {
|
|
|
2213
2219
|
"attrs": {
|
|
2214
2220
|
"showDir": true,
|
|
2215
2221
|
"path": props.path,
|
|
2216
|
-
"strokeWeight": strokeWidth +
|
|
2222
|
+
"strokeWeight": strokeWidth + dirWidth,
|
|
2217
2223
|
"strokeOpacity": 1,
|
|
2218
2224
|
"strokeColor": "transparent",
|
|
2219
2225
|
"lineJoin": "round",
|
|
@@ -2896,6 +2902,49 @@ const BusinessQuotingMap = defineLagecySetup(function BusinessQuotingMap2(props)
|
|
|
2896
2902
|
})]);
|
|
2897
2903
|
};
|
|
2898
2904
|
}).props(["fallback", "from", "loading", "mapRef", "registerOverlay", "renderDescription", "to", "fromDescription", "log"]);
|
|
2905
|
+
const isPlace = (place) => {
|
|
2906
|
+
return place.lng !== void 0 && place.lat !== void 0;
|
|
2907
|
+
};
|
|
2908
|
+
const sleep = (milliSeconds) => new Promise((resolve) => setTimeout(resolve, milliSeconds));
|
|
2909
|
+
class SingleGeoWatch {
|
|
2910
|
+
constructor(option) {
|
|
2911
|
+
__publicField(this, "id", 0);
|
|
2912
|
+
__publicField(this, "listeners", /* @__PURE__ */ new Map());
|
|
2913
|
+
__publicField(this, "option", {});
|
|
2914
|
+
__publicField(this, "singleWatchId");
|
|
2915
|
+
this.option = option != null ? option : {};
|
|
2916
|
+
}
|
|
2917
|
+
watchPosition(onSuccess, onError) {
|
|
2918
|
+
this.id += 1;
|
|
2919
|
+
const { id } = this;
|
|
2920
|
+
this.listeners.set(id, [onSuccess, onError]);
|
|
2921
|
+
this.start();
|
|
2922
|
+
return id;
|
|
2923
|
+
}
|
|
2924
|
+
clearWatch(id) {
|
|
2925
|
+
this.listeners.delete(id);
|
|
2926
|
+
}
|
|
2927
|
+
async start() {
|
|
2928
|
+
const { listeners, option, singleWatchId } = this;
|
|
2929
|
+
if (singleWatchId) {
|
|
2930
|
+
navigator.geolocation.clearWatch(singleWatchId);
|
|
2931
|
+
await sleep(20);
|
|
2932
|
+
}
|
|
2933
|
+
this.singleWatchId = navigator.geolocation.watchPosition(
|
|
2934
|
+
(position) => {
|
|
2935
|
+
for (const [onSuccess] of listeners.values()) {
|
|
2936
|
+
onSuccess(position);
|
|
2937
|
+
}
|
|
2938
|
+
},
|
|
2939
|
+
(error) => {
|
|
2940
|
+
for (const [_, onError] of listeners.values()) {
|
|
2941
|
+
onError == null ? void 0 : onError(error);
|
|
2942
|
+
}
|
|
2943
|
+
},
|
|
2944
|
+
option
|
|
2945
|
+
);
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2899
2948
|
const useAmapGCJ02 = () => {
|
|
2900
2949
|
const { readyPromise } = useMapSupplier();
|
|
2901
2950
|
async function toGcj02(point) {
|
|
@@ -2926,6 +2975,11 @@ const useMapGCJ02 = () => {
|
|
|
2926
2975
|
return supplier === "gmap" ? useGmapGCJ02() : useAmapGCJ02();
|
|
2927
2976
|
};
|
|
2928
2977
|
const GEO_TIMEOUT = 5e3;
|
|
2978
|
+
const singleGeoWatch = new SingleGeoWatch({
|
|
2979
|
+
timeout: GEO_TIMEOUT,
|
|
2980
|
+
maximumAge: 0,
|
|
2981
|
+
enableHighAccuracy: false
|
|
2982
|
+
});
|
|
2929
2983
|
const useGeoLocation = (props) => {
|
|
2930
2984
|
var _a, _b;
|
|
2931
2985
|
const { onChange, onLoad, onLoadDefault, onError, geoDefaultPosition } = props != null ? props : {};
|
|
@@ -2948,12 +3002,11 @@ const useGeoLocation = (props) => {
|
|
|
2948
3002
|
() => true,
|
|
2949
3003
|
(_1, _2, onCleanup) => {
|
|
2950
3004
|
loading.value = true;
|
|
2951
|
-
const watchId =
|
|
3005
|
+
const watchId = singleGeoWatch.watchPosition(
|
|
2952
3006
|
async (position) => {
|
|
2953
3007
|
const coordinate = position.coords;
|
|
2954
3008
|
const wgsPoint = [position.coords.longitude, position.coords.latitude];
|
|
2955
3009
|
const point = await toGcj02(wgsPoint);
|
|
2956
|
-
console.log("wgsPoint, point = ", wgsPoint, point);
|
|
2957
3010
|
coordinateRef.value = coordinate;
|
|
2958
3011
|
positionRef.value = point;
|
|
2959
3012
|
if (loading.value) {
|
|
@@ -2972,10 +3025,9 @@ const useGeoLocation = (props) => {
|
|
|
2972
3025
|
onLoadDefault == null ? void 0 : onLoadDefault({ position });
|
|
2973
3026
|
}
|
|
2974
3027
|
onError == null ? void 0 : onError(error);
|
|
2975
|
-
}
|
|
2976
|
-
{ timeout: GEO_TIMEOUT, maximumAge: 0, enableHighAccuracy: false }
|
|
3028
|
+
}
|
|
2977
3029
|
);
|
|
2978
|
-
onCleanup(() =>
|
|
3030
|
+
onCleanup(() => singleGeoWatch.clearWatch(watchId));
|
|
2979
3031
|
},
|
|
2980
3032
|
{ immediate: true }
|
|
2981
3033
|
);
|
|
@@ -3935,9 +3987,6 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
3935
3987
|
};
|
|
3936
3988
|
}).props(["log", "geoLoadingTitle", "unavailableTitle", "recomendDescription", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
3937
3989
|
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
3938
|
-
const isPlace = (place) => {
|
|
3939
|
-
return place.lng !== void 0 && place.lat !== void 0;
|
|
3940
|
-
};
|
|
3941
3990
|
const useAmapGeometry = () => {
|
|
3942
3991
|
const payload = useMapSupplier();
|
|
3943
3992
|
const apiMapDistance = (from, to) => {
|
|
@@ -4756,7 +4805,6 @@ const BusinessTaxiEndMap = defineSetup(function BusinessTaxiEndMap2(props) {
|
|
|
4756
4805
|
const STATUS_NEED_CAR_POSITION = ["book-driverStartService", "dispatched", "driverStartService", "inService", "driverArrived"];
|
|
4757
4806
|
const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap2(props) {
|
|
4758
4807
|
const {
|
|
4759
|
-
from,
|
|
4760
4808
|
interval,
|
|
4761
4809
|
registerOverlay,
|
|
4762
4810
|
mapRef,
|
|
@@ -4768,9 +4816,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4768
4816
|
const {
|
|
4769
4817
|
geoPosition,
|
|
4770
4818
|
geoError
|
|
4771
|
-
} = useGeoLocation(
|
|
4772
|
-
geoDefaultPosition: place2point(from)
|
|
4773
|
-
});
|
|
4819
|
+
} = useGeoLocation();
|
|
4774
4820
|
const carPositionRef = Vue.ref(place2point(props.from));
|
|
4775
4821
|
Vue.watch(() => props.driverStatus, (status, _, onCleanup) => {
|
|
4776
4822
|
if (!STATUS_NEED_CAR_POSITION.includes(status))
|
|
@@ -4785,7 +4831,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4785
4831
|
return () => {
|
|
4786
4832
|
const {
|
|
4787
4833
|
driverStatus,
|
|
4788
|
-
from
|
|
4834
|
+
from,
|
|
4789
4835
|
to,
|
|
4790
4836
|
dispatchingTitle,
|
|
4791
4837
|
bookDispatchingTitle,
|
|
@@ -4796,7 +4842,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4796
4842
|
const passengerPosition = geoError.value ? void 0 : geoPosition.value;
|
|
4797
4843
|
return Vue.h(HeycarMap, {
|
|
4798
4844
|
"attrs": {
|
|
4799
|
-
"center": place2point(
|
|
4845
|
+
"center": place2point(from),
|
|
4800
4846
|
"zoom": 13,
|
|
4801
4847
|
"mapRef": mapRef,
|
|
4802
4848
|
"touchEnable": touchEnable
|
|
@@ -4806,26 +4852,26 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4806
4852
|
}
|
|
4807
4853
|
}, [driverStatus === "dispatching" ? Vue.h(SectionDispatching, {
|
|
4808
4854
|
"attrs": {
|
|
4809
|
-
"from":
|
|
4855
|
+
"from": from,
|
|
4810
4856
|
"title": dispatchingTitle,
|
|
4811
4857
|
"registerOverlay": registerOverlay
|
|
4812
4858
|
}
|
|
4813
4859
|
}) : driverStatus === "book-dispatching" ? Vue.h(SectionDispatching, {
|
|
4814
4860
|
"attrs": {
|
|
4815
|
-
"from":
|
|
4861
|
+
"from": from,
|
|
4816
4862
|
"title": bookDispatchingTitle,
|
|
4817
4863
|
"registerOverlay": registerOverlay
|
|
4818
4864
|
}
|
|
4819
4865
|
}) : driverStatus === "assign" || driverStatus === "confirmed" ? Vue.h(SectionConfirmed, {
|
|
4820
4866
|
"attrs": {
|
|
4821
|
-
"from":
|
|
4867
|
+
"from": from,
|
|
4822
4868
|
"to": to,
|
|
4823
4869
|
"passengerPosition": passengerPosition,
|
|
4824
4870
|
"registerOverlay": registerOverlay
|
|
4825
4871
|
}
|
|
4826
4872
|
}) : driverStatus === "dispatched" || driverStatus === "driverStartService" || driverStatus === "book-driverStartService" ? Vue.h(SectionDriverStartService, {
|
|
4827
4873
|
"attrs": {
|
|
4828
|
-
"from":
|
|
4874
|
+
"from": from,
|
|
4829
4875
|
"carPosition": carPosition,
|
|
4830
4876
|
"passengerPosition": passengerPosition,
|
|
4831
4877
|
"renderTitle": renderStartSerivceTitle,
|
|
@@ -4833,7 +4879,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4833
4879
|
}
|
|
4834
4880
|
}) : driverStatus === "book-dispatched" ? Vue.h(SectionBookDispatched, {
|
|
4835
4881
|
"attrs": {
|
|
4836
|
-
"from":
|
|
4882
|
+
"from": from,
|
|
4837
4883
|
"to": to,
|
|
4838
4884
|
"passengerPosition": passengerPosition,
|
|
4839
4885
|
"registerOverlay": registerOverlay
|
|
@@ -4847,7 +4893,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4847
4893
|
}
|
|
4848
4894
|
}) : driverStatus === "driverArrived" ? Vue.h(SectionDriverArrived, {
|
|
4849
4895
|
"attrs": {
|
|
4850
|
-
"from":
|
|
4896
|
+
"from": from,
|
|
4851
4897
|
"carPosition": carPosition,
|
|
4852
4898
|
"passengerPosition": passengerPosition,
|
|
4853
4899
|
"title": driverArrivedTitle,
|
|
@@ -4855,13 +4901,13 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4855
4901
|
}
|
|
4856
4902
|
}) : driverStatus === "canceled" || driverStatus === "canceling" ? Vue.h(SectionCanceled, {
|
|
4857
4903
|
"attrs": {
|
|
4858
|
-
"from":
|
|
4904
|
+
"from": from,
|
|
4859
4905
|
"to": to,
|
|
4860
4906
|
"registerOverlay": registerOverlay
|
|
4861
4907
|
}
|
|
4862
4908
|
}) : driverStatus === "endService" || driverStatus === "completed" || driverStatus === "banlanceRefund" || driverStatus === "waitBanlanceRefund" || driverStatus === "rechargePayed" || driverStatus === "waitRechargePay" || driverStatus === "payed" || driverStatus === "waitpay" || driverStatus === "refund" ? Vue.h(SectionEndService, {
|
|
4863
4909
|
"attrs": {
|
|
4864
|
-
"from":
|
|
4910
|
+
"from": from,
|
|
4865
4911
|
"to": to,
|
|
4866
4912
|
"registerOverlay": registerOverlay
|
|
4867
4913
|
}
|
|
@@ -4869,7 +4915,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4869
4915
|
// 匹配不到就显示灰色路线
|
|
4870
4916
|
Vue.h(SectionEndService, {
|
|
4871
4917
|
"attrs": {
|
|
4872
|
-
"from":
|
|
4918
|
+
"from": from,
|
|
4873
4919
|
"to": to,
|
|
4874
4920
|
"registerOverlay": registerOverlay
|
|
4875
4921
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
1
7
|
import Vue, { defineComponent, h, computed, inject, provide, watch, onMounted, onUnmounted, watchPostEffect, shallowRef, reactive, toRefs, ref, toRef, watchEffect } from "vue";
|
|
2
8
|
const style = "";
|
|
3
9
|
Vue.util.warn;
|
|
@@ -2211,7 +2217,7 @@ const ADrivingLine = defineSetup(function ADrivingLine2(props) {
|
|
|
2211
2217
|
"attrs": {
|
|
2212
2218
|
"showDir": true,
|
|
2213
2219
|
"path": props.path,
|
|
2214
|
-
"strokeWeight": strokeWidth +
|
|
2220
|
+
"strokeWeight": strokeWidth + dirWidth,
|
|
2215
2221
|
"strokeOpacity": 1,
|
|
2216
2222
|
"strokeColor": "transparent",
|
|
2217
2223
|
"lineJoin": "round",
|
|
@@ -2894,6 +2900,49 @@ const BusinessQuotingMap = defineLagecySetup(function BusinessQuotingMap2(props)
|
|
|
2894
2900
|
})]);
|
|
2895
2901
|
};
|
|
2896
2902
|
}).props(["fallback", "from", "loading", "mapRef", "registerOverlay", "renderDescription", "to", "fromDescription", "log"]);
|
|
2903
|
+
const isPlace = (place) => {
|
|
2904
|
+
return place.lng !== void 0 && place.lat !== void 0;
|
|
2905
|
+
};
|
|
2906
|
+
const sleep = (milliSeconds) => new Promise((resolve) => setTimeout(resolve, milliSeconds));
|
|
2907
|
+
class SingleGeoWatch {
|
|
2908
|
+
constructor(option) {
|
|
2909
|
+
__publicField(this, "id", 0);
|
|
2910
|
+
__publicField(this, "listeners", /* @__PURE__ */ new Map());
|
|
2911
|
+
__publicField(this, "option", {});
|
|
2912
|
+
__publicField(this, "singleWatchId");
|
|
2913
|
+
this.option = option != null ? option : {};
|
|
2914
|
+
}
|
|
2915
|
+
watchPosition(onSuccess, onError) {
|
|
2916
|
+
this.id += 1;
|
|
2917
|
+
const { id } = this;
|
|
2918
|
+
this.listeners.set(id, [onSuccess, onError]);
|
|
2919
|
+
this.start();
|
|
2920
|
+
return id;
|
|
2921
|
+
}
|
|
2922
|
+
clearWatch(id) {
|
|
2923
|
+
this.listeners.delete(id);
|
|
2924
|
+
}
|
|
2925
|
+
async start() {
|
|
2926
|
+
const { listeners, option, singleWatchId } = this;
|
|
2927
|
+
if (singleWatchId) {
|
|
2928
|
+
navigator.geolocation.clearWatch(singleWatchId);
|
|
2929
|
+
await sleep(20);
|
|
2930
|
+
}
|
|
2931
|
+
this.singleWatchId = navigator.geolocation.watchPosition(
|
|
2932
|
+
(position) => {
|
|
2933
|
+
for (const [onSuccess] of listeners.values()) {
|
|
2934
|
+
onSuccess(position);
|
|
2935
|
+
}
|
|
2936
|
+
},
|
|
2937
|
+
(error) => {
|
|
2938
|
+
for (const [_, onError] of listeners.values()) {
|
|
2939
|
+
onError == null ? void 0 : onError(error);
|
|
2940
|
+
}
|
|
2941
|
+
},
|
|
2942
|
+
option
|
|
2943
|
+
);
|
|
2944
|
+
}
|
|
2945
|
+
}
|
|
2897
2946
|
const useAmapGCJ02 = () => {
|
|
2898
2947
|
const { readyPromise } = useMapSupplier();
|
|
2899
2948
|
async function toGcj02(point) {
|
|
@@ -2924,6 +2973,11 @@ const useMapGCJ02 = () => {
|
|
|
2924
2973
|
return supplier === "gmap" ? useGmapGCJ02() : useAmapGCJ02();
|
|
2925
2974
|
};
|
|
2926
2975
|
const GEO_TIMEOUT = 5e3;
|
|
2976
|
+
const singleGeoWatch = new SingleGeoWatch({
|
|
2977
|
+
timeout: GEO_TIMEOUT,
|
|
2978
|
+
maximumAge: 0,
|
|
2979
|
+
enableHighAccuracy: false
|
|
2980
|
+
});
|
|
2927
2981
|
const useGeoLocation = (props) => {
|
|
2928
2982
|
var _a, _b;
|
|
2929
2983
|
const { onChange, onLoad, onLoadDefault, onError, geoDefaultPosition } = props != null ? props : {};
|
|
@@ -2946,12 +3000,11 @@ const useGeoLocation = (props) => {
|
|
|
2946
3000
|
() => true,
|
|
2947
3001
|
(_1, _2, onCleanup) => {
|
|
2948
3002
|
loading.value = true;
|
|
2949
|
-
const watchId =
|
|
3003
|
+
const watchId = singleGeoWatch.watchPosition(
|
|
2950
3004
|
async (position) => {
|
|
2951
3005
|
const coordinate = position.coords;
|
|
2952
3006
|
const wgsPoint = [position.coords.longitude, position.coords.latitude];
|
|
2953
3007
|
const point = await toGcj02(wgsPoint);
|
|
2954
|
-
console.log("wgsPoint, point = ", wgsPoint, point);
|
|
2955
3008
|
coordinateRef.value = coordinate;
|
|
2956
3009
|
positionRef.value = point;
|
|
2957
3010
|
if (loading.value) {
|
|
@@ -2970,10 +3023,9 @@ const useGeoLocation = (props) => {
|
|
|
2970
3023
|
onLoadDefault == null ? void 0 : onLoadDefault({ position });
|
|
2971
3024
|
}
|
|
2972
3025
|
onError == null ? void 0 : onError(error);
|
|
2973
|
-
}
|
|
2974
|
-
{ timeout: GEO_TIMEOUT, maximumAge: 0, enableHighAccuracy: false }
|
|
3026
|
+
}
|
|
2975
3027
|
);
|
|
2976
|
-
onCleanup(() =>
|
|
3028
|
+
onCleanup(() => singleGeoWatch.clearWatch(watchId));
|
|
2977
3029
|
},
|
|
2978
3030
|
{ immediate: true }
|
|
2979
3031
|
);
|
|
@@ -3933,9 +3985,6 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
3933
3985
|
};
|
|
3934
3986
|
}).props(["log", "geoLoadingTitle", "unavailableTitle", "recomendDescription", "fallback", "geoDefaultPosition", "getRecomendPlace", "getDefaultCenterPlace", "loading", "mapContext"]);
|
|
3935
3987
|
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
3936
|
-
const isPlace = (place) => {
|
|
3937
|
-
return place.lng !== void 0 && place.lat !== void 0;
|
|
3938
|
-
};
|
|
3939
3988
|
const useAmapGeometry = () => {
|
|
3940
3989
|
const payload = useMapSupplier();
|
|
3941
3990
|
const apiMapDistance = (from, to) => {
|
|
@@ -4754,7 +4803,6 @@ const BusinessTaxiEndMap = defineSetup(function BusinessTaxiEndMap2(props) {
|
|
|
4754
4803
|
const STATUS_NEED_CAR_POSITION = ["book-driverStartService", "dispatched", "driverStartService", "inService", "driverArrived"];
|
|
4755
4804
|
const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap2(props) {
|
|
4756
4805
|
const {
|
|
4757
|
-
from,
|
|
4758
4806
|
interval,
|
|
4759
4807
|
registerOverlay,
|
|
4760
4808
|
mapRef,
|
|
@@ -4766,9 +4814,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4766
4814
|
const {
|
|
4767
4815
|
geoPosition,
|
|
4768
4816
|
geoError
|
|
4769
|
-
} = useGeoLocation(
|
|
4770
|
-
geoDefaultPosition: place2point(from)
|
|
4771
|
-
});
|
|
4817
|
+
} = useGeoLocation();
|
|
4772
4818
|
const carPositionRef = ref(place2point(props.from));
|
|
4773
4819
|
watch(() => props.driverStatus, (status, _, onCleanup) => {
|
|
4774
4820
|
if (!STATUS_NEED_CAR_POSITION.includes(status))
|
|
@@ -4783,7 +4829,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4783
4829
|
return () => {
|
|
4784
4830
|
const {
|
|
4785
4831
|
driverStatus,
|
|
4786
|
-
from
|
|
4832
|
+
from,
|
|
4787
4833
|
to,
|
|
4788
4834
|
dispatchingTitle,
|
|
4789
4835
|
bookDispatchingTitle,
|
|
@@ -4794,7 +4840,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4794
4840
|
const passengerPosition = geoError.value ? void 0 : geoPosition.value;
|
|
4795
4841
|
return h(HeycarMap, {
|
|
4796
4842
|
"attrs": {
|
|
4797
|
-
"center": place2point(
|
|
4843
|
+
"center": place2point(from),
|
|
4798
4844
|
"zoom": 13,
|
|
4799
4845
|
"mapRef": mapRef,
|
|
4800
4846
|
"touchEnable": touchEnable
|
|
@@ -4804,26 +4850,26 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4804
4850
|
}
|
|
4805
4851
|
}, [driverStatus === "dispatching" ? h(SectionDispatching, {
|
|
4806
4852
|
"attrs": {
|
|
4807
|
-
"from":
|
|
4853
|
+
"from": from,
|
|
4808
4854
|
"title": dispatchingTitle,
|
|
4809
4855
|
"registerOverlay": registerOverlay
|
|
4810
4856
|
}
|
|
4811
4857
|
}) : driverStatus === "book-dispatching" ? h(SectionDispatching, {
|
|
4812
4858
|
"attrs": {
|
|
4813
|
-
"from":
|
|
4859
|
+
"from": from,
|
|
4814
4860
|
"title": bookDispatchingTitle,
|
|
4815
4861
|
"registerOverlay": registerOverlay
|
|
4816
4862
|
}
|
|
4817
4863
|
}) : driverStatus === "assign" || driverStatus === "confirmed" ? h(SectionConfirmed, {
|
|
4818
4864
|
"attrs": {
|
|
4819
|
-
"from":
|
|
4865
|
+
"from": from,
|
|
4820
4866
|
"to": to,
|
|
4821
4867
|
"passengerPosition": passengerPosition,
|
|
4822
4868
|
"registerOverlay": registerOverlay
|
|
4823
4869
|
}
|
|
4824
4870
|
}) : driverStatus === "dispatched" || driverStatus === "driverStartService" || driverStatus === "book-driverStartService" ? h(SectionDriverStartService, {
|
|
4825
4871
|
"attrs": {
|
|
4826
|
-
"from":
|
|
4872
|
+
"from": from,
|
|
4827
4873
|
"carPosition": carPosition,
|
|
4828
4874
|
"passengerPosition": passengerPosition,
|
|
4829
4875
|
"renderTitle": renderStartSerivceTitle,
|
|
@@ -4831,7 +4877,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4831
4877
|
}
|
|
4832
4878
|
}) : driverStatus === "book-dispatched" ? h(SectionBookDispatched, {
|
|
4833
4879
|
"attrs": {
|
|
4834
|
-
"from":
|
|
4880
|
+
"from": from,
|
|
4835
4881
|
"to": to,
|
|
4836
4882
|
"passengerPosition": passengerPosition,
|
|
4837
4883
|
"registerOverlay": registerOverlay
|
|
@@ -4845,7 +4891,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4845
4891
|
}
|
|
4846
4892
|
}) : driverStatus === "driverArrived" ? h(SectionDriverArrived, {
|
|
4847
4893
|
"attrs": {
|
|
4848
|
-
"from":
|
|
4894
|
+
"from": from,
|
|
4849
4895
|
"carPosition": carPosition,
|
|
4850
4896
|
"passengerPosition": passengerPosition,
|
|
4851
4897
|
"title": driverArrivedTitle,
|
|
@@ -4853,13 +4899,13 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4853
4899
|
}
|
|
4854
4900
|
}) : driverStatus === "canceled" || driverStatus === "canceling" ? h(SectionCanceled, {
|
|
4855
4901
|
"attrs": {
|
|
4856
|
-
"from":
|
|
4902
|
+
"from": from,
|
|
4857
4903
|
"to": to,
|
|
4858
4904
|
"registerOverlay": registerOverlay
|
|
4859
4905
|
}
|
|
4860
4906
|
}) : driverStatus === "endService" || driverStatus === "completed" || driverStatus === "banlanceRefund" || driverStatus === "waitBanlanceRefund" || driverStatus === "rechargePayed" || driverStatus === "waitRechargePay" || driverStatus === "payed" || driverStatus === "waitpay" || driverStatus === "refund" ? h(SectionEndService, {
|
|
4861
4907
|
"attrs": {
|
|
4862
|
-
"from":
|
|
4908
|
+
"from": from,
|
|
4863
4909
|
"to": to,
|
|
4864
4910
|
"registerOverlay": registerOverlay
|
|
4865
4911
|
}
|
|
@@ -4867,7 +4913,7 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
4867
4913
|
// 匹配不到就显示灰色路线
|
|
4868
4914
|
h(SectionEndService, {
|
|
4869
4915
|
"attrs": {
|
|
4870
|
-
"from":
|
|
4916
|
+
"from": from,
|
|
4871
4917
|
"to": to,
|
|
4872
4918
|
"registerOverlay": registerOverlay
|
|
4873
4919
|
}
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @note navigator.geolocation.watchPosition 期间,再调用 watchPosition 或 getCurrentPosition 会导致定位失败。
|
|
3
|
+
*/
|
|
4
|
+
export declare class SingleGeoWatch {
|
|
5
|
+
id: number;
|
|
6
|
+
listeners: Map<number, [PositionCallback, PositionErrorCallback | undefined]>;
|
|
7
|
+
option: PositionOptions;
|
|
8
|
+
singleWatchId: number | undefined;
|
|
9
|
+
constructor(option?: PositionOptions);
|
|
10
|
+
watchPosition(onSuccess: PositionCallback, onError?: PositionErrorCallback): number;
|
|
11
|
+
clearWatch(id: number): void;
|
|
12
|
+
start(): Promise<void>;
|
|
13
|
+
}
|
package/package.json
CHANGED
package/todo.md
CHANGED
|
@@ -9,20 +9,8 @@ https://dawchihliou.github.io/articles/building-custom-google-maps-marker-react-
|
|
|
9
9
|
- 5033 是否可以关闭
|
|
10
10
|
- 5177 不太明白
|
|
11
11
|
|
|
12
|
-
孙明
|
|
13
|
-
|
|
14
|
-
- 4991
|
|
15
|
-
- 5236 地图高度问题
|
|
16
|
-
- 5237
|
|
17
|
-
- 5240
|
|
18
|
-
|
|
19
|
-
谭红亚
|
|
20
|
-
|
|
21
|
-
- 4772
|
|
22
|
-
|
|
23
12
|
测试环境看下
|
|
24
13
|
|
|
25
|
-
- 4903
|
|
26
14
|
- 4914
|
|
27
15
|
- 4976
|
|
28
16
|
- 5002
|
|
@@ -31,7 +19,6 @@ https://dawchihliou.github.io/articles/building-custom-google-maps-marker-react-
|
|
|
31
19
|
- 5017
|
|
32
20
|
- 5036
|
|
33
21
|
- 5092
|
|
34
|
-
- 5223
|
|
35
22
|
- 5225
|
|
36
23
|
- 5229 优先看
|
|
37
24
|
- 5238
|
|
@@ -80,3 +67,10 @@ setView 类 bug
|
|
|
80
67
|
0.4.8
|
|
81
68
|
|
|
82
69
|
- 5014
|
|
70
|
+
|
|
71
|
+
0.4.9
|
|
72
|
+
|
|
73
|
+
- 4903
|
|
74
|
+
- 5006
|
|
75
|
+
- 5017
|
|
76
|
+
- 5238
|