@heycar/heycars-map 2.14.0-walkOptimize2 → 2.15.0-domestic2
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 +47 -15
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +2 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.js +9 -2
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +4 -1
- package/dist/v2/Demo/DemoBusinessTaxiService.js +19 -1
- package/dist/v2/Demo/demo.data.mock.d.ts +4 -0
- package/dist/v2/Demo/demo.data.mock.js +1194 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +1 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +6 -14
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +45 -7
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +80 -16
- package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +6 -0
- package/dist/v2/business-components/TaxiCar/RandomCars.js +47 -0
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.8a4a1015.js → BusinessRecomendPlaceMap.eebd0822.js} +9 -5
- package/dist/{v3/chunks/Loading.4c949ec9.js → v2/chunks/Loading.8aa3aad3.js} +47 -27
- package/dist/v2/components/Loading/Loading.js +1 -1
- package/dist/v2/components/Loading/index.js +1 -1
- package/dist/v2/components/MapProvider/MapProvider.js +21 -10
- package/dist/v2/hooks/useMapCoordinatify.d.ts +2 -1
- package/dist/v2/hooks/useMapCoordinatify.js +6 -1
- package/dist/v2/hooks/useMapLoader.js +3 -3
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/types/interface.d.ts +12 -0
- package/dist/v2/utils/geometryPolygon.d.ts +9 -0
- package/dist/v2/utils/geometryPolygon.js +19 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v2/utils/platform.d.ts +2 -1
- package/dist/v2/utils/platform.js +2 -1
- package/dist/v2/utils/typeChecking.d.ts +7 -1
- package/dist/v2/utils/typeChecking.js +18 -0
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +2 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.js +9 -2
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -1
- package/dist/v3/Demo/DemoBusinessTaxiService.js +19 -1
- package/dist/v3/Demo/demo.data.mock.d.ts +4 -0
- package/dist/v3/Demo/demo.data.mock.js +1194 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +1 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +6 -14
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +45 -7
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +62 -16
- package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +8 -0
- package/dist/v3/business-components/TaxiCar/RandomCars.js +45 -0
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.b30ca4e4.js → BusinessRecomendPlaceMap.71c439c6.js} +7 -5
- package/dist/{v2/chunks/Loading.70dfc720.js → v3/chunks/Loading.4b53c31f.js} +34 -30
- package/dist/v3/components/Loading/Loading.js +1 -1
- package/dist/v3/components/Loading/index.js +1 -1
- package/dist/v3/components/MapProvider/MapProvider.js +21 -10
- package/dist/v3/hooks/useMapCoordinatify.d.ts +2 -1
- package/dist/v3/hooks/useMapCoordinatify.js +6 -1
- package/dist/v3/hooks/useMapLoader.js +3 -3
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/types/interface.d.ts +12 -0
- package/dist/v3/utils/geometryPolygon.d.ts +9 -0
- package/dist/v3/utils/geometryPolygon.js +19 -0
- package/dist/v3/utils/log.js +1 -1
- package/dist/v3/utils/platform.d.ts +2 -1
- package/dist/v3/utils/platform.js +2 -1
- package/dist/v3/utils/typeChecking.d.ts +7 -1
- package/dist/v3/utils/typeChecking.js +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createVNode } from "vue";
|
|
2
|
+
import { computed } from "vue-demi";
|
|
3
|
+
import { defineSetup } from "../../types/helper.js";
|
|
4
|
+
import { TaxiCar } from "./TaxiCar.js";
|
|
5
|
+
const RANDOM_CARS_RADIUS = 300;
|
|
6
|
+
const RANDOM_CARS_COUNT = 2;
|
|
7
|
+
const createRandomPoint = (center, radius) => {
|
|
8
|
+
const [lng, lat] = center;
|
|
9
|
+
const R_EARTH_METERS = 6371e3;
|
|
10
|
+
const randomAngle = Math.random() * 2 * Math.PI;
|
|
11
|
+
const randomRadiusInMeters = radius * Math.sqrt(Math.random());
|
|
12
|
+
const dx = randomRadiusInMeters * Math.cos(randomAngle);
|
|
13
|
+
const dy = randomRadiusInMeters * Math.sin(randomAngle);
|
|
14
|
+
const dLat = dy / R_EARTH_METERS;
|
|
15
|
+
const centerLatRadians = lat * (Math.PI / 180);
|
|
16
|
+
const dLng = dx / (R_EARTH_METERS * Math.cos(centerLatRadians));
|
|
17
|
+
return [lng + dLng * (180 / Math.PI), lat + dLat * (180 / Math.PI)];
|
|
18
|
+
};
|
|
19
|
+
const useRandomCars = (center) => {
|
|
20
|
+
return computed(() => {
|
|
21
|
+
return Array.from({
|
|
22
|
+
length: RANDOM_CARS_COUNT
|
|
23
|
+
}).map(() => {
|
|
24
|
+
const position = createRandomPoint(center, RANDOM_CARS_RADIUS);
|
|
25
|
+
const angle = Math.random() * 360;
|
|
26
|
+
return {
|
|
27
|
+
position,
|
|
28
|
+
angle
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
const RandomCars = defineSetup("RandomCars", function(props) {
|
|
34
|
+
const {
|
|
35
|
+
center
|
|
36
|
+
} = props;
|
|
37
|
+
const randomCarsRef = useRandomCars(center);
|
|
38
|
+
return () => createVNode("div", null, [randomCarsRef.value.map((car) => createVNode(TaxiCar, {
|
|
39
|
+
"position": car.position,
|
|
40
|
+
"angle": car.angle
|
|
41
|
+
}, null))]);
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
RandomCars
|
|
45
|
+
};
|
package/dist/v3/chunks/{BusinessRecomendPlaceMap.b30ca4e4.js → BusinessRecomendPlaceMap.71c439c6.js}
RENAMED
|
@@ -26,6 +26,7 @@ import { DeviceOrientation } from "../business-components/DeviceOrientation/Devi
|
|
|
26
26
|
import { GreenZone } from "../business-components/GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../business-components/PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import { PickupPoints } from "../business-components/PickupPoints/PickupPoints.js";
|
|
29
|
+
import { RandomCars } from "../business-components/TaxiCar/RandomCars.js";
|
|
29
30
|
import { useCacheCenterPlace } from "../business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js";
|
|
30
31
|
import { b as baseGetTag, r as root } from "./isSymbol.555c14bf.js";
|
|
31
32
|
import { i as isObject } from "./debounce.5afe7867.js";
|
|
@@ -286,8 +287,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
286
287
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
287
288
|
getAvailable: inputGetAvailable,
|
|
288
289
|
getRecomendPlace: inputGetRecomendPlace,
|
|
289
|
-
mapContext
|
|
290
|
-
skipWaitGeo
|
|
290
|
+
mapContext
|
|
291
291
|
} = props;
|
|
292
292
|
const abortController = new AbortController();
|
|
293
293
|
const {
|
|
@@ -337,8 +337,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
337
337
|
} = useCacheCenterPlace({
|
|
338
338
|
defaultCenterPlace: props.defaultCenterPlace,
|
|
339
339
|
emptyTitle,
|
|
340
|
-
geoLoadingTitle
|
|
341
|
-
skipWaitGeo
|
|
340
|
+
geoLoadingTitle
|
|
342
341
|
});
|
|
343
342
|
const centerSource = {
|
|
344
343
|
source: "default"
|
|
@@ -558,6 +557,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
558
557
|
recomendDescription,
|
|
559
558
|
unavailableTitle,
|
|
560
559
|
forbiddenTitle,
|
|
560
|
+
enableNearbyCars,
|
|
561
561
|
disableLocator,
|
|
562
562
|
renderPlacePhoto,
|
|
563
563
|
renderPlaceTag
|
|
@@ -605,6 +605,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
605
605
|
"zoomIconMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_ICON_MIN : RECOMMEND_PLACE_ICON_ZOOM_MIN,
|
|
606
606
|
"zoomTextMin": zoneRef.value ? RECOMMEND_PLACE_ZONE_TEXT_MIN : RECOMMEND_PLACE_TEXT_ZOOM_MIN,
|
|
607
607
|
"onClick": panToCenterByPlace
|
|
608
|
+
}, null), !!enableNearbyCars && zoomRef.value >= RECOMMEND_PLACE_ZONE_ICON_MIN && createVNode(RandomCars, {
|
|
609
|
+
"center": [centerPlace.lng, centerPlace.lat]
|
|
608
610
|
}, null)];
|
|
609
611
|
}
|
|
610
612
|
});
|
|
@@ -629,7 +631,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
629
631
|
key: `${payload.supplier}${instanceNo}`,
|
|
630
632
|
on: generateCreateElementV2PropsOn(props, emit, ["loadGeoLocation", "loadDefaultGeoLocation", "changeByDrag", "changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
|
|
631
633
|
});
|
|
632
|
-
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "
|
|
634
|
+
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "forbiddenTitle", "recomendDescription", "enableNearbyCars", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
|
|
633
635
|
export {
|
|
634
636
|
BusinessRecomendPlaceMap as B,
|
|
635
637
|
DEFAULT_ZOOM as D,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../css/Loading-49e58ced.css";
|
|
2
|
-
import {
|
|
2
|
+
import { createVNode } from "vue";
|
|
3
3
|
import { ICON_LOAD_FAILED_URL } from "../api/cdn.js";
|
|
4
4
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
5
5
|
import { useMapSupplier } from "../hooks/useMapSupplier.js";
|
|
@@ -14,46 +14,50 @@ var loadingBg = "_17ify491";
|
|
|
14
14
|
var loadingLayout = "_17ify490";
|
|
15
15
|
var title = "_17ify495";
|
|
16
16
|
var verticalGap = "_17ify494";
|
|
17
|
-
const Loading = defineSetup("Loading", function(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
17
|
+
const Loading = defineSetup("Loading", function(_, {
|
|
18
|
+
attrs
|
|
19
|
+
}) {
|
|
20
|
+
return () => {
|
|
21
|
+
var _a;
|
|
22
|
+
return createVNode("div", {
|
|
23
|
+
"class": `${loadingLayout} ${(_a = attrs.class) != null ? _a : ""}`,
|
|
24
|
+
"style": attrs.style
|
|
25
|
+
}, [createVNode("img", {
|
|
26
|
+
"class": loadingBg,
|
|
23
27
|
"src": imgGrid
|
|
24
|
-
}
|
|
25
|
-
}), h(AbsoluteAddressBox, {
|
|
26
|
-
"attrs": {
|
|
28
|
+
}, null), createVNode(AbsoluteAddressBox, {
|
|
27
29
|
"type": "loading",
|
|
28
30
|
"title": ""
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
+
}, null)]);
|
|
32
|
+
};
|
|
31
33
|
});
|
|
32
|
-
const LoadFailed = defineSetup("LoadFailed", function(props
|
|
34
|
+
const LoadFailed = defineSetup("LoadFailed", function(props, {
|
|
35
|
+
attrs
|
|
36
|
+
}) {
|
|
33
37
|
var _a, _b;
|
|
34
38
|
const {
|
|
35
39
|
themeVariables
|
|
36
40
|
} = useMapSupplier();
|
|
37
41
|
const icon = (_b = (_a = props.icon) != null ? _a : themeVariables == null ? void 0 : themeVariables.ICON_LOAD_FAILED_URL) != null ? _b : ICON_LOAD_FAILED_URL;
|
|
38
|
-
return () =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
return () => {
|
|
43
|
+
var _a2;
|
|
44
|
+
return createVNode("div", {
|
|
45
|
+
"class": `${loadingLayout} ${(_a2 = attrs.class) != null ? _a2 : ""}`,
|
|
46
|
+
"style": attrs.style
|
|
47
|
+
}, [createVNode("img", {
|
|
48
|
+
"class": loadingBg,
|
|
43
49
|
"src": imgGrid
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"class": iconLoadFailed,
|
|
49
|
-
"attrs": {
|
|
50
|
+
}, null), createVNode("div", {
|
|
51
|
+
"class": contentLayout
|
|
52
|
+
}, [createVNode(SvgInlineWebComponentTag, {
|
|
53
|
+
"class": iconLoadFailed,
|
|
50
54
|
"src": icon
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
55
|
+
}, null), createVNode("span", {
|
|
56
|
+
"class": `${title} ${verticalGap}`
|
|
57
|
+
}, [props.title]), createVNode("span", {
|
|
58
|
+
"class": `${description} ${verticalGap}`
|
|
59
|
+
}, [props.description])])]);
|
|
60
|
+
};
|
|
57
61
|
});
|
|
58
62
|
export {
|
|
59
63
|
LoadFailed as L,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "vue";
|
|
2
2
|
import "../../api/cdn.js";
|
|
3
|
-
import { L, a } from "../../chunks/Loading.
|
|
3
|
+
import { L, a } from "../../chunks/Loading.4b53c31f.js";
|
|
4
4
|
import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
5
5
|
import "../../hooks/useMapSupplier.js";
|
|
6
6
|
import "../../types/helper.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../../css/MapProvider-156bfd53.css";
|
|
2
2
|
import { createVNode, isVNode } from "vue";
|
|
3
3
|
import { reactive, toRefs } from "vue-demi";
|
|
4
|
-
import { L as LoadFailed, a as Loading, i as imgGrid } from "../../chunks/Loading.
|
|
4
|
+
import { L as LoadFailed, a as Loading, i as imgGrid } from "../../chunks/Loading.4b53c31f.js";
|
|
5
5
|
import { useMapLoader, Status } from "../../hooks/useMapLoader.js";
|
|
6
6
|
import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
7
7
|
import { defineLagecySetup } from "../../types/helper.js";
|
|
@@ -83,7 +83,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
83
83
|
});
|
|
84
84
|
loadTraditionalChineseConvertOnce(payload.language === "zh-TW");
|
|
85
85
|
return () => {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
87
87
|
const {
|
|
88
88
|
supplier,
|
|
89
89
|
gmapId,
|
|
@@ -102,17 +102,28 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
102
102
|
const node = (_a = slots.fallback) == null ? void 0 : _a.call(slots);
|
|
103
103
|
const title = (_b = payload.renderLoadFailedTitle) == null ? void 0 : _b.call(payload, status);
|
|
104
104
|
const description = (_c = payload.renderLoadFailedDescription) == null ? void 0 : _c.call(payload, status);
|
|
105
|
-
return node ? createVNode("div",
|
|
105
|
+
return node ? createVNode("div", {
|
|
106
|
+
"class": (_d = attrs.class) != null ? _d : "",
|
|
107
|
+
"style": attrs.style
|
|
108
|
+
}, [node]) : createVNode(LoadFailed, {
|
|
109
|
+
"class": (_e = attrs.class) != null ? _e : "",
|
|
106
110
|
"title": title,
|
|
107
|
-
"description": description
|
|
111
|
+
"description": description,
|
|
112
|
+
"style": attrs.style
|
|
108
113
|
}, null);
|
|
109
114
|
}
|
|
110
115
|
if (status === Status.LOADING || status === Status.SUCCESS && pingStatus === "pending") {
|
|
111
|
-
const node = (
|
|
112
|
-
return node ? createVNode("div",
|
|
116
|
+
const node = (_f = slots.loading) == null ? void 0 : _f.call(slots);
|
|
117
|
+
return node ? createVNode("div", {
|
|
118
|
+
"class": (_g = attrs.class) != null ? _g : "",
|
|
119
|
+
"style": attrs.style
|
|
120
|
+
}, [node]) : createVNode(Loading, {
|
|
121
|
+
"class": (_h = attrs.class) != null ? _h : "",
|
|
122
|
+
"style": attrs.style
|
|
123
|
+
}, null);
|
|
113
124
|
}
|
|
114
|
-
const children = (
|
|
115
|
-
const outArea = (
|
|
125
|
+
const children = (_i = slots.default) == null ? void 0 : _i.call(slots);
|
|
126
|
+
const outArea = (_j = slots.outerArea) == null ? void 0 : _j.call(slots);
|
|
116
127
|
switch (supplier) {
|
|
117
128
|
case "gmap": {
|
|
118
129
|
const renderingType = compatibleGmapRenderingType({
|
|
@@ -120,7 +131,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
120
131
|
touchZoomCenter
|
|
121
132
|
});
|
|
122
133
|
return createVNode("div", {
|
|
123
|
-
"class": `${heycarMap} ${(
|
|
134
|
+
"class": `${heycarMap} ${(_k = attrs.class) != null ? _k : ""}`,
|
|
124
135
|
"lang": language,
|
|
125
136
|
"style": attrs.style
|
|
126
137
|
}, [createVNode(Gmap, {
|
|
@@ -149,7 +160,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
149
160
|
}
|
|
150
161
|
default:
|
|
151
162
|
return createVNode("div", {
|
|
152
|
-
"class": `${heycarMap} ${(
|
|
163
|
+
"class": `${heycarMap} ${(_l = attrs.class) != null ? _l : ""}`,
|
|
153
164
|
"lang": language,
|
|
154
165
|
"style": attrs.style
|
|
155
166
|
}, [createVNode(Amap, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CoordinateGeoPosition, type CoordinatePlace, type CoordinatePoint, type CoordinateRecommendZonePlaces, type CoordinateTrackPoint, type CoordinateValueOfOnChangeRecommendPlace, type CoordinateZone, type GeoPosition, type Place, type Point, type RecommendZonePlaces, type TrackPoint, type ValueOfOnChangeRecommendPlace, type Zone } from "../types/interface";
|
|
1
|
+
import { type CoordinateExternalRoute, type CoordinateGeoPosition, type CoordinatePlace, type CoordinatePoint, type CoordinateRecommendZonePlaces, type CoordinateTrackPoint, type CoordinateValueOfOnChangeRecommendPlace, type CoordinateZone, type ExternalRoute, type GeoPosition, type Place, type Point, type RecommendZonePlaces, type TrackPoint, type ValueOfOnChangeRecommendPlace, type Zone } from "../types/interface";
|
|
2
2
|
export declare function useMapCoordinatify(): {
|
|
3
3
|
coordinatifyPoint: (value: Point) => CoordinatePoint;
|
|
4
4
|
unCoordinatifyPoint: (value: CoordinatePoint) => Point;
|
|
@@ -12,4 +12,5 @@ export declare function useMapCoordinatify(): {
|
|
|
12
12
|
unCoordinatifyValueOfOnChangeRecommendPlace: (value: CoordinateValueOfOnChangeRecommendPlace) => ValueOfOnChangeRecommendPlace;
|
|
13
13
|
coordinatifyGeoPosition: (value: GeoPosition) => CoordinateGeoPosition;
|
|
14
14
|
unCoordinatifyTrackPoint: (value: CoordinateTrackPoint) => TrackPoint;
|
|
15
|
+
unCoordinatifyExternalRoute: (value: CoordinateExternalRoute) => ExternalRoute;
|
|
15
16
|
};
|
|
@@ -74,6 +74,10 @@ function useMapCoordinatify() {
|
|
|
74
74
|
const [lng, lat] = unCoordinatifyPoint(value);
|
|
75
75
|
return { ...others, lng, lat };
|
|
76
76
|
};
|
|
77
|
+
const unCoordinatifyExternalRoute = (value) => {
|
|
78
|
+
const { path, duration, distance } = value;
|
|
79
|
+
return { path: path.map(unCoordinatifyPoint), duration, distance };
|
|
80
|
+
};
|
|
77
81
|
const coordinatifyGeoPosition = (value) => {
|
|
78
82
|
return {
|
|
79
83
|
...value,
|
|
@@ -92,7 +96,8 @@ function useMapCoordinatify() {
|
|
|
92
96
|
coordinatifyValueOfOnChangeRecommendPlace,
|
|
93
97
|
unCoordinatifyValueOfOnChangeRecommendPlace,
|
|
94
98
|
coordinatifyGeoPosition,
|
|
95
|
-
unCoordinatifyTrackPoint
|
|
99
|
+
unCoordinatifyTrackPoint,
|
|
100
|
+
unCoordinatifyExternalRoute
|
|
96
101
|
};
|
|
97
102
|
}
|
|
98
103
|
export {
|
|
@@ -549,7 +549,7 @@ var dist = {
|
|
|
549
549
|
});
|
|
550
550
|
})(dist);
|
|
551
551
|
const MIN_MAP_RELOAD_INTERVAL = 5e3;
|
|
552
|
-
const
|
|
552
|
+
const MIN_GMAP_LOAD_RESET_THRESHOLD = 1e3;
|
|
553
553
|
const DEFAULT_AMAP_PLUGINS = [
|
|
554
554
|
"AMap.Geocoder",
|
|
555
555
|
"AMap.Driving",
|
|
@@ -608,7 +608,7 @@ const useAmapLoader = (props) => {
|
|
|
608
608
|
if (statusRef.value === "SUCCESS")
|
|
609
609
|
return Promise.resolve();
|
|
610
610
|
defineSecurityOnce();
|
|
611
|
-
|
|
611
|
+
distExports.reset();
|
|
612
612
|
statusRef.value = "LOADING";
|
|
613
613
|
setTimeout(preloadAmapStyleOnce);
|
|
614
614
|
const startTime = Date.now();
|
|
@@ -651,7 +651,7 @@ const useAmapLoader = (props) => {
|
|
|
651
651
|
watchPostEffectForDeepOption(() => [optionsRef.value, disableRef == null ? void 0 : disableRef.value], keepRetry);
|
|
652
652
|
return { statusRef, pingStatusRef, readyPromise };
|
|
653
653
|
};
|
|
654
|
-
const throttledExecute = throttle((fn) => fn(),
|
|
654
|
+
const throttledExecute = throttle((fn) => fn(), MIN_GMAP_LOAD_RESET_THRESHOLD, {
|
|
655
655
|
trailing: false
|
|
656
656
|
});
|
|
657
657
|
const useGmapLoader = (props) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reactive, ref, readonly } from "vue-demi";
|
|
2
|
-
import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.71c439c6.js";
|
|
3
3
|
import { CenterPlaceStatus } from "../types/interface.js";
|
|
4
4
|
import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
|
|
5
5
|
const useBusinessRecomendPlaceMap = () => {
|
package/dist/v3/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "./utils/alipayPolyfill.js";
|
|
|
2
2
|
import { isCoordinatePointEqual } from "./api/geometry.js";
|
|
3
3
|
import { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
4
|
import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
|
|
5
|
-
import { B } from "./chunks/BusinessRecomendPlaceMap.
|
|
5
|
+
import { B } from "./chunks/BusinessRecomendPlaceMap.71c439c6.js";
|
|
6
6
|
import { BusinessReselectPlaceMap } from "./business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js";
|
|
7
7
|
import { BusinessTaxiEndMap } from "./business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
|
|
8
8
|
import { BusinessTaxiServiceMap } from "./business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js";
|
|
@@ -80,6 +80,11 @@ export interface Route {
|
|
|
80
80
|
steps: RouteStep[];
|
|
81
81
|
trafficJams?: TrafficJams;
|
|
82
82
|
}
|
|
83
|
+
export interface ExternalRoute {
|
|
84
|
+
path: Point[];
|
|
85
|
+
duration: number;
|
|
86
|
+
distance: number;
|
|
87
|
+
}
|
|
83
88
|
export interface TrackPoint {
|
|
84
89
|
lng: number;
|
|
85
90
|
lat: number;
|
|
@@ -90,6 +95,13 @@ export interface TrackPoint {
|
|
|
90
95
|
export interface CoordinateTrackPoint extends TrackPoint {
|
|
91
96
|
type: CoordinateType;
|
|
92
97
|
}
|
|
98
|
+
export interface CoordinateExternalRoute extends Omit<ExternalRoute, "path"> {
|
|
99
|
+
path: CoordinatePoint[];
|
|
100
|
+
}
|
|
101
|
+
export type GetDriverRouteOrTrackOutput = {
|
|
102
|
+
routes?: CoordinateExternalRoute;
|
|
103
|
+
tracks?: CoordinateTrackPoint[];
|
|
104
|
+
};
|
|
93
105
|
export type RecommendType = "Restricted" | "Forbidden" | "Recommend";
|
|
94
106
|
export type DriverStatus = "dispatching" | "book-dispatching" | "dispatched" | "driverStartService" | "driverStartRelayService" | "book-driverStartService" | "book-dispatched" | "driverArrived" | "inService" | "canceled" | "endService" | "completed" | "canceling" | "banlanceRefund" | "waitBanlanceRefund" | "rechargePayed" | "waitRechargePay" | "payed" | "waitpay" | "refund" | "confirmed" | "assign" | "orderReassigned";
|
|
95
107
|
export declare enum CenterPlaceStatus {
|
|
@@ -9,3 +9,12 @@ export declare const distanceBetweenTwoPoints: (from: Point, to: Point) => numbe
|
|
|
9
9
|
* 计算折线(按顺序连接各点)总长度。
|
|
10
10
|
*/
|
|
11
11
|
export declare const computeLineLength: (line: Point[]) => number;
|
|
12
|
+
/**
|
|
13
|
+
* 计算从起点指向终点的初始方位角(heading)。
|
|
14
|
+
* 说明:
|
|
15
|
+
* - 基于球面大圆航线计算(WGS84 半径近似),与常见地图 SDK 的 heading 含义一致
|
|
16
|
+
* - 返回范围为 [-180, 180](度):0 表示正北,正值为东偏北,负值为西偏南
|
|
17
|
+
* - 起终点经纬完全相同返回 0
|
|
18
|
+
* @returns 初始方位角(度)
|
|
19
|
+
*/
|
|
20
|
+
export declare const computeLineAngle: (from: Point, to: Point) => number;
|
|
@@ -47,7 +47,26 @@ const computeLineLength = (line) => {
|
|
|
47
47
|
}
|
|
48
48
|
return totalLength;
|
|
49
49
|
};
|
|
50
|
+
const computeLineAngle = (from, to) => {
|
|
51
|
+
const [lng1, lat1] = from;
|
|
52
|
+
const [lng2, lat2] = to;
|
|
53
|
+
if (lng1 === lng2 && lat1 === lat2)
|
|
54
|
+
return 0;
|
|
55
|
+
const toRad = (deg) => deg * Math.PI / 180;
|
|
56
|
+
const toDeg = (rad) => rad * 180 / Math.PI;
|
|
57
|
+
const phi1 = toRad(lat1);
|
|
58
|
+
const phi2 = toRad(lat2);
|
|
59
|
+
const lambda1 = toRad(lng1);
|
|
60
|
+
const lambda2 = toRad(lng2);
|
|
61
|
+
const deltaLambda = lambda2 - lambda1;
|
|
62
|
+
const y = Math.sin(deltaLambda) * Math.cos(phi2);
|
|
63
|
+
const x = Math.cos(phi1) * Math.sin(phi2) - Math.sin(phi1) * Math.cos(phi2) * Math.cos(deltaLambda);
|
|
64
|
+
let heading = toDeg(Math.atan2(y, x));
|
|
65
|
+
heading = (heading + 540) % 360 - 180;
|
|
66
|
+
return heading;
|
|
67
|
+
};
|
|
50
68
|
export {
|
|
69
|
+
computeLineAngle,
|
|
51
70
|
computeLineLength,
|
|
52
71
|
distanceBetweenTwoPoints,
|
|
53
72
|
pointInPolygon
|
package/dist/v3/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.
|
|
3
|
+
const pkgVersion = "2.15.0-domestic2";
|
|
4
4
|
const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
|
|
5
5
|
const enableSessionLogKey = (key) => {
|
|
6
6
|
const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
|
|
@@ -5,6 +5,7 @@ var BRWOSER_PLATFORM = /* @__PURE__ */ ((BRWOSER_PLATFORM2) => {
|
|
|
5
5
|
BRWOSER_PLATFORM2["ALIPAY_MINIPROGRAM"] = "ALIPAY_MINIPROGRAM";
|
|
6
6
|
BRWOSER_PLATFORM2["H5"] = "H5";
|
|
7
7
|
BRWOSER_PLATFORM2["NODE_JS"] = "NODE_JS";
|
|
8
|
+
BRWOSER_PLATFORM2["ENTERPRISE_WECHAT"] = "ENTERPRISE_WECHAT";
|
|
8
9
|
return BRWOSER_PLATFORM2;
|
|
9
10
|
})(BRWOSER_PLATFORM || {});
|
|
10
11
|
var OS_PLATFORM = /* @__PURE__ */ ((OS_PLATFORM2) => {
|
|
@@ -39,7 +40,7 @@ const detectBrowserPlatform = () => {
|
|
|
39
40
|
return "NODE_JS";
|
|
40
41
|
const useragent = navigator.userAgent.toLowerCase();
|
|
41
42
|
if (useragent.includes("micromessenger")) {
|
|
42
|
-
return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : "WECHAT";
|
|
43
|
+
return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : useragent.includes("wxwork") ? "ENTERPRISE_WECHAT" : "WECHAT";
|
|
43
44
|
}
|
|
44
45
|
if (useragent.includes("alipay") || detectAlipayWallet()) {
|
|
45
46
|
return useragent.includes("miniprogram") ? "ALIPAY_MINIPROGRAM" : "ALIPAY";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoordinatePlace, CoordinatePoint, CoordinateRecommendZonePlaces, CoordinateTrackPoint, CoordinateType, CoordinateZone, ProxyServiceError, RecommendType } from "../types/interface";
|
|
1
|
+
import type { CoordinateExternalRoute, CoordinatePlace, CoordinatePoint, CoordinateRecommendZonePlaces, CoordinateTrackPoint, CoordinateType, CoordinateZone, ProxyServiceError, RecommendType } from "../types/interface";
|
|
2
2
|
export declare const createTypeError: (typeName: string, value: unknown, detail?: string) => Error;
|
|
3
3
|
export declare function isCoordinateType(type: unknown): type is CoordinateType;
|
|
4
4
|
export declare function isRecommendType(type: unknown): type is RecommendType;
|
|
@@ -41,6 +41,12 @@ interface MaybeCoordinateTrackPoint {
|
|
|
41
41
|
timestamp?: number | string;
|
|
42
42
|
}
|
|
43
43
|
export declare const toCoordinateTrackPoint: (value?: MaybeCoordinateTrackPoint) => CoordinateTrackPoint;
|
|
44
|
+
interface MaybeCoordinateExternalRoute {
|
|
45
|
+
path?: MaybeCoordinatePoint[];
|
|
46
|
+
duration?: number | string | null;
|
|
47
|
+
distance?: number | string | null;
|
|
48
|
+
}
|
|
49
|
+
export declare const toCoordinateExternalRoute: (maybeCoordinateExternalRoute?: MaybeCoordinateExternalRoute) => CoordinateExternalRoute;
|
|
44
50
|
export declare function isProxyServiceError(error: unknown): error is ProxyServiceError;
|
|
45
51
|
export declare function toGeolocationPositionError(error: unknown, prefix?: string): GeolocationPositionError;
|
|
46
52
|
/**
|
|
@@ -107,6 +107,23 @@ const toCoordinateTrackPoint = (value) => {
|
|
|
107
107
|
}
|
|
108
108
|
return { lng, lat, type, angle, speed, timestamp };
|
|
109
109
|
};
|
|
110
|
+
const toCoordinateExternalRoute = (maybeCoordinateExternalRoute) => {
|
|
111
|
+
var _a;
|
|
112
|
+
try {
|
|
113
|
+
if (!maybeCoordinateExternalRoute)
|
|
114
|
+
throw Error();
|
|
115
|
+
const duration = Number(maybeCoordinateExternalRoute.duration);
|
|
116
|
+
const distance = Number(maybeCoordinateExternalRoute.distance);
|
|
117
|
+
if (isNaN(duration) || isNaN(distance))
|
|
118
|
+
throw Error();
|
|
119
|
+
if (!Array.isArray(maybeCoordinateExternalRoute.path))
|
|
120
|
+
throw Error();
|
|
121
|
+
const path = (_a = maybeCoordinateExternalRoute.path) == null ? void 0 : _a.map(toCoordinatePointType);
|
|
122
|
+
return { path, duration, distance };
|
|
123
|
+
} catch (err) {
|
|
124
|
+
throw createTypeError("CoordinateExternalRoute", maybeCoordinateExternalRoute, err == null ? void 0 : err.message);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
110
127
|
function isProxyServiceError(error) {
|
|
111
128
|
return !!error && typeof error === "object" && "msg" in error && "code" in error;
|
|
112
129
|
}
|
|
@@ -172,6 +189,7 @@ export {
|
|
|
172
189
|
isCoordinateType,
|
|
173
190
|
isProxyServiceError,
|
|
174
191
|
isRecommendType,
|
|
192
|
+
toCoordinateExternalRoute,
|
|
175
193
|
toCoordinatePlaceType,
|
|
176
194
|
toCoordinatePointType,
|
|
177
195
|
toCoordinateRecommendZonePlacesType,
|