@heycar/heycars-map 0.7.3 → 0.7.4-zone2
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/README.md +306 -60
- package/dist/api/contants.d.ts +3 -0
- package/dist/business-components/GreenZone/GreenZone.d.ts +8 -0
- package/dist/business-components/GreenZone/index.d.ts +1 -0
- package/dist/hooks/useHeycarMap.d.ts +2 -2
- package/dist/hooks/useMapLngLatToVw.d.ts +14 -5
- package/dist/hooks/useMapRecomendPlace.d.ts +18 -9
- package/dist/hooks-business/useBusinessAlarm.d.ts +12 -0
- package/dist/hooks-business/useBusinessRecomendPlaceMap.d.ts +7 -1
- package/dist/index.cjs +461 -158
- package/dist/index.d.ts +1 -0
- package/dist/index.js +461 -158
- package/dist/types/interface.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1935,6 +1935,15 @@ const useMapLoader = (props) => {
|
|
|
1935
1935
|
onChange
|
|
1936
1936
|
});
|
|
1937
1937
|
};
|
|
1938
|
+
var BRWOSER_PLATFORM = /* @__PURE__ */ ((BRWOSER_PLATFORM2) => {
|
|
1939
|
+
BRWOSER_PLATFORM2["WECHAT"] = "WECHAT";
|
|
1940
|
+
BRWOSER_PLATFORM2["WECHAT_MINIPROGRAM"] = "WECHAT_MINIPROGRAM";
|
|
1941
|
+
BRWOSER_PLATFORM2["ALIPAY"] = "ALIPAY";
|
|
1942
|
+
BRWOSER_PLATFORM2["ALIPAY_MINIPROGRAM"] = "ALIPAY_MINIPROGRAM";
|
|
1943
|
+
BRWOSER_PLATFORM2["H5"] = "H5";
|
|
1944
|
+
BRWOSER_PLATFORM2["NODE_JS"] = "NODE_JS";
|
|
1945
|
+
return BRWOSER_PLATFORM2;
|
|
1946
|
+
})(BRWOSER_PLATFORM || {});
|
|
1938
1947
|
var OS_PLATFORM = /* @__PURE__ */ ((OS_PLATFORM2) => {
|
|
1939
1948
|
OS_PLATFORM2["IOS"] = "IOS";
|
|
1940
1949
|
OS_PLATFORM2["ANDROID"] = "ANDROID";
|
|
@@ -1947,6 +1956,18 @@ var WEBGL_STATUS = /* @__PURE__ */ ((WEBGL_STATUS2) => {
|
|
|
1947
1956
|
WEBGL_STATUS2["ENABLED"] = "ENABLED";
|
|
1948
1957
|
return WEBGL_STATUS2;
|
|
1949
1958
|
})(WEBGL_STATUS || {});
|
|
1959
|
+
const detectBrowserPlatform = () => {
|
|
1960
|
+
if (typeof navigator === "undefined")
|
|
1961
|
+
return "NODE_JS";
|
|
1962
|
+
const useragent = navigator.userAgent.toLowerCase();
|
|
1963
|
+
if (useragent.includes("micromessenger")) {
|
|
1964
|
+
return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : "WECHAT";
|
|
1965
|
+
}
|
|
1966
|
+
if (useragent.includes("alipay")) {
|
|
1967
|
+
return useragent.includes("miniprogram") ? "ALIPAY_MINIPROGRAM" : "ALIPAY";
|
|
1968
|
+
}
|
|
1969
|
+
return "H5";
|
|
1970
|
+
};
|
|
1950
1971
|
const detectOSPlatform = () => {
|
|
1951
1972
|
if (typeof navigator === "undefined")
|
|
1952
1973
|
return "OTHER";
|
|
@@ -1981,6 +2002,56 @@ function detectWebGL() {
|
|
|
1981
2002
|
}
|
|
1982
2003
|
return "NOT_SUPPORTED";
|
|
1983
2004
|
}
|
|
2005
|
+
const MAX_ANIMATION_DISTANCE_VW = 100;
|
|
2006
|
+
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
2007
|
+
const ZINDEX_BUBBLE_LAYER = 50;
|
|
2008
|
+
const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
2009
|
+
const ZINDEX_PLACE_LAYER = 30;
|
|
2010
|
+
const ZINDEX_CAR_LAYER = 21;
|
|
2011
|
+
const ZINDEX_PASSENGER_LAYER = 20;
|
|
2012
|
+
const ZINDEX_LINE_LAYER = 12;
|
|
2013
|
+
const ZINDEX_GREEN_ZONE = 10;
|
|
2014
|
+
const useAmapLngLatToVw = (props) => {
|
|
2015
|
+
const apiMapLngLatToVw = (point) => {
|
|
2016
|
+
const amap2 = props.mapRef.value;
|
|
2017
|
+
const sw = innerWidth;
|
|
2018
|
+
const [x, y] = amap2 == null ? void 0 : amap2.lngLatToContainer(point).toArray();
|
|
2019
|
+
return [100 * x / sw, 100 * y / sw];
|
|
2020
|
+
};
|
|
2021
|
+
const apiMapDistanceVwOfPoints = (point1, point2) => {
|
|
2022
|
+
const [x1, y1] = apiMapLngLatToVw(point1);
|
|
2023
|
+
const [x2, y2] = apiMapLngLatToVw(point2);
|
|
2024
|
+
const result = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
|
|
2025
|
+
console.log("distance = ", result);
|
|
2026
|
+
return result;
|
|
2027
|
+
};
|
|
2028
|
+
return { apiMapLngLatToVw, apiMapDistanceVwOfPoints };
|
|
2029
|
+
};
|
|
2030
|
+
const useGmapLngLatToVw = (props) => {
|
|
2031
|
+
const apiMapLngLatToVw = (point) => {
|
|
2032
|
+
var _a, _b, _c;
|
|
2033
|
+
const [lng, lat] = point;
|
|
2034
|
+
const gmap2 = props.mapRef.value;
|
|
2035
|
+
const sw = window.innerWidth;
|
|
2036
|
+
const projection = gmap2 == null ? void 0 : gmap2.getProjection();
|
|
2037
|
+
const worldCoordinate = projection == null ? void 0 : projection.fromLatLngToPoint({ lng, lat });
|
|
2038
|
+
const x = (_a = worldCoordinate == null ? void 0 : worldCoordinate.x) != null ? _a : 0;
|
|
2039
|
+
const y = (_b = worldCoordinate == null ? void 0 : worldCoordinate.y) != null ? _b : 0;
|
|
2040
|
+
const zoom = (_c = gmap2 == null ? void 0 : gmap2.getZoom()) != null ? _c : 0;
|
|
2041
|
+
const scale = 2 ** zoom;
|
|
2042
|
+
return [100 * x * scale / sw, 100 * y * scale / sw];
|
|
2043
|
+
};
|
|
2044
|
+
const apiMapDistanceVwOfPoints = (point1, point2) => {
|
|
2045
|
+
const [x1, y1] = apiMapLngLatToVw(point1);
|
|
2046
|
+
const [x2, y2] = apiMapLngLatToVw(point2);
|
|
2047
|
+
return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
|
|
2048
|
+
};
|
|
2049
|
+
return { apiMapLngLatToVw, apiMapDistanceVwOfPoints };
|
|
2050
|
+
};
|
|
2051
|
+
const useMapLngLatToVw = (props) => {
|
|
2052
|
+
const { supplier } = useMapSupplier();
|
|
2053
|
+
return supplier === "gmap" ? useGmapLngLatToVw(props) : useAmapLngLatToVw(props);
|
|
2054
|
+
};
|
|
1984
2055
|
const ZOOM_WHEEL_RATIO = -135e-5;
|
|
1985
2056
|
const useAmapWheelZoomCenter = (props) => {
|
|
1986
2057
|
const { mapRef, enableRef } = props;
|
|
@@ -1989,7 +2060,7 @@ const useAmapWheelZoomCenter = (props) => {
|
|
|
1989
2060
|
const { deltaY } = e;
|
|
1990
2061
|
const prevZoom = (_b = (_a = mapRef.value) == null ? void 0 : _a.getZoom()) != null ? _b : 0;
|
|
1991
2062
|
const zoom = prevZoom + ZOOM_WHEEL_RATIO * deltaY;
|
|
1992
|
-
(_c = mapRef.value) == null ? void 0 : _c.setZoom(zoom);
|
|
2063
|
+
(_c = mapRef.value) == null ? void 0 : _c.setZoom(zoom, true);
|
|
1993
2064
|
};
|
|
1994
2065
|
watch(
|
|
1995
2066
|
() => enableRef == null ? void 0 : enableRef.value,
|
|
@@ -2049,6 +2120,7 @@ const Amap = defineSetup(function Amap2(props, { slots, emit }) {
|
|
|
2049
2120
|
const elementRef = shallowRef();
|
|
2050
2121
|
const mapRef = shallowRef();
|
|
2051
2122
|
provideAmap(mapRef);
|
|
2123
|
+
const { apiMapDistanceVwOfPoints } = useMapLngLatToVw({ mapRef });
|
|
2052
2124
|
useAmapWheelZoomCenter({ mapRef, enableRef: computed(() => !!props.touchZoomCenter) });
|
|
2053
2125
|
watchPostEffect(() => {
|
|
2054
2126
|
if (mapRef.value || !elementRef.value)
|
|
@@ -2069,10 +2141,28 @@ const Amap = defineSetup(function Amap2(props, { slots, emit }) {
|
|
|
2069
2141
|
(_a = mapRef.value) == null ? void 0 : _a.setStatus(statusOptions2);
|
|
2070
2142
|
}
|
|
2071
2143
|
);
|
|
2144
|
+
watchNoneImmediatePostEffectForDeepOption(
|
|
2145
|
+
() => props.center,
|
|
2146
|
+
(center, prevCenter) => {
|
|
2147
|
+
const map = mapRef.value;
|
|
2148
|
+
if (!center || !map)
|
|
2149
|
+
return;
|
|
2150
|
+
const immediately = prevCenter ? apiMapDistanceVwOfPoints(center, prevCenter) > MAX_ANIMATION_DISTANCE_VW : true;
|
|
2151
|
+
map.setCenter(center, immediately);
|
|
2152
|
+
}
|
|
2153
|
+
);
|
|
2154
|
+
watch(
|
|
2155
|
+
() => props.zoom,
|
|
2156
|
+
(zoom) => {
|
|
2157
|
+
const map = mapRef.value;
|
|
2158
|
+
if (!zoom || !map)
|
|
2159
|
+
return;
|
|
2160
|
+
map.setZoom(zoom, true);
|
|
2161
|
+
},
|
|
2162
|
+
{ immediate: false, flush: "post" }
|
|
2163
|
+
);
|
|
2072
2164
|
watchNoneImmediatePostEffectForMapProperty(mapRef, props, [
|
|
2073
|
-
{ name: "center", defaultValue: [0, 0] },
|
|
2074
2165
|
{ name: "zooms", defaultValue: [2, 20] },
|
|
2075
|
-
{ name: "zoom", defaultValue: 0 },
|
|
2076
2166
|
{ name: "layers", defaultValue: [] },
|
|
2077
2167
|
{ name: "limitBounds", defaultValue: [] },
|
|
2078
2168
|
{ name: "rotation", defaultValue: 0 },
|
|
@@ -2485,7 +2575,8 @@ const ADrivingLine = defineSetup(function ADrivingLine2(props) {
|
|
|
2485
2575
|
"strokeOpacity": 1,
|
|
2486
2576
|
"strokeColor": strokeColorOuter,
|
|
2487
2577
|
"lineJoin": "round",
|
|
2488
|
-
"lineCap": "round"
|
|
2578
|
+
"lineCap": "round",
|
|
2579
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2489
2580
|
}
|
|
2490
2581
|
}), h(AmapPolyline, {
|
|
2491
2582
|
"attrs": {
|
|
@@ -2496,7 +2587,8 @@ const ADrivingLine = defineSetup(function ADrivingLine2(props) {
|
|
|
2496
2587
|
"lineJoin": "round",
|
|
2497
2588
|
"lineCap": "round",
|
|
2498
2589
|
"strokeStyle": "dashed",
|
|
2499
|
-
"strokeDasharray": [dashLength, dashLength * 0.5]
|
|
2590
|
+
"strokeDasharray": [dashLength, dashLength * 0.5],
|
|
2591
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2500
2592
|
}
|
|
2501
2593
|
}), h(AmapPolyline, {
|
|
2502
2594
|
"attrs": {
|
|
@@ -2505,7 +2597,8 @@ const ADrivingLine = defineSetup(function ADrivingLine2(props) {
|
|
|
2505
2597
|
"strokeOpacity": 1,
|
|
2506
2598
|
"strokeColor": strokeColorInner,
|
|
2507
2599
|
"lineJoin": "round",
|
|
2508
|
-
"lineCap": "round"
|
|
2600
|
+
"lineCap": "round",
|
|
2601
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2509
2602
|
}
|
|
2510
2603
|
}), h(AmapPolyline, {
|
|
2511
2604
|
"attrs": {
|
|
@@ -2515,7 +2608,8 @@ const ADrivingLine = defineSetup(function ADrivingLine2(props) {
|
|
|
2515
2608
|
"strokeOpacity": 1,
|
|
2516
2609
|
"strokeColor": "transparent",
|
|
2517
2610
|
"lineJoin": "round",
|
|
2518
|
-
"lineCap": "round"
|
|
2611
|
+
"lineCap": "round",
|
|
2612
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2519
2613
|
}
|
|
2520
2614
|
})]);
|
|
2521
2615
|
};
|
|
@@ -2537,7 +2631,8 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2537
2631
|
"path": pathRef.value,
|
|
2538
2632
|
"strokeWeight": strokeWidth + 2 * borderWidth + 2 * outlineWidth,
|
|
2539
2633
|
"strokeOpacity": 1,
|
|
2540
|
-
"strokeColor": strokeColorOuter
|
|
2634
|
+
"strokeColor": strokeColorOuter,
|
|
2635
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2541
2636
|
}
|
|
2542
2637
|
}), h(GmapPolyline, {
|
|
2543
2638
|
"attrs": {
|
|
@@ -2552,7 +2647,8 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2552
2647
|
},
|
|
2553
2648
|
repeat: `${strokeWidth}px`,
|
|
2554
2649
|
offset: `${strokeWidth / 2}px`
|
|
2555
|
-
}]
|
|
2650
|
+
}],
|
|
2651
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2556
2652
|
}
|
|
2557
2653
|
}), h(GmapPolyline, {
|
|
2558
2654
|
"attrs": {
|
|
@@ -2568,7 +2664,8 @@ const GDrivingLine = defineSetup(function GDrivingLine2(props) {
|
|
|
2568
2664
|
scale: 0.7
|
|
2569
2665
|
},
|
|
2570
2666
|
repeat: `${repeat}px`
|
|
2571
|
-
}]
|
|
2667
|
+
}],
|
|
2668
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
2572
2669
|
}
|
|
2573
2670
|
})]);
|
|
2574
2671
|
};
|
|
@@ -3005,12 +3102,6 @@ const KeyedFitView = defineSetup(function KeyedFitView2(props, {
|
|
|
3005
3102
|
return h("div", [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
3006
3103
|
};
|
|
3007
3104
|
});
|
|
3008
|
-
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
3009
|
-
const ZINDEX_BUBBLE_LAYER = 50;
|
|
3010
|
-
const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
3011
|
-
const ZINDEX_PLACE_LAYER = 30;
|
|
3012
|
-
const ZINDEX_CAR_LAYER = 21;
|
|
3013
|
-
const ZINDEX_PASSENGER_LAYER = 20;
|
|
3014
3105
|
const imgEndPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHg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JhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
|
|
3016
3107
|
const StartEndPoint_css_ts_vanilla = "";
|
|
@@ -3027,12 +3118,12 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props) {
|
|
|
3027
3118
|
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
3028
3119
|
const descriptionRow = !props.description ? "" : decodeAsterisk(props.description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
3029
3120
|
if (!props.description && !props.title)
|
|
3030
|
-
return `<img
|
|
3121
|
+
return `<img class="AStartEndPoint ${pointIcon({
|
|
3031
3122
|
type: props.type
|
|
3032
|
-
})}">`;
|
|
3123
|
+
})}" src="${icon}">`;
|
|
3033
3124
|
if (!props.description)
|
|
3034
3125
|
return `
|
|
3035
|
-
<div class="${pointLayout$1}">
|
|
3126
|
+
<div class="AStartEndPoint ${pointLayout$1}">
|
|
3036
3127
|
<div class="${pointSingleInfoBox$1}">
|
|
3037
3128
|
<div class="${pointInfoBoxTitle}">${props.title}</div>
|
|
3038
3129
|
</div>
|
|
@@ -3042,7 +3133,7 @@ const AStartEndPoint = defineSetup(function AStartEndPoint2(props) {
|
|
|
3042
3133
|
</div>
|
|
3043
3134
|
`;
|
|
3044
3135
|
return `
|
|
3045
|
-
<div class="${pointLayout$1}">
|
|
3136
|
+
<div class="AStartEndPoint ${pointLayout$1}">
|
|
3046
3137
|
<div class="${pointInfoBox}">
|
|
3047
3138
|
<div class="${pointInfoBoxTitle}">${(_a = props.title) != null ? _a : ""}</div>
|
|
3048
3139
|
<div class="${pointInfoBoxDescription}">${descriptionRow}</div>
|
|
@@ -3070,14 +3161,14 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props) {
|
|
|
3070
3161
|
const descriptionRow = !props.description ? "" : decodeAsterisk(props.description).map((item) => item.type === "normal" ? item.value : `<span class="${pointInfoBoxEmphasize$1}">${item.value}</span>`).join("");
|
|
3071
3162
|
if (!props.description && !props.title)
|
|
3072
3163
|
return createDom("img", {
|
|
3073
|
-
class: pointIcon({
|
|
3164
|
+
class: `GStartEndPoint ${pointIcon({
|
|
3074
3165
|
type: props.type
|
|
3075
|
-
})
|
|
3166
|
+
})}`,
|
|
3076
3167
|
src: icon
|
|
3077
3168
|
});
|
|
3078
3169
|
if (!props.description)
|
|
3079
3170
|
return createDom("div", {
|
|
3080
|
-
class: pointLayout$1
|
|
3171
|
+
class: `GStartEndPoint ${pointLayout$1}`
|
|
3081
3172
|
}, `
|
|
3082
3173
|
<div class="${pointSingleInfoBox$1}">
|
|
3083
3174
|
<div class="${pointInfoBoxTitle}">${props.title}</div>
|
|
@@ -3087,7 +3178,7 @@ const GStartEndPoint = defineSetup(function GStartEndPoint2(props) {
|
|
|
3087
3178
|
})}">
|
|
3088
3179
|
`);
|
|
3089
3180
|
return createDom("div", {
|
|
3090
|
-
class: pointLayout$1
|
|
3181
|
+
class: `GStartEndPoint ${pointLayout$1}`
|
|
3091
3182
|
}, `
|
|
3092
3183
|
<div class="${pointInfoBox}">
|
|
3093
3184
|
<div class="${pointInfoBoxTitle}">${(_a = props.title) != null ? _a : ""}</div>
|
|
@@ -3260,6 +3351,20 @@ const watchVisibilityState = () => {
|
|
|
3260
3351
|
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
3261
3352
|
return { visibilityStateRef, unwatchVisibilityState };
|
|
3262
3353
|
};
|
|
3354
|
+
const isPlace = (place) => {
|
|
3355
|
+
return place.lng !== void 0 && place.lat !== void 0;
|
|
3356
|
+
};
|
|
3357
|
+
const sleep = (milliSeconds) => new Promise((resolve) => setTimeout(resolve, milliSeconds));
|
|
3358
|
+
const assertPoint = (point) => {
|
|
3359
|
+
if (Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number")
|
|
3360
|
+
return;
|
|
3361
|
+
throw new Error(`Assertion Error: expect type [number, number], actual is ${point}`);
|
|
3362
|
+
};
|
|
3363
|
+
const assertAngle = (angle) => {
|
|
3364
|
+
if (typeof angle === "number" || typeof angle === "undefined")
|
|
3365
|
+
return;
|
|
3366
|
+
throw new Error(`Assertion Error: expect type number | undefined, actual is ${angle}`);
|
|
3367
|
+
};
|
|
3263
3368
|
const WX_GET_LOCATION_INTERVAL_STILL = 10 * 1e3;
|
|
3264
3369
|
const WX_GET_LOCATION_INTERVAL_SLOW = 3 * 1e3;
|
|
3265
3370
|
const WX_GET_LOCATION_INTERVAL_FAST = 1 * 1e3;
|
|
@@ -3267,7 +3372,6 @@ const takeIsForceBrowserGeo = () => {
|
|
|
3267
3372
|
const searchParam = new URLSearchParams(location.search);
|
|
3268
3373
|
return searchParam.has(`force-browser-geo`);
|
|
3269
3374
|
};
|
|
3270
|
-
const sleep$1 = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
3271
3375
|
const wxReady = () => new Promise((resolve, reject) => {
|
|
3272
3376
|
wx.ready(resolve);
|
|
3273
3377
|
wx.error(reject);
|
|
@@ -3291,7 +3395,7 @@ function wechatWatchPosition(onSuccess, onError, option) {
|
|
|
3291
3395
|
await wxReady();
|
|
3292
3396
|
do {
|
|
3293
3397
|
if (visibilityStateRef.value === "hidden") {
|
|
3294
|
-
await sleep
|
|
3398
|
+
await sleep(WX_GET_LOCATION_INTERVAL_FAST);
|
|
3295
3399
|
continue;
|
|
3296
3400
|
}
|
|
3297
3401
|
const geoPosition = await new Promise((resolve) => {
|
|
@@ -3332,7 +3436,7 @@ function wechatWatchPosition(onSuccess, onError, option) {
|
|
|
3332
3436
|
if (geoPosition && !isGeoPositionEqual(geoPosition, prevGeoPosition))
|
|
3333
3437
|
onSuccess(geoPosition);
|
|
3334
3438
|
prevGeoPosition = geoPosition;
|
|
3335
|
-
await sleep
|
|
3439
|
+
await sleep(interval);
|
|
3336
3440
|
} while (enable);
|
|
3337
3441
|
};
|
|
3338
3442
|
startWatch();
|
|
@@ -3356,20 +3460,6 @@ function compatibleWathPosition(onSuccess, onError, option) {
|
|
|
3356
3460
|
}
|
|
3357
3461
|
}
|
|
3358
3462
|
}
|
|
3359
|
-
const isPlace = (place) => {
|
|
3360
|
-
return place.lng !== void 0 && place.lat !== void 0;
|
|
3361
|
-
};
|
|
3362
|
-
const sleep = (milliSeconds) => new Promise((resolve) => setTimeout(resolve, milliSeconds));
|
|
3363
|
-
const assertPoint = (point) => {
|
|
3364
|
-
if (Array.isArray(point) && point.length === 2 && typeof point[0] === "number" && typeof point[1] === "number")
|
|
3365
|
-
return;
|
|
3366
|
-
throw new Error(`Assertion Error: expect type [number, number], actual is ${point}`);
|
|
3367
|
-
};
|
|
3368
|
-
const assertAngle = (angle) => {
|
|
3369
|
-
if (typeof angle === "number" || typeof angle === "undefined")
|
|
3370
|
-
return;
|
|
3371
|
-
throw new Error(`Assertion Error: expect type number | undefined, actual is ${angle}`);
|
|
3372
|
-
};
|
|
3373
3463
|
class SingleGeoWatch {
|
|
3374
3464
|
constructor(option) {
|
|
3375
3465
|
__publicField(this, "id", 0);
|
|
@@ -3448,6 +3538,9 @@ const useGeoLocation = (props) => {
|
|
|
3448
3538
|
var _a, _b;
|
|
3449
3539
|
const { onChange, onLoad, onLoadDefault, onError, geoDefaultPosition } = props != null ? props : {};
|
|
3450
3540
|
const { toGcj02 } = useMapGCJ02();
|
|
3541
|
+
const isIOSAlipay = [BRWOSER_PLATFORM.ALIPAY, BRWOSER_PLATFORM.ALIPAY_MINIPROGRAM].includes(
|
|
3542
|
+
detectBrowserPlatform()
|
|
3543
|
+
) && detectOSPlatform() === OS_PLATFORM.IOS;
|
|
3451
3544
|
let isOnLoadTriggered = false;
|
|
3452
3545
|
const loading = ref(false);
|
|
3453
3546
|
const readyRef = ref(false);
|
|
@@ -3473,7 +3566,7 @@ const useGeoLocation = (props) => {
|
|
|
3473
3566
|
spaceLog("watchPosition", "success duration, position = ", duration, position);
|
|
3474
3567
|
const coordinate = position.coords;
|
|
3475
3568
|
const wgsPoint = [position.coords.longitude, position.coords.latitude];
|
|
3476
|
-
const point = await toGcj02(wgsPoint);
|
|
3569
|
+
const point = isIOSAlipay ? wgsPoint : await toGcj02(wgsPoint);
|
|
3477
3570
|
coordinateRef.value = coordinate;
|
|
3478
3571
|
positionRef.value = point;
|
|
3479
3572
|
errorRef.value = void 0;
|
|
@@ -3509,16 +3602,33 @@ const useGeoLocation = (props) => {
|
|
|
3509
3602
|
geoReady: readyRef
|
|
3510
3603
|
};
|
|
3511
3604
|
};
|
|
3605
|
+
const MAX_AMAP_PAN_TO_ANIMATE_DURATION = 500;
|
|
3606
|
+
const MIN_AMAP_PAN_TO_ANIMATE_DURATION = 100;
|
|
3512
3607
|
const useHeycarAmap = () => {
|
|
3513
3608
|
const amapRef = shallowRef();
|
|
3514
3609
|
const amapElementRef = shallowRef();
|
|
3610
|
+
const { apiMapDistanceVwOfPoints } = useMapLngLatToVw({ mapRef: amapRef });
|
|
3515
3611
|
const setMap = (map) => {
|
|
3516
3612
|
amapRef.value = map;
|
|
3517
3613
|
amapElementRef.value = map.getContainer();
|
|
3518
3614
|
};
|
|
3519
|
-
const panTo = (value) => {
|
|
3520
|
-
|
|
3521
|
-
|
|
3615
|
+
const panTo = async (value) => {
|
|
3616
|
+
const amap2 = amapRef.value;
|
|
3617
|
+
if (!amap2)
|
|
3618
|
+
return;
|
|
3619
|
+
const { lng, lat } = amap2.getCenter();
|
|
3620
|
+
const distanceVw = apiMapDistanceVwOfPoints(value, [lng, lat]);
|
|
3621
|
+
const shouldAnimate = distanceVw < MAX_ANIMATION_DISTANCE_VW;
|
|
3622
|
+
if (shouldAnimate) {
|
|
3623
|
+
const duration = Math.max(
|
|
3624
|
+
MIN_AMAP_PAN_TO_ANIMATE_DURATION,
|
|
3625
|
+
Math.floor(MAX_AMAP_PAN_TO_ANIMATE_DURATION * distanceVw / MAX_ANIMATION_DISTANCE_VW)
|
|
3626
|
+
);
|
|
3627
|
+
amap2.panTo(value, duration);
|
|
3628
|
+
await sleep(duration);
|
|
3629
|
+
} else {
|
|
3630
|
+
amap2.setCenter(value, true);
|
|
3631
|
+
}
|
|
3522
3632
|
};
|
|
3523
3633
|
return { mapRef: amapRef, mapElementRef: amapElementRef, panTo, setMap };
|
|
3524
3634
|
};
|
|
@@ -5268,7 +5378,8 @@ const useAmapRecomendPlace = (props) => {
|
|
|
5268
5378
|
const { pointRef, getRecomendPlace, getLimit, context: context2, emptyPlaceName, onChange, onChangePlace } = props;
|
|
5269
5379
|
const availableRef = ref(true);
|
|
5270
5380
|
const placeCandidatesRef = ref([]);
|
|
5271
|
-
const
|
|
5381
|
+
const zoneRef = ref();
|
|
5382
|
+
const { idx: recomendPlaceKey, update: updateRecommendPlaceKey } = useUpdate();
|
|
5272
5383
|
const { readyPromise } = useMapSupplier();
|
|
5273
5384
|
const { place, updatePlace, setPlace } = useAmapPlace({
|
|
5274
5385
|
emptyPlaceName,
|
|
@@ -5283,49 +5394,76 @@ const useAmapRecomendPlace = (props) => {
|
|
|
5283
5394
|
);
|
|
5284
5395
|
});
|
|
5285
5396
|
const updatePlaceCandidates = async (place2) => {
|
|
5286
|
-
|
|
5397
|
+
var _a;
|
|
5398
|
+
const {
|
|
5399
|
+
places: inputPlaceCandidates,
|
|
5400
|
+
zone,
|
|
5401
|
+
available
|
|
5402
|
+
} = (_a = await getRecomendPlace({ ...place2 }, context2)) != null ? _a : {};
|
|
5403
|
+
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5404
|
+
availableRef.value = !!available;
|
|
5405
|
+
zoneRef.value = zone;
|
|
5406
|
+
placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
|
|
5407
|
+
};
|
|
5408
|
+
const updateRecommendPlace = (place2) => {
|
|
5409
|
+
setPlace(place2);
|
|
5410
|
+
updateRecommendPlaceKey();
|
|
5411
|
+
};
|
|
5412
|
+
const setPlaceCandidatesAndZone = ({
|
|
5413
|
+
zone,
|
|
5414
|
+
places: inputPlaceCandidates
|
|
5415
|
+
}) => {
|
|
5287
5416
|
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5288
|
-
|
|
5417
|
+
zoneRef.value = zone ? zone : void 0;
|
|
5289
5418
|
placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
|
|
5290
5419
|
};
|
|
5291
5420
|
watch(
|
|
5292
5421
|
() => recomendPlaceKey.value,
|
|
5293
5422
|
async () => {
|
|
5423
|
+
var _a;
|
|
5294
5424
|
await readyPromise;
|
|
5295
|
-
const
|
|
5425
|
+
const {
|
|
5426
|
+
places: inputPlaceCandidates,
|
|
5427
|
+
zone,
|
|
5428
|
+
available
|
|
5429
|
+
} = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
|
|
5296
5430
|
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5297
|
-
if (
|
|
5298
|
-
availableRef.value =
|
|
5431
|
+
if (!available || !placeCandidates) {
|
|
5432
|
+
availableRef.value = !!available;
|
|
5433
|
+
zoneRef.value = zone;
|
|
5299
5434
|
placeCandidatesRef.value = [];
|
|
5300
5435
|
Object.assign(recomendPlace, { ...place });
|
|
5301
|
-
onChange == null ? void 0 : onChange({ ...place });
|
|
5436
|
+
onChange == null ? void 0 : onChange({ place: { ...place }, inputPlace: { ...place }, isInZone: !!zone });
|
|
5302
5437
|
return;
|
|
5303
5438
|
}
|
|
5304
5439
|
const { shortestPlace, shortestDistance } = findAmapNearestPlace(place, placeCandidates);
|
|
5305
5440
|
const limit = getLimit(context2);
|
|
5306
|
-
const resultPlace = shortestDistance
|
|
5307
|
-
availableRef.value =
|
|
5441
|
+
const resultPlace = zone || shortestDistance <= limit ? shortestPlace : place;
|
|
5442
|
+
availableRef.value = !!available;
|
|
5443
|
+
zoneRef.value = zone;
|
|
5308
5444
|
placeCandidatesRef.value = placeCandidates;
|
|
5309
5445
|
Object.assign(recomendPlace, { ...resultPlace });
|
|
5310
|
-
onChange == null ? void 0 : onChange({ ...resultPlace });
|
|
5446
|
+
onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace: { ...place }, isInZone: !!zone });
|
|
5311
5447
|
}
|
|
5312
5448
|
);
|
|
5313
5449
|
return {
|
|
5450
|
+
zoneRef,
|
|
5314
5451
|
recomendPlace,
|
|
5315
5452
|
placeCandidates: placeCandidatesRef,
|
|
5316
5453
|
availableRef,
|
|
5317
5454
|
isElectedRef,
|
|
5318
|
-
|
|
5455
|
+
updateRecommendPlace,
|
|
5319
5456
|
updatePlaceCandidates,
|
|
5320
5457
|
updatePlace,
|
|
5321
|
-
|
|
5458
|
+
setPlaceCandidatesAndZone
|
|
5322
5459
|
};
|
|
5323
5460
|
};
|
|
5324
5461
|
const useGmapRecomendPlace = (props) => {
|
|
5325
5462
|
const { pointRef, getRecomendPlace, getLimit, context: context2, emptyPlaceName, onChange, onChangePlace } = props;
|
|
5326
5463
|
const availableRef = ref(true);
|
|
5327
5464
|
const placeCandidatesRef = ref([]);
|
|
5328
|
-
const
|
|
5465
|
+
const zoneRef = ref();
|
|
5466
|
+
const { idx: recomendPlaceKey, update: updateRecommendPlaceKey } = useUpdate();
|
|
5329
5467
|
const { readyPromise } = useMapSupplier();
|
|
5330
5468
|
const { place, updatePlace, setPlace } = useGmapPlace({
|
|
5331
5469
|
emptyPlaceName,
|
|
@@ -5340,40 +5478,64 @@ const useGmapRecomendPlace = (props) => {
|
|
|
5340
5478
|
);
|
|
5341
5479
|
});
|
|
5342
5480
|
const updatePlaceCandidates = async (place2) => {
|
|
5343
|
-
|
|
5344
|
-
|
|
5481
|
+
var _a;
|
|
5482
|
+
const {
|
|
5483
|
+
places: inputPlaceCandidates,
|
|
5484
|
+
zone,
|
|
5485
|
+
available
|
|
5486
|
+
} = (_a = await getRecomendPlace({ ...place2 }, context2)) != null ? _a : {};
|
|
5487
|
+
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5488
|
+
availableRef.value = !!available;
|
|
5489
|
+
zoneRef.value = zone;
|
|
5345
5490
|
placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
|
|
5346
5491
|
};
|
|
5492
|
+
const updateRecommendPlace = (place2) => {
|
|
5493
|
+
setPlace(place2);
|
|
5494
|
+
updateRecommendPlaceKey();
|
|
5495
|
+
};
|
|
5496
|
+
const setPlaceCandidatesAndZone = ({ zone, places }) => {
|
|
5497
|
+
placeCandidatesRef.value = places != null ? places : [];
|
|
5498
|
+
zoneRef.value = zone ? zone : void 0;
|
|
5499
|
+
};
|
|
5347
5500
|
watch(
|
|
5348
5501
|
() => recomendPlaceKey.value,
|
|
5349
5502
|
async () => {
|
|
5503
|
+
var _a;
|
|
5350
5504
|
await readyPromise;
|
|
5351
|
-
const
|
|
5352
|
-
|
|
5353
|
-
|
|
5505
|
+
const {
|
|
5506
|
+
places: inputPlaceCandidates,
|
|
5507
|
+
zone,
|
|
5508
|
+
available
|
|
5509
|
+
} = (_a = await getRecomendPlace({ ...place }, context2)) != null ? _a : {};
|
|
5510
|
+
const placeCandidates = inputPlaceCandidates == null ? void 0 : inputPlaceCandidates.map(toPlaceType);
|
|
5511
|
+
if (!available || !placeCandidates) {
|
|
5512
|
+
availableRef.value = !!available;
|
|
5513
|
+
zoneRef.value = zone;
|
|
5354
5514
|
placeCandidatesRef.value = [];
|
|
5355
5515
|
Object.assign(recomendPlace, { ...place });
|
|
5356
|
-
onChange == null ? void 0 : onChange({ ...place });
|
|
5516
|
+
onChange == null ? void 0 : onChange({ place: { ...place }, inputPlace: { ...place }, isInZone: !!zone });
|
|
5357
5517
|
return;
|
|
5358
5518
|
}
|
|
5359
5519
|
const { shortestPlace, shortestDistance } = findGmapNearestPlace(place, placeCandidates);
|
|
5360
5520
|
const limit = getLimit(context2);
|
|
5361
5521
|
const resultPlace = shortestDistance > limit ? place : shortestPlace;
|
|
5362
|
-
availableRef.value =
|
|
5522
|
+
availableRef.value = !!available;
|
|
5523
|
+
zoneRef.value = zone;
|
|
5363
5524
|
placeCandidatesRef.value = placeCandidates;
|
|
5364
5525
|
Object.assign(recomendPlace, { ...resultPlace });
|
|
5365
|
-
onChange == null ? void 0 : onChange({ ...resultPlace });
|
|
5526
|
+
onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace: { ...place }, isInZone: !!zone });
|
|
5366
5527
|
}
|
|
5367
5528
|
);
|
|
5368
5529
|
return {
|
|
5530
|
+
zoneRef,
|
|
5369
5531
|
recomendPlace,
|
|
5370
5532
|
placeCandidates: placeCandidatesRef,
|
|
5371
5533
|
availableRef,
|
|
5372
5534
|
isElectedRef,
|
|
5373
|
-
|
|
5535
|
+
updateRecommendPlace,
|
|
5374
5536
|
updatePlaceCandidates,
|
|
5375
5537
|
updatePlace,
|
|
5376
|
-
|
|
5538
|
+
setPlaceCandidatesAndZone
|
|
5377
5539
|
};
|
|
5378
5540
|
};
|
|
5379
5541
|
const useMapRecomendPlace = (props) => {
|
|
@@ -5389,7 +5551,7 @@ const useAmapZoom = (props) => {
|
|
|
5389
5551
|
const setZoom = (v) => {
|
|
5390
5552
|
var _a2;
|
|
5391
5553
|
zoomRef.value = v;
|
|
5392
|
-
(_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v);
|
|
5554
|
+
(_a2 = mapRef.value) == null ? void 0 : _a2.setZoom(v, true);
|
|
5393
5555
|
};
|
|
5394
5556
|
const handleZoomEnd = (_, { target }) => {
|
|
5395
5557
|
const zoom = target.getZoom();
|
|
@@ -5427,6 +5589,131 @@ const useMapZoom = (props) => {
|
|
|
5427
5589
|
const { supplier } = useMapSupplier();
|
|
5428
5590
|
return supplier === "gmap" ? useGmapZoom(props) : useAmapZoom(props);
|
|
5429
5591
|
};
|
|
5592
|
+
const AmapPolygon = defineSetup(function AmapPolygon2(props) {
|
|
5593
|
+
const polygonRef = shallowRef();
|
|
5594
|
+
const mapRef = useAmap();
|
|
5595
|
+
onMounted(() => {
|
|
5596
|
+
polygonRef.value = new AMap.Polygon();
|
|
5597
|
+
polygonRef.value.setOptions(props);
|
|
5598
|
+
});
|
|
5599
|
+
onUnmounted(() => {
|
|
5600
|
+
var _a;
|
|
5601
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setMap(null);
|
|
5602
|
+
});
|
|
5603
|
+
watchPostEffect(() => {
|
|
5604
|
+
var _a;
|
|
5605
|
+
const map = mapRef == null ? void 0 : mapRef.value;
|
|
5606
|
+
if (!map)
|
|
5607
|
+
return;
|
|
5608
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setMap(map);
|
|
5609
|
+
});
|
|
5610
|
+
watchNoneImmediatePostEffectForMapProperty(polygonRef, props, [
|
|
5611
|
+
{ name: "path", defaultValue: [[0, 0]] },
|
|
5612
|
+
{ name: "extData", defaultValue: void 0 },
|
|
5613
|
+
{ name: "draggable", defaultValue: false }
|
|
5614
|
+
]);
|
|
5615
|
+
watchNoneImmediatePostEffectForDeepOption(
|
|
5616
|
+
() => {
|
|
5617
|
+
const { path, extData, draggable, ...otherOptions } = props;
|
|
5618
|
+
return otherOptions;
|
|
5619
|
+
},
|
|
5620
|
+
(otherOptions) => {
|
|
5621
|
+
var _a;
|
|
5622
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setOptions({ ...otherOptions });
|
|
5623
|
+
}
|
|
5624
|
+
);
|
|
5625
|
+
return () => null;
|
|
5626
|
+
});
|
|
5627
|
+
const GmapPolygon = defineSetup(function GmapPolygon2(props) {
|
|
5628
|
+
const polygonRef = shallowRef();
|
|
5629
|
+
const mapRef = useGmap();
|
|
5630
|
+
onMounted(() => {
|
|
5631
|
+
polygonRef.value = new google.maps.Polygon({ ...props });
|
|
5632
|
+
});
|
|
5633
|
+
onUnmounted(() => {
|
|
5634
|
+
var _a;
|
|
5635
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setMap(null);
|
|
5636
|
+
});
|
|
5637
|
+
watchPostEffect(() => {
|
|
5638
|
+
var _a;
|
|
5639
|
+
const map = mapRef == null ? void 0 : mapRef.value;
|
|
5640
|
+
if (!map)
|
|
5641
|
+
return;
|
|
5642
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setMap(map);
|
|
5643
|
+
});
|
|
5644
|
+
watchNoneImmediatePostEffectForDeepOption(
|
|
5645
|
+
() => ({ ...props }),
|
|
5646
|
+
(props2) => {
|
|
5647
|
+
var _a;
|
|
5648
|
+
(_a = polygonRef.value) == null ? void 0 : _a.setOptions({ ...props2 });
|
|
5649
|
+
}
|
|
5650
|
+
);
|
|
5651
|
+
return () => null;
|
|
5652
|
+
});
|
|
5653
|
+
const GREEN_ZONE_FILL_COLOR = "#C7E5FB";
|
|
5654
|
+
const GREEN_ZONE_FILL_OPACITY = 0.5;
|
|
5655
|
+
const GREEN_ZONE_STROKE_COLOR = "#4BA7FF";
|
|
5656
|
+
const GREEN_ZONE_STROKE_WEIGHT_VW = 1;
|
|
5657
|
+
const AGreenZone = defineSetup(function AGreenZone2(props) {
|
|
5658
|
+
const strokeWeight = GREEN_ZONE_STROKE_WEIGHT_VW * globalThis.innerWidth / 100;
|
|
5659
|
+
return () => {
|
|
5660
|
+
return h(AmapPolygon, {
|
|
5661
|
+
"attrs": {
|
|
5662
|
+
"path": props.path,
|
|
5663
|
+
"strokeColor": GREEN_ZONE_STROKE_COLOR,
|
|
5664
|
+
"strokeStyle": "dashed",
|
|
5665
|
+
"strokeWeight": strokeWeight,
|
|
5666
|
+
"fillColor": GREEN_ZONE_FILL_COLOR,
|
|
5667
|
+
"fillOpacity": GREEN_ZONE_FILL_OPACITY,
|
|
5668
|
+
"zIndex": ZINDEX_GREEN_ZONE
|
|
5669
|
+
}
|
|
5670
|
+
});
|
|
5671
|
+
};
|
|
5672
|
+
});
|
|
5673
|
+
const GGreenZone = defineSetup(function GGreenZone2(props) {
|
|
5674
|
+
const pathRef = computed(() => props.path.map(vec2lnglat));
|
|
5675
|
+
const strokeWeight = GREEN_ZONE_STROKE_WEIGHT_VW * globalThis.innerWidth / 100;
|
|
5676
|
+
const lineSymbol = {
|
|
5677
|
+
path: "M 0,-1 0,1",
|
|
5678
|
+
strokeOpacity: 1,
|
|
5679
|
+
scale: 4
|
|
5680
|
+
};
|
|
5681
|
+
return () => {
|
|
5682
|
+
const path = pathRef.value;
|
|
5683
|
+
return h("div", [h(GmapPolygon, {
|
|
5684
|
+
"attrs": {
|
|
5685
|
+
"paths": path,
|
|
5686
|
+
"strokeColor": GREEN_ZONE_STROKE_COLOR,
|
|
5687
|
+
"strokeOpacity": 0,
|
|
5688
|
+
"strokeWeight": strokeWeight,
|
|
5689
|
+
"fillColor": GREEN_ZONE_FILL_COLOR,
|
|
5690
|
+
"fillOpacity": GREEN_ZONE_FILL_OPACITY,
|
|
5691
|
+
"zIndex": ZINDEX_GREEN_ZONE
|
|
5692
|
+
}
|
|
5693
|
+
}), h(GmapPolyline, {
|
|
5694
|
+
"attrs": {
|
|
5695
|
+
"path": path,
|
|
5696
|
+
"strokeColor": GREEN_ZONE_STROKE_COLOR,
|
|
5697
|
+
"strokeWeight": GREEN_ZONE_STROKE_WEIGHT_VW,
|
|
5698
|
+
"icons": [{
|
|
5699
|
+
icon: lineSymbol,
|
|
5700
|
+
offset: "0",
|
|
5701
|
+
repeat: "20px"
|
|
5702
|
+
}]
|
|
5703
|
+
}
|
|
5704
|
+
})]);
|
|
5705
|
+
};
|
|
5706
|
+
});
|
|
5707
|
+
const GreenZone = defineSetup(function GreenZone2(props) {
|
|
5708
|
+
const payload = useMapSupplier();
|
|
5709
|
+
return () => {
|
|
5710
|
+
if (!props.path.length)
|
|
5711
|
+
return null;
|
|
5712
|
+
return createElement(payload.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GEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dCbHVyT3V0ZXIxIiBpbjI9IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0ib3V0IiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiLz48ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMjQgMCIgaW49InNoYWRvd0JsdXJPdXRlcjEiLz48L2ZpbHRlcj48Y2lyY2xlIGlkPSJwcmVmaXhfX2IiIGN4PSIxMC41IiBjeT0iMTkuNSIgcj0iMTAuNSIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGZpbGw9IiM0NDcxRkYiIGQ9Ik0xNC40ODEgMGw2LjYwMyAxMy4xODFINy44Nzl6Ii8+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNCkiPjx1c2UgZmlsbD0iIzAwMCIgZmlsdGVyPSJ1cmwoI3ByZWZpeF9fYSkiIHhsaW5rOmhyZWY9IiNwcmVmaXhfX2IiLz48Y2lyY2xlIHN0cm9rZT0iI0ZGRiIgc3Ryb2tlLXdpZHRoPSIyLjQiIHN0cm9rZS1saW5lam9pbj0ic3F1YXJlIiBmaWxsPSIjNDg3MUYxIiBjeD0iMTAuNSIgY3k9IjE5LjUiIHI9IjkuMyIvPjwvZz48L2c+PC9zdmc+";
|
|
@@ -5443,9 +5730,9 @@ const APassengerCircle = defineSetup(function APassengerCircle2(props) {
|
|
|
5443
5730
|
const style2 = angle === void 0 ? "" : `transform: rotate(var(${angle}))`;
|
|
5444
5731
|
const type = size === "large" ? angle === void 0 ? "large" : "largeArrow" : angle === void 0 ? "small" : "smallArrow";
|
|
5445
5732
|
return `
|
|
5446
|
-
<img
|
|
5733
|
+
<img class="APassengerCircle ${passengerCircle({
|
|
5447
5734
|
type
|
|
5448
|
-
})}" style="${style2}">
|
|
5735
|
+
})}" style="${style2}" src="${src}">
|
|
5449
5736
|
`;
|
|
5450
5737
|
});
|
|
5451
5738
|
return () => {
|
|
@@ -5470,9 +5757,9 @@ const GPassengerCircle = defineSetup(function GPassengerCircle2(props) {
|
|
|
5470
5757
|
const style2 = angle === void 0 ? "" : `transform: rotate(var(${angle}))`;
|
|
5471
5758
|
const type = size === "large" ? angle === void 0 ? "large" : "largeArrow" : angle === void 0 ? "small" : "smallArrow";
|
|
5472
5759
|
return createDom("img", {
|
|
5473
|
-
class: passengerCircle({
|
|
5760
|
+
class: `GPassengerCircle ${passengerCircle({
|
|
5474
5761
|
type
|
|
5475
|
-
})
|
|
5762
|
+
})}`,
|
|
5476
5763
|
src,
|
|
5477
5764
|
style: style2
|
|
5478
5765
|
});
|
|
@@ -5526,42 +5813,15 @@ const ConditionalFittablePassengerCircle = defineSetup(function ConditionalFitta
|
|
|
5526
5813
|
})]);
|
|
5527
5814
|
};
|
|
5528
5815
|
});
|
|
5529
|
-
const useAmapLngLatToVw = () => {
|
|
5530
|
-
const amap2 = useAmap();
|
|
5531
|
-
const apiMapLngLatToVw = (point) => {
|
|
5532
|
-
var _a;
|
|
5533
|
-
return (_a = amap2 == null ? void 0 : amap2.value) == null ? void 0 : _a.lngLatToContainer(point).toArray();
|
|
5534
|
-
};
|
|
5535
|
-
return { apiMapLngLatToVw };
|
|
5536
|
-
};
|
|
5537
|
-
const useGmapLngLatToVw = () => {
|
|
5538
|
-
const gmap2 = useGmap();
|
|
5539
|
-
const apiMapLngLatToVw = (point) => {
|
|
5540
|
-
var _a, _b, _c, _d, _e;
|
|
5541
|
-
const [lng, lat] = point;
|
|
5542
|
-
const projection = (_a = gmap2 == null ? void 0 : gmap2.value) == null ? void 0 : _a.getProjection();
|
|
5543
|
-
const worldCoordinate = projection == null ? void 0 : projection.fromLatLngToPoint({ lng, lat });
|
|
5544
|
-
const x = (_b = worldCoordinate == null ? void 0 : worldCoordinate.x) != null ? _b : 0;
|
|
5545
|
-
const y = (_c = worldCoordinate == null ? void 0 : worldCoordinate.y) != null ? _c : 0;
|
|
5546
|
-
const zoom = (_e = (_d = gmap2 == null ? void 0 : gmap2.value) == null ? void 0 : _d.getZoom()) != null ? _e : 0;
|
|
5547
|
-
const scale = 2 ** zoom;
|
|
5548
|
-
return [x * scale, y * scale];
|
|
5549
|
-
};
|
|
5550
|
-
return { apiMapLngLatToVw };
|
|
5551
|
-
};
|
|
5552
|
-
const useMapLngLatToVw = () => {
|
|
5553
|
-
const { supplier } = useMapSupplier();
|
|
5554
|
-
return supplier === "gmap" ? useGmapLngLatToVw() : useAmapLngLatToVw();
|
|
5555
|
-
};
|
|
5556
5816
|
const reverse = (direction) => direction === "left" ? "right" : "left";
|
|
5557
5817
|
const usePointsLabelDirection = (props) => {
|
|
5558
5818
|
const { widthLimit, heightLimit } = props;
|
|
5559
|
-
const
|
|
5819
|
+
const mapRef = useMap();
|
|
5820
|
+
const { apiMapLngLatToVw } = useMapLngLatToVw({ mapRef });
|
|
5560
5821
|
const diffVw = (from, to) => {
|
|
5561
|
-
const vw = 100 / window.innerWidth;
|
|
5562
5822
|
const [x1, y1] = apiMapLngLatToVw(from);
|
|
5563
5823
|
const [x2, y2] = apiMapLngLatToVw(to);
|
|
5564
|
-
return [
|
|
5824
|
+
return [x2 - x1, y2 - y1];
|
|
5565
5825
|
};
|
|
5566
5826
|
const directionsRef = ref(Array(props.places.length).fill("right"));
|
|
5567
5827
|
watchEffectForDeepOption(
|
|
@@ -5629,7 +5889,7 @@ const APlaceCircle = defineSetup(function APlaceCircle2(props, {
|
|
|
5629
5889
|
hideIcon = false
|
|
5630
5890
|
} = props;
|
|
5631
5891
|
return `
|
|
5632
|
-
<div class="${placeCircleLayout({
|
|
5892
|
+
<div class="APlaceCircle ${placeCircleLayout({
|
|
5633
5893
|
textAlign: textAlignRef.value
|
|
5634
5894
|
})}">
|
|
5635
5895
|
<img class="${placeIcon({
|
|
@@ -5645,7 +5905,7 @@ const APlaceCircle = defineSetup(function APlaceCircle2(props, {
|
|
|
5645
5905
|
const {
|
|
5646
5906
|
hideIcon = false
|
|
5647
5907
|
} = props;
|
|
5648
|
-
return `<img class="${placeIcon({
|
|
5908
|
+
return `<img class="APlaceCircle ${placeIcon({
|
|
5649
5909
|
hideIcon
|
|
5650
5910
|
})} ${amapPlaceIconLayout({
|
|
5651
5911
|
textAlign: textAlignRef.value
|
|
@@ -5680,7 +5940,7 @@ const GPlaceCircle = defineSetup(function GPlaceCircle2(props, {
|
|
|
5680
5940
|
hideIcon = false
|
|
5681
5941
|
} = props;
|
|
5682
5942
|
return createDom("div", {
|
|
5683
|
-
class:
|
|
5943
|
+
class: `GPlaceCircle ${placeCircleLayout({
|
|
5684
5944
|
textAlign: textAlignRef.value
|
|
5685
5945
|
})} ${gmapPlaceIconLayout({
|
|
5686
5946
|
textAlign: textAlignRef.value
|
|
@@ -5697,7 +5957,7 @@ const GPlaceCircle = defineSetup(function GPlaceCircle2(props, {
|
|
|
5697
5957
|
hideIcon = false
|
|
5698
5958
|
} = props;
|
|
5699
5959
|
return createDom("img", {
|
|
5700
|
-
class:
|
|
5960
|
+
class: `GPlaceCircle ${placeIcon({
|
|
5701
5961
|
hideIcon
|
|
5702
5962
|
})} ${gmapPlaceIconLayout({
|
|
5703
5963
|
textAlign: textAlignRef.value
|
|
@@ -5760,27 +6020,18 @@ const PickupPoints = defineSetup(function PickupPoints2(props, {
|
|
|
5760
6020
|
})]);
|
|
5761
6021
|
};
|
|
5762
6022
|
});
|
|
5763
|
-
const useFirstWorkflowRecomendLoading = () => {
|
|
5764
|
-
const isFirstWorkflowRecomendLoadingRef = ref(true);
|
|
5765
|
-
const completeFirstWorkflowRecomend = () => {
|
|
5766
|
-
if (!isFirstWorkflowRecomendLoadingRef.value)
|
|
5767
|
-
return;
|
|
5768
|
-
isFirstWorkflowRecomendLoadingRef.value = false;
|
|
5769
|
-
};
|
|
5770
|
-
return { isFirstWorkflowRecomendLoadingRef, completeFirstWorkflowRecomend };
|
|
5771
|
-
};
|
|
5772
6023
|
const RECOMMEND_PLACE_DRAG_LIMIT = 10;
|
|
5773
6024
|
const RECOMMEND_PLACE_LARGE_LIMIT = 100;
|
|
5774
6025
|
const RECOMMEND_PLACE_ZOOM_MIN = 13;
|
|
5775
6026
|
const DEFAULT_PLACE_NAME = "当前位置";
|
|
5776
|
-
const DEFAULT_ZOOM =
|
|
5777
|
-
const READY_ZOOM = 17;
|
|
6027
|
+
const DEFAULT_ZOOM = 17;
|
|
5778
6028
|
const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlaceMap2(props, {
|
|
5779
6029
|
emit,
|
|
5780
6030
|
slots
|
|
5781
6031
|
}) {
|
|
5782
6032
|
var _a, _b;
|
|
5783
6033
|
const {
|
|
6034
|
+
geoLoadingTitle,
|
|
5784
6035
|
geoDefaultPosition,
|
|
5785
6036
|
getRecomendPlace,
|
|
5786
6037
|
getDefaultCenterPlace,
|
|
@@ -5797,27 +6048,22 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5797
6048
|
readyPromise
|
|
5798
6049
|
} = useMapSupplier();
|
|
5799
6050
|
const {
|
|
5800
|
-
zoomRef
|
|
5801
|
-
setZoom
|
|
6051
|
+
zoomRef
|
|
5802
6052
|
} = useMapZoom({
|
|
5803
6053
|
mapRef,
|
|
5804
6054
|
defaultValue: DEFAULT_ZOOM
|
|
5805
6055
|
});
|
|
5806
|
-
const {
|
|
5807
|
-
isFirstWorkflowRecomendLoadingRef,
|
|
5808
|
-
completeFirstWorkflowRecomend
|
|
5809
|
-
} = useFirstWorkflowRecomendLoading();
|
|
5810
6056
|
const centerPlace = reactive({
|
|
5811
6057
|
lng: (_a = geoDefaultPosition == null ? void 0 : geoDefaultPosition[0]) != null ? _a : 0,
|
|
5812
6058
|
lat: (_b = geoDefaultPosition == null ? void 0 : geoDefaultPosition[1]) != null ? _b : 0,
|
|
5813
|
-
name:
|
|
5814
|
-
displayName:
|
|
6059
|
+
name: geoLoadingTitle,
|
|
6060
|
+
displayName: geoLoadingTitle
|
|
5815
6061
|
});
|
|
5816
6062
|
const centerPoint = computed(() => [centerPlace.lng, centerPlace.lat]);
|
|
5817
6063
|
const centerSource = {
|
|
5818
6064
|
source: "geo"
|
|
5819
6065
|
};
|
|
5820
|
-
const
|
|
6066
|
+
const updateCenterPlaceByPoint = (point) => {
|
|
5821
6067
|
centerSource.source = "api";
|
|
5822
6068
|
updatePlace(point);
|
|
5823
6069
|
};
|
|
@@ -5831,15 +6077,40 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5831
6077
|
emit("changePlace", {
|
|
5832
6078
|
...place
|
|
5833
6079
|
});
|
|
5834
|
-
|
|
5835
|
-
await pipeDefer(setZoom)(READY_ZOOM);
|
|
6080
|
+
updateRecommendPlace(place);
|
|
5836
6081
|
};
|
|
5837
|
-
const
|
|
6082
|
+
const setCenterPlaceByUserSpecifiedInZone = ({
|
|
6083
|
+
place,
|
|
6084
|
+
recommends
|
|
6085
|
+
}) => {
|
|
6086
|
+
centerPlace.lng = place.lng;
|
|
6087
|
+
centerPlace.lat = place.lat;
|
|
6088
|
+
centerPlace.name = place.name;
|
|
6089
|
+
centerPlace.displayName = place.displayName;
|
|
6090
|
+
setPlaceCandidatesAndZone(recommends);
|
|
6091
|
+
emit("changePlace", {
|
|
6092
|
+
...place
|
|
6093
|
+
});
|
|
6094
|
+
};
|
|
6095
|
+
const panToCenterByPlace = async (place) => {
|
|
5838
6096
|
centerSource.source = "api";
|
|
6097
|
+
await panTo(place2point(place));
|
|
5839
6098
|
centerPlace.lng = place.lng;
|
|
5840
6099
|
centerPlace.lat = place.lat;
|
|
5841
6100
|
centerPlace.name = place.name;
|
|
5842
6101
|
centerPlace.displayName = place.displayName;
|
|
6102
|
+
emit("changePlace", {
|
|
6103
|
+
...place
|
|
6104
|
+
});
|
|
6105
|
+
emit("changeRecomandPlace", {
|
|
6106
|
+
place: {
|
|
6107
|
+
...place
|
|
6108
|
+
},
|
|
6109
|
+
inputPlace: {
|
|
6110
|
+
...place
|
|
6111
|
+
},
|
|
6112
|
+
isInZone: !!zoneRef.value
|
|
6113
|
+
});
|
|
5843
6114
|
};
|
|
5844
6115
|
const defaultCenterPlacePromise = new Promise((resolve) => {
|
|
5845
6116
|
getDefaultCenterPlace().then(resolve).catch(() => resolve(void 0));
|
|
@@ -5870,9 +6141,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5870
6141
|
await setCenterPlaceByUserSpecified(place);
|
|
5871
6142
|
} else {
|
|
5872
6143
|
updatePlace(value.position);
|
|
5873
|
-
await pipeDefer(setZoom)(READY_ZOOM);
|
|
5874
6144
|
}
|
|
5875
|
-
completeFirstWorkflowRecomend();
|
|
5876
6145
|
},
|
|
5877
6146
|
onChange: (v) => emit("changeGeoLocation", v),
|
|
5878
6147
|
onError: (e) => {
|
|
@@ -5880,10 +6149,11 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5880
6149
|
}
|
|
5881
6150
|
});
|
|
5882
6151
|
mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
|
|
6152
|
+
mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
|
|
5883
6153
|
mapContext.panToGeoPositionByRecomend = () => {
|
|
5884
6154
|
if (geoError.value)
|
|
5885
6155
|
return false;
|
|
5886
|
-
|
|
6156
|
+
updateCenterPlaceByPoint(geoPosition.value);
|
|
5887
6157
|
return true;
|
|
5888
6158
|
};
|
|
5889
6159
|
const {
|
|
@@ -5898,9 +6168,10 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5898
6168
|
});
|
|
5899
6169
|
const {
|
|
5900
6170
|
updatePlace,
|
|
5901
|
-
|
|
5902
|
-
|
|
6171
|
+
updateRecommendPlace,
|
|
6172
|
+
setPlaceCandidatesAndZone,
|
|
5903
6173
|
placeCandidates,
|
|
6174
|
+
zoneRef,
|
|
5904
6175
|
availableRef,
|
|
5905
6176
|
isElectedRef
|
|
5906
6177
|
} = useMapRecomendPlace({
|
|
@@ -5923,20 +6194,26 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5923
6194
|
},
|
|
5924
6195
|
onChangePlace: (place) => {
|
|
5925
6196
|
if (centerSource.source !== "recomend") {
|
|
5926
|
-
|
|
6197
|
+
updateRecommendPlace(place);
|
|
5927
6198
|
}
|
|
5928
6199
|
emit("changePlace", place);
|
|
5929
6200
|
},
|
|
5930
|
-
onChange: async (
|
|
6201
|
+
onChange: async ({
|
|
6202
|
+
place,
|
|
6203
|
+
inputPlace,
|
|
6204
|
+
isInZone
|
|
6205
|
+
}) => {
|
|
5931
6206
|
centerSource.source = "recomend";
|
|
6207
|
+
if (isPlaceEqual(place, centerPlace))
|
|
6208
|
+
panTo(place2point(place));
|
|
5932
6209
|
Object.assign(centerPlace, {
|
|
5933
6210
|
...place
|
|
5934
6211
|
});
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
6212
|
+
emit("changeRecomandPlace", {
|
|
6213
|
+
place,
|
|
6214
|
+
inputPlace,
|
|
6215
|
+
isInZone
|
|
6216
|
+
});
|
|
5940
6217
|
}
|
|
5941
6218
|
});
|
|
5942
6219
|
watchEffect(() => {
|
|
@@ -5948,12 +6225,13 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5948
6225
|
mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
|
|
5949
6226
|
});
|
|
5950
6227
|
return () => {
|
|
6228
|
+
var _a2, _b2;
|
|
5951
6229
|
const {
|
|
5952
|
-
geoLoadingTitle,
|
|
6230
|
+
geoLoadingTitle: geoLoadingTitle2,
|
|
5953
6231
|
recomendDescription,
|
|
5954
6232
|
unavailableTitle
|
|
5955
6233
|
} = props;
|
|
5956
|
-
const title = geoLoading.value ?
|
|
6234
|
+
const title = geoLoading.value ? geoLoadingTitle2 : !availableRef.value ? unavailableTitle : centerPlace.displayName;
|
|
5957
6235
|
const description = !availableRef.value ? void 0 : isElectedRef.value ? recomendDescription : void 0;
|
|
5958
6236
|
return h(HeycarMap, {
|
|
5959
6237
|
"attrs": {
|
|
@@ -5964,7 +6242,11 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5964
6242
|
"fallback": slots.fallback,
|
|
5965
6243
|
"loading": slots.loading
|
|
5966
6244
|
}
|
|
5967
|
-
}, [
|
|
6245
|
+
}, [((_a2 = zoneRef.value) == null ? void 0 : _a2.path.length) && h(GreenZone, {
|
|
6246
|
+
"attrs": {
|
|
6247
|
+
"path": (_b2 = zoneRef.value) == null ? void 0 : _b2.path
|
|
6248
|
+
}
|
|
6249
|
+
}), !geoLoading.value && !geoError.value && h(PassengerCircle, {
|
|
5968
6250
|
"attrs": {
|
|
5969
6251
|
"position": geoPosition.value,
|
|
5970
6252
|
"angle": orientation.cssRotationVariableName
|
|
@@ -5975,9 +6257,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
|
|
|
5975
6257
|
"renderLabel": (place) => isPlaceEqual(place, centerPlace) ? void 0 : place.displayName
|
|
5976
6258
|
},
|
|
5977
6259
|
"on": {
|
|
5978
|
-
"click":
|
|
6260
|
+
"click": panToCenterByPlace
|
|
5979
6261
|
}
|
|
5980
|
-
}), geoLoading.value
|
|
6262
|
+
}), geoLoading.value ? null : h(AbsoluteAddressBox, {
|
|
5981
6263
|
"attrs": {
|
|
5982
6264
|
"title": title,
|
|
5983
6265
|
"description": description,
|
|
@@ -6036,10 +6318,10 @@ const ATaxiCar = defineSetup(function ATaxiCar2(props) {
|
|
|
6036
6318
|
const carStyle = `transform:rotate(${(_a = props.angle) != null ? _a : 0}deg)`;
|
|
6037
6319
|
if (!props.title)
|
|
6038
6320
|
return {
|
|
6039
|
-
img: `<img
|
|
6321
|
+
img: `<img class="ATaxiCar ${carIcon}" src="${imgTaxicar}" style="${carStyle}">`
|
|
6040
6322
|
};
|
|
6041
6323
|
const content = (hide$1) => `
|
|
6042
|
-
<div class="${pointLayout}">
|
|
6324
|
+
<div class="ATaxiCar ${pointLayout}">
|
|
6043
6325
|
<div class="${pointSingleInfoBox} ${hide({
|
|
6044
6326
|
hide: !hide$1
|
|
6045
6327
|
})}">
|
|
@@ -6081,13 +6363,13 @@ const GTaxiCar = defineSetup(function GTaxiCar2(props) {
|
|
|
6081
6363
|
if (!props.title)
|
|
6082
6364
|
return {
|
|
6083
6365
|
img: createDom("img", {
|
|
6084
|
-
class: carIcon
|
|
6366
|
+
class: `GTaxiCar ${carIcon}`,
|
|
6085
6367
|
src: imgTaxicar,
|
|
6086
6368
|
style: carStyle
|
|
6087
6369
|
})
|
|
6088
6370
|
};
|
|
6089
6371
|
const content = (hide$1) => createDom("div", {
|
|
6090
|
-
class: pointLayout
|
|
6372
|
+
class: `GTaxiCar ${pointLayout}`
|
|
6091
6373
|
}, `
|
|
6092
6374
|
<div class="${pointSingleInfoBox} ${hide({
|
|
6093
6375
|
hide: !hide$1
|
|
@@ -6147,7 +6429,8 @@ const AWalkingLine = defineSetup(function AWalkingLine2(props) {
|
|
|
6147
6429
|
"strokeStyle": "dashed",
|
|
6148
6430
|
"strokeDasharray": [strokeWidth, strokeWidth * 1.5],
|
|
6149
6431
|
"lineJoin": "round",
|
|
6150
|
-
"lineCap": "round"
|
|
6432
|
+
"lineCap": "round",
|
|
6433
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
6151
6434
|
}
|
|
6152
6435
|
});
|
|
6153
6436
|
};
|
|
@@ -6183,7 +6466,8 @@ const GWalkingLine = defineSetup(function GWalkingLine2(props) {
|
|
|
6183
6466
|
scale: 1
|
|
6184
6467
|
},
|
|
6185
6468
|
repeat: `${strokeWidth * 2}px`
|
|
6186
|
-
}]
|
|
6469
|
+
}],
|
|
6470
|
+
"zIndex": ZINDEX_LINE_LAYER
|
|
6187
6471
|
}
|
|
6188
6472
|
});
|
|
6189
6473
|
};
|
|
@@ -6312,8 +6596,8 @@ const WaveCircle_css_ts_vanilla = "";
|
|
|
6312
6596
|
var secondCircle = "rrvp0y3";
|
|
6313
6597
|
var waveCircle = "rrvp0y2";
|
|
6314
6598
|
const AWaveCircle = defineSetup(function AWaveCircle2(props) {
|
|
6315
|
-
const contentRef = computed(() => `<img
|
|
6316
|
-
const contentAnotherRef = computed(() => `<img
|
|
6599
|
+
const contentRef = computed(() => `<img class="AWaveCircle ${waveCircle}" src="${imgWaveCircle}">`);
|
|
6600
|
+
const contentAnotherRef = computed(() => `<img class="AWaveCircle ${waveCircle} ${secondCircle}" src="${imgWaveCircle}">`);
|
|
6317
6601
|
return () => h("div", [h(AmapMarker, {
|
|
6318
6602
|
"attrs": {
|
|
6319
6603
|
"position": props.position,
|
|
@@ -6330,11 +6614,11 @@ const AWaveCircle = defineSetup(function AWaveCircle2(props) {
|
|
|
6330
6614
|
});
|
|
6331
6615
|
const GWaveCircle = defineSetup(function GWaveCircle2(props) {
|
|
6332
6616
|
const contentRef = computed(() => createDom("img", {
|
|
6333
|
-
class: waveCircle
|
|
6617
|
+
class: `GWaveCircle ${waveCircle}`,
|
|
6334
6618
|
src: imgWaveCircle
|
|
6335
6619
|
}));
|
|
6336
6620
|
const contentAnotherRef = computed(() => createDom("img", {
|
|
6337
|
-
class:
|
|
6621
|
+
class: `GWaveCircle ${waveCircle} ${secondCircle}`,
|
|
6338
6622
|
src: imgWaveCircle
|
|
6339
6623
|
}));
|
|
6340
6624
|
return () => {
|
|
@@ -7079,11 +7363,24 @@ const BusinessTaxiServiceMap = defineLagecySetup(function BusinessTaxiServiceMap
|
|
|
7079
7363
|
)]);
|
|
7080
7364
|
};
|
|
7081
7365
|
}).props(["bookDispatchingTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPosition", "interval", "loading", "mapRef", "renderInServiceTitle", "renderStartSerivceTitle", "to", "registerOverlay"]);
|
|
7366
|
+
const useBusinessAlarm = (props) => {
|
|
7367
|
+
const emptyPlaceName = props == null ? void 0 : props.emptyPlaceName;
|
|
7368
|
+
const { geoPosition, geoError } = useGeoLocation({
|
|
7369
|
+
onChange: ({ position }) => {
|
|
7370
|
+
updatePlace(position);
|
|
7371
|
+
}
|
|
7372
|
+
});
|
|
7373
|
+
const { updatePlace, place } = useMapPlace({
|
|
7374
|
+
pointRef: geoPosition,
|
|
7375
|
+
emptyPlaceName: emptyPlaceName != null ? emptyPlaceName : ""
|
|
7376
|
+
});
|
|
7377
|
+
return { place, geoError };
|
|
7378
|
+
};
|
|
7082
7379
|
const useBusinessQuotingMap = () => {
|
|
7083
7380
|
const { setMap, mapRef } = useHeycarMap();
|
|
7084
7381
|
const { registerFitVeiw, setFitView } = useMapFitView({
|
|
7085
7382
|
mapRef,
|
|
7086
|
-
padding: [
|
|
7383
|
+
padding: [26, 26, 19, 26]
|
|
7087
7384
|
});
|
|
7088
7385
|
return { setMap, registerFitVeiw, setFitView };
|
|
7089
7386
|
};
|
|
@@ -7099,6 +7396,7 @@ const useBusinessRecomendPlaceMap = () => {
|
|
|
7099
7396
|
const { inChina } = useMapInChina();
|
|
7100
7397
|
const panToGeoPositionByRecomend = (value) => mapContext.panToGeoPositionByRecomend(value);
|
|
7101
7398
|
const setCenterPlaceByUserSpecified = (value) => mapContext.setCenterPlaceByUserSpecified(value);
|
|
7399
|
+
const setCenterPlaceByUserSpecifiedInZone = (value) => mapContext.setCenterPlaceByUserSpecifiedInZone(value);
|
|
7102
7400
|
const mapContext = {
|
|
7103
7401
|
panToGeoPositionByRecomend: () => {
|
|
7104
7402
|
throw new Error("MyError: panToGeoPositionByRecomend used before assigned");
|
|
@@ -7106,6 +7404,9 @@ const useBusinessRecomendPlaceMap = () => {
|
|
|
7106
7404
|
setCenterPlaceByUserSpecified: () => {
|
|
7107
7405
|
throw new Error("MyError: setCenterPlaceByRecomand used before assigned");
|
|
7108
7406
|
},
|
|
7407
|
+
setCenterPlaceByUserSpecifiedInZone: () => {
|
|
7408
|
+
throw new Error("MyError: setCenterPlaceByUserSpecifiedInZone used before assigned");
|
|
7409
|
+
},
|
|
7109
7410
|
onChangeCenterPlace: (place) => {
|
|
7110
7411
|
Object.assign(centerPlace, { ...place });
|
|
7111
7412
|
},
|
|
@@ -7119,6 +7420,7 @@ const useBusinessRecomendPlaceMap = () => {
|
|
|
7119
7420
|
placeCandidates,
|
|
7120
7421
|
panToGeoPositionByRecomend,
|
|
7121
7422
|
setCenterPlaceByUserSpecified,
|
|
7423
|
+
setCenterPlaceByUserSpecifiedInZone,
|
|
7122
7424
|
apiMapDistance,
|
|
7123
7425
|
apiMapInChina: inChina
|
|
7124
7426
|
};
|
|
@@ -7151,6 +7453,7 @@ export {
|
|
|
7151
7453
|
WalkingLine,
|
|
7152
7454
|
WalkingRoute,
|
|
7153
7455
|
WaveCircle,
|
|
7456
|
+
useBusinessAlarm,
|
|
7154
7457
|
useBusinessQuotingMap,
|
|
7155
7458
|
useBusinessRecomendPlaceMap,
|
|
7156
7459
|
useBusinessTaxiServiceMap,
|