@heycar/heycars-map 2.3.0-drag1 → 2.3.0-drag3
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/v2/Demo/DemoBusinessRecomendPlace.js +1 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +8 -8
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.f16e3b67.js → BusinessRecomendPlaceMap.81a4b640.js} +7 -7
- package/dist/v2/chunks/throttle.8bdd8d3b.js +20 -0
- package/dist/v2/hooks/useDeviceOrientation.js +1 -17
- package/dist/v2/hooks/useMapLoader.js +11 -4
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/utils/helper.js +7 -2
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +1 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +8 -8
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.dda27543.js → BusinessRecomendPlaceMap.7133beea.js} +7 -7
- package/dist/v3/chunks/throttle.8bdd8d3b.js +20 -0
- package/dist/v3/hooks/useDeviceOrientation.js +1 -17
- package/dist/v3/hooks/useMapLoader.js +11 -4
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/utils/helper.js +7 -2
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.81a4b640.js";
|
|
3
3
|
import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
|
|
4
4
|
import { defineSetup } from "../types/helper.js";
|
|
5
5
|
import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
|
|
@@ -27,7 +27,7 @@ import "../GreenZone/GreenZone.js";
|
|
|
27
27
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import "../PickupPoints/PickupPoints.js";
|
|
29
29
|
import "./useCacheCenterPlace.js";
|
|
30
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
30
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.81a4b640.js";
|
|
31
31
|
export {
|
|
32
32
|
B as BusinessRecomendPlaceMap,
|
|
33
33
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
1
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.81a4b640.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
4
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -18,10 +18,10 @@ import { throwNoneManualAbortError, MANUAL_ABORT_MESSAGE } from "../../utils/Man
|
|
|
18
18
|
import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../../utils/compare.js";
|
|
19
19
|
import { equalAssign, isPlacesInclude } from "../../utils/helper.js";
|
|
20
20
|
import { detectBrowserPlatform } from "../../utils/platform.js";
|
|
21
|
-
import { place2point, isPlaceEqual,
|
|
21
|
+
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
|
|
22
22
|
import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
|
|
23
23
|
import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
24
|
-
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.
|
|
24
|
+
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.81a4b640.js";
|
|
25
25
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
26
26
|
import { GreenZone } from "../GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
|
|
@@ -35,8 +35,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
35
35
|
emptyTitle,
|
|
36
36
|
queryingTitle,
|
|
37
37
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
38
|
-
getAvailable,
|
|
39
|
-
getRecomendPlace,
|
|
38
|
+
getAvailable: inputGetAvailable,
|
|
39
|
+
getRecomendPlace: inputGetRecomendPlace,
|
|
40
40
|
mapContext,
|
|
41
41
|
disableLocator,
|
|
42
42
|
defaultPlace: inputDefaultPlace = {
|
|
@@ -53,8 +53,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
53
53
|
coordinatifyValueOfOnChangeRecommendPlace,
|
|
54
54
|
coordinatifyGeoPosition
|
|
55
55
|
} = useMapCoordinatify();
|
|
56
|
-
const
|
|
57
|
-
const
|
|
56
|
+
const getAvailable = inputGetAvailable && ((p) => inputGetAvailable(coordinatifyPlace(p)));
|
|
57
|
+
const getRecomendPlace = (p, context) => inputGetRecomendPlace(coordinatifyPlace(p), context).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r)));
|
|
58
58
|
const {
|
|
59
59
|
apiMapDistance
|
|
60
60
|
} = useMapGeometry();
|
|
@@ -199,8 +199,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
199
199
|
queryingPlaceName: queryingTitle,
|
|
200
200
|
context: centerSource,
|
|
201
201
|
signal: abortController.signal,
|
|
202
|
-
getAvailable
|
|
203
|
-
getRecomendPlace
|
|
202
|
+
getAvailable,
|
|
203
|
+
getRecomendPlace,
|
|
204
204
|
getLimit: (context) => {
|
|
205
205
|
const source = context == null ? void 0 : context.source;
|
|
206
206
|
switch (source) {
|
package/dist/v2/chunks/{BusinessRecomendPlaceMap.f16e3b67.js → BusinessRecomendPlaceMap.81a4b640.js}
RENAMED
|
@@ -19,7 +19,7 @@ import { throwNoneManualAbortError, MANUAL_ABORT_MESSAGE } from "../utils/Manual
|
|
|
19
19
|
import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../utils/compare.js";
|
|
20
20
|
import { equalAssign, isPlacesInclude } from "../utils/helper.js";
|
|
21
21
|
import { detectBrowserPlatform } from "../utils/platform.js";
|
|
22
|
-
import { place2point, isPlaceEqual,
|
|
22
|
+
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../utils/transform.js";
|
|
23
23
|
import { toCoordinatePointType, toCoordinateRecommendZonePlacesType, toCoordinatePlaceType } from "../utils/typeChecking.js";
|
|
24
24
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
25
25
|
import { DeviceOrientation } from "../business-components/DeviceOrientation/DeviceOrientation.js";
|
|
@@ -284,8 +284,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
284
284
|
emptyTitle,
|
|
285
285
|
queryingTitle,
|
|
286
286
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
287
|
-
getAvailable,
|
|
288
|
-
getRecomendPlace,
|
|
287
|
+
getAvailable: inputGetAvailable,
|
|
288
|
+
getRecomendPlace: inputGetRecomendPlace,
|
|
289
289
|
mapContext
|
|
290
290
|
} = props;
|
|
291
291
|
const abortController = new AbortController();
|
|
@@ -298,8 +298,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
298
298
|
coordinatifyValueOfOnChangeRecommendPlace,
|
|
299
299
|
coordinatifyGeoPosition
|
|
300
300
|
} = useMapCoordinatify();
|
|
301
|
-
const
|
|
302
|
-
const
|
|
301
|
+
const getAvailable = inputGetAvailable && ((p) => inputGetAvailable(coordinatifyPlace(p)));
|
|
302
|
+
const getRecomendPlace = (p, context) => inputGetRecomendPlace(coordinatifyPlace(p), context).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r)));
|
|
303
303
|
const {
|
|
304
304
|
apiMapDistance
|
|
305
305
|
} = useMapGeometry();
|
|
@@ -473,8 +473,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
473
473
|
queryingPlaceName: queryingTitle,
|
|
474
474
|
context: centerSource,
|
|
475
475
|
signal: abortController.signal,
|
|
476
|
-
getAvailable
|
|
477
|
-
getRecomendPlace
|
|
476
|
+
getAvailable,
|
|
477
|
+
getRecomendPlace,
|
|
478
478
|
getLimit: (context) => {
|
|
479
479
|
const source = context == null ? void 0 : context.source;
|
|
480
480
|
switch (source) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { i as isObject, d as debounce } from "./debounce.5afe7867.js";
|
|
2
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
3
|
+
function throttle(func, wait, options) {
|
|
4
|
+
var leading = true, trailing = true;
|
|
5
|
+
if (typeof func != "function") {
|
|
6
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
7
|
+
}
|
|
8
|
+
if (isObject(options)) {
|
|
9
|
+
leading = "leading" in options ? !!options.leading : leading;
|
|
10
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
11
|
+
}
|
|
12
|
+
return debounce(func, wait, {
|
|
13
|
+
"leading": leading,
|
|
14
|
+
"maxWait": wait,
|
|
15
|
+
"trailing": trailing
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
throttle as t
|
|
20
|
+
};
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { reactive, watch } from "vue-demi";
|
|
2
2
|
import { MINI_PROGRAM_WEB_VIEW_CLOSE_EVENT } from "../utils/patchMiniprogram.js";
|
|
3
3
|
import { OS_PLATFORM, detectOSPlatform } from "../utils/platform.js";
|
|
4
|
-
import {
|
|
5
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
6
|
-
function throttle(func, wait, options) {
|
|
7
|
-
var leading = true, trailing = true;
|
|
8
|
-
if (typeof func != "function") {
|
|
9
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
10
|
-
}
|
|
11
|
-
if (isObject(options)) {
|
|
12
|
-
leading = "leading" in options ? !!options.leading : leading;
|
|
13
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
14
|
-
}
|
|
15
|
-
return debounce(func, wait, {
|
|
16
|
-
"leading": leading,
|
|
17
|
-
"maxWait": wait,
|
|
18
|
-
"trailing": trailing
|
|
19
|
-
});
|
|
20
|
-
}
|
|
4
|
+
import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
|
|
21
5
|
const DEVICE_ORIENTATION_INTERVAL = 200;
|
|
22
6
|
const CSS_DEVICE_ORIENTATION_VAR_PREFIX = "--CSS_DEVICE_ORIENTATION_VAR_ROTATION_DEGREE_";
|
|
23
7
|
const useDeviceOrientation = (props) => {
|
|
@@ -4,6 +4,7 @@ import { MANUAL_ABORT_MESSAGE } from "../utils/ManualAbortError.js";
|
|
|
4
4
|
import { watchPostEffectForDeepOption } from "../utils/compare.js";
|
|
5
5
|
import { createOneConcurrent, sleep, createRunOnce } from "../utils/helper.js";
|
|
6
6
|
import { patchGoogleMapLoader } from "../utils/patchGoogleMapLoader.js";
|
|
7
|
+
import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
|
|
7
8
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
8
9
|
function adopt(value) {
|
|
9
10
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -548,6 +549,7 @@ var dist = {
|
|
|
548
549
|
});
|
|
549
550
|
})(dist);
|
|
550
551
|
const MIN_MAP_RELOAD_INTERVAL = 5e3;
|
|
552
|
+
const MIN_GMAP_LOAD_RESET_THRESHOLD = 1e3;
|
|
551
553
|
const DEFAULT_AMAP_PLUGINS = [
|
|
552
554
|
"AMap.Geocoder",
|
|
553
555
|
"AMap.Driving",
|
|
@@ -649,6 +651,9 @@ const useAmapLoader = (props) => {
|
|
|
649
651
|
watchPostEffectForDeepOption(() => [optionsRef.value, disableRef == null ? void 0 : disableRef.value], keepRetry);
|
|
650
652
|
return { statusRef, pingStatusRef, readyPromise };
|
|
651
653
|
};
|
|
654
|
+
const throttledExecute = throttle((fn) => fn(), MIN_GMAP_LOAD_RESET_THRESHOLD, {
|
|
655
|
+
trailing: false
|
|
656
|
+
});
|
|
652
657
|
const useGmapLoader = (props) => {
|
|
653
658
|
const { disableRef, onSuccess, onFail, onDownloadOptimizeEnd } = props;
|
|
654
659
|
let resolveLoader;
|
|
@@ -670,10 +675,12 @@ const useGmapLoader = (props) => {
|
|
|
670
675
|
return Promise.resolve();
|
|
671
676
|
const loader = new Loader({ ...options, retries: 0 });
|
|
672
677
|
patchGoogleMapLoader(loader);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
678
|
+
throttledExecute(() => {
|
|
679
|
+
if (loader.status !== LoaderStatus.INITIALIZED) {
|
|
680
|
+
window.google = void 0;
|
|
681
|
+
loader.reset();
|
|
682
|
+
}
|
|
683
|
+
});
|
|
677
684
|
const abortPromise = new Promise((resolve) => signal == null ? void 0 : signal.addEventListener("abort", resolve));
|
|
678
685
|
statusRef.value = "LOADING";
|
|
679
686
|
const startTime = Date.now();
|
|
@@ -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.81a4b640.js";
|
|
3
3
|
import { CenterPlaceStatus } from "../types/interface.js";
|
|
4
4
|
import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
|
|
5
5
|
const useBusinessRecomendPlaceMap = () => {
|
package/dist/v2/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import "./utils/alipayPolyfill.js";
|
|
|
2
2
|
import { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
3
3
|
import { AddressBox } from "./business-components/AddressBox/AddressBox.js";
|
|
4
4
|
import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
|
|
5
|
-
import { B } from "./chunks/BusinessRecomendPlaceMap.
|
|
5
|
+
import { B } from "./chunks/BusinessRecomendPlaceMap.81a4b640.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";
|
package/dist/v2/utils/helper.js
CHANGED
|
@@ -181,8 +181,13 @@ const createAbortableOneConcurrent = (creator, opt) => {
|
|
|
181
181
|
if (isRunning)
|
|
182
182
|
controller == null ? void 0 : controller.abort(MANUAL_ABORT_MESSAGE);
|
|
183
183
|
isRunning = true;
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
const ac = new AbortController();
|
|
185
|
+
controller = ac;
|
|
186
|
+
const result = creator(ac.signal)(...args).finally(() => {
|
|
187
|
+
if (ac.signal.aborted)
|
|
188
|
+
return;
|
|
189
|
+
isRunning = false;
|
|
190
|
+
});
|
|
186
191
|
return (opt == null ? void 0 : opt.silent) ? result.catch(throwNoneManualAbortError) : result;
|
|
187
192
|
};
|
|
188
193
|
const abort = () => {
|
package/dist/v2/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.0-
|
|
3
|
+
const pkgVersion = "2.3.0-drag3";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createVNode } from "vue";
|
|
2
|
-
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.
|
|
2
|
+
import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.7133beea.js";
|
|
3
3
|
import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
|
|
4
4
|
import { defineSetup } from "../types/helper.js";
|
|
5
5
|
import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
|
|
@@ -27,7 +27,7 @@ import "../GreenZone/GreenZone.js";
|
|
|
27
27
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import "../PickupPoints/PickupPoints.js";
|
|
29
29
|
import "./useCacheCenterPlace.js";
|
|
30
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
30
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.7133beea.js";
|
|
31
31
|
export {
|
|
32
32
|
B as BusinessRecomendPlaceMap,
|
|
33
33
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
1
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.7133beea.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
4
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -18,10 +18,10 @@ import { throwNoneManualAbortError, MANUAL_ABORT_MESSAGE } from "../../utils/Man
|
|
|
18
18
|
import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../../utils/compare.js";
|
|
19
19
|
import { equalAssign, isPlacesInclude } from "../../utils/helper.js";
|
|
20
20
|
import { detectBrowserPlatform } from "../../utils/platform.js";
|
|
21
|
-
import { place2point, isPlaceEqual,
|
|
21
|
+
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
|
|
22
22
|
import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
|
|
23
23
|
import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
24
|
-
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.
|
|
24
|
+
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.7133beea.js";
|
|
25
25
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
26
26
|
import { GreenZone } from "../GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
|
|
@@ -35,8 +35,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
35
35
|
emptyTitle,
|
|
36
36
|
queryingTitle,
|
|
37
37
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
38
|
-
getAvailable,
|
|
39
|
-
getRecomendPlace,
|
|
38
|
+
getAvailable: inputGetAvailable,
|
|
39
|
+
getRecomendPlace: inputGetRecomendPlace,
|
|
40
40
|
mapContext,
|
|
41
41
|
disableLocator,
|
|
42
42
|
defaultPlace: inputDefaultPlace = {
|
|
@@ -53,8 +53,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
53
53
|
coordinatifyValueOfOnChangeRecommendPlace,
|
|
54
54
|
coordinatifyGeoPosition
|
|
55
55
|
} = useMapCoordinatify();
|
|
56
|
-
const
|
|
57
|
-
const
|
|
56
|
+
const getAvailable = inputGetAvailable && ((p) => inputGetAvailable(coordinatifyPlace(p)));
|
|
57
|
+
const getRecomendPlace = (p, context) => inputGetRecomendPlace(coordinatifyPlace(p), context).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r)));
|
|
58
58
|
const {
|
|
59
59
|
apiMapDistance
|
|
60
60
|
} = useMapGeometry();
|
|
@@ -199,8 +199,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
|
|
|
199
199
|
queryingPlaceName: queryingTitle,
|
|
200
200
|
context: centerSource,
|
|
201
201
|
signal: abortController.signal,
|
|
202
|
-
getAvailable
|
|
203
|
-
getRecomendPlace
|
|
202
|
+
getAvailable,
|
|
203
|
+
getRecomendPlace,
|
|
204
204
|
getLimit: (context) => {
|
|
205
205
|
const source = context == null ? void 0 : context.source;
|
|
206
206
|
switch (source) {
|
package/dist/v3/chunks/{BusinessRecomendPlaceMap.dda27543.js → BusinessRecomendPlaceMap.7133beea.js}
RENAMED
|
@@ -19,7 +19,7 @@ import { throwNoneManualAbortError, MANUAL_ABORT_MESSAGE } from "../utils/Manual
|
|
|
19
19
|
import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../utils/compare.js";
|
|
20
20
|
import { equalAssign, isPlacesInclude } from "../utils/helper.js";
|
|
21
21
|
import { detectBrowserPlatform } from "../utils/platform.js";
|
|
22
|
-
import { place2point, isPlaceEqual,
|
|
22
|
+
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../utils/transform.js";
|
|
23
23
|
import { toCoordinatePointType, toCoordinateRecommendZonePlacesType, toCoordinatePlaceType } from "../utils/typeChecking.js";
|
|
24
24
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
25
25
|
import { DeviceOrientation } from "../business-components/DeviceOrientation/DeviceOrientation.js";
|
|
@@ -284,8 +284,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
284
284
|
emptyTitle,
|
|
285
285
|
queryingTitle,
|
|
286
286
|
geoErrorOnceNotificationKey = `BusinessRecomendPlaceMap_${Date.now()}`,
|
|
287
|
-
getAvailable,
|
|
288
|
-
getRecomendPlace,
|
|
287
|
+
getAvailable: inputGetAvailable,
|
|
288
|
+
getRecomendPlace: inputGetRecomendPlace,
|
|
289
289
|
mapContext
|
|
290
290
|
} = props;
|
|
291
291
|
const abortController = new AbortController();
|
|
@@ -298,8 +298,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
298
298
|
coordinatifyValueOfOnChangeRecommendPlace,
|
|
299
299
|
coordinatifyGeoPosition
|
|
300
300
|
} = useMapCoordinatify();
|
|
301
|
-
const
|
|
302
|
-
const
|
|
301
|
+
const getAvailable = inputGetAvailable && ((p) => inputGetAvailable(coordinatifyPlace(p)));
|
|
302
|
+
const getRecomendPlace = (p, context) => inputGetRecomendPlace(coordinatifyPlace(p), context).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r)));
|
|
303
303
|
const {
|
|
304
304
|
apiMapDistance
|
|
305
305
|
} = useMapGeometry();
|
|
@@ -473,8 +473,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
|
|
|
473
473
|
queryingPlaceName: queryingTitle,
|
|
474
474
|
context: centerSource,
|
|
475
475
|
signal: abortController.signal,
|
|
476
|
-
getAvailable
|
|
477
|
-
getRecomendPlace
|
|
476
|
+
getAvailable,
|
|
477
|
+
getRecomendPlace,
|
|
478
478
|
getLimit: (context) => {
|
|
479
479
|
const source = context == null ? void 0 : context.source;
|
|
480
480
|
switch (source) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { i as isObject, d as debounce } from "./debounce.5afe7867.js";
|
|
2
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
3
|
+
function throttle(func, wait, options) {
|
|
4
|
+
var leading = true, trailing = true;
|
|
5
|
+
if (typeof func != "function") {
|
|
6
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
7
|
+
}
|
|
8
|
+
if (isObject(options)) {
|
|
9
|
+
leading = "leading" in options ? !!options.leading : leading;
|
|
10
|
+
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
11
|
+
}
|
|
12
|
+
return debounce(func, wait, {
|
|
13
|
+
"leading": leading,
|
|
14
|
+
"maxWait": wait,
|
|
15
|
+
"trailing": trailing
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
throttle as t
|
|
20
|
+
};
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { reactive, watch } from "vue-demi";
|
|
2
2
|
import { MINI_PROGRAM_WEB_VIEW_CLOSE_EVENT } from "../utils/patchMiniprogram.js";
|
|
3
3
|
import { OS_PLATFORM, detectOSPlatform } from "../utils/platform.js";
|
|
4
|
-
import {
|
|
5
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
6
|
-
function throttle(func, wait, options) {
|
|
7
|
-
var leading = true, trailing = true;
|
|
8
|
-
if (typeof func != "function") {
|
|
9
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
10
|
-
}
|
|
11
|
-
if (isObject(options)) {
|
|
12
|
-
leading = "leading" in options ? !!options.leading : leading;
|
|
13
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
14
|
-
}
|
|
15
|
-
return debounce(func, wait, {
|
|
16
|
-
"leading": leading,
|
|
17
|
-
"maxWait": wait,
|
|
18
|
-
"trailing": trailing
|
|
19
|
-
});
|
|
20
|
-
}
|
|
4
|
+
import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
|
|
21
5
|
const DEVICE_ORIENTATION_INTERVAL = 200;
|
|
22
6
|
const CSS_DEVICE_ORIENTATION_VAR_PREFIX = "--CSS_DEVICE_ORIENTATION_VAR_ROTATION_DEGREE_";
|
|
23
7
|
const useDeviceOrientation = (props) => {
|
|
@@ -4,6 +4,7 @@ import { MANUAL_ABORT_MESSAGE } from "../utils/ManualAbortError.js";
|
|
|
4
4
|
import { watchPostEffectForDeepOption } from "../utils/compare.js";
|
|
5
5
|
import { createOneConcurrent, sleep, createRunOnce } from "../utils/helper.js";
|
|
6
6
|
import { patchGoogleMapLoader } from "../utils/patchGoogleMapLoader.js";
|
|
7
|
+
import { t as throttle } from "../chunks/throttle.8bdd8d3b.js";
|
|
7
8
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
8
9
|
function adopt(value) {
|
|
9
10
|
return value instanceof P ? value : new P(function(resolve) {
|
|
@@ -548,6 +549,7 @@ var dist = {
|
|
|
548
549
|
});
|
|
549
550
|
})(dist);
|
|
550
551
|
const MIN_MAP_RELOAD_INTERVAL = 5e3;
|
|
552
|
+
const MIN_GMAP_LOAD_RESET_THRESHOLD = 1e3;
|
|
551
553
|
const DEFAULT_AMAP_PLUGINS = [
|
|
552
554
|
"AMap.Geocoder",
|
|
553
555
|
"AMap.Driving",
|
|
@@ -649,6 +651,9 @@ const useAmapLoader = (props) => {
|
|
|
649
651
|
watchPostEffectForDeepOption(() => [optionsRef.value, disableRef == null ? void 0 : disableRef.value], keepRetry);
|
|
650
652
|
return { statusRef, pingStatusRef, readyPromise };
|
|
651
653
|
};
|
|
654
|
+
const throttledExecute = throttle((fn) => fn(), MIN_GMAP_LOAD_RESET_THRESHOLD, {
|
|
655
|
+
trailing: false
|
|
656
|
+
});
|
|
652
657
|
const useGmapLoader = (props) => {
|
|
653
658
|
const { disableRef, onSuccess, onFail, onDownloadOptimizeEnd } = props;
|
|
654
659
|
let resolveLoader;
|
|
@@ -670,10 +675,12 @@ const useGmapLoader = (props) => {
|
|
|
670
675
|
return Promise.resolve();
|
|
671
676
|
const loader = new Loader({ ...options, retries: 0 });
|
|
672
677
|
patchGoogleMapLoader(loader);
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
678
|
+
throttledExecute(() => {
|
|
679
|
+
if (loader.status !== LoaderStatus.INITIALIZED) {
|
|
680
|
+
window.google = void 0;
|
|
681
|
+
loader.reset();
|
|
682
|
+
}
|
|
683
|
+
});
|
|
677
684
|
const abortPromise = new Promise((resolve) => signal == null ? void 0 : signal.addEventListener("abort", resolve));
|
|
678
685
|
statusRef.value = "LOADING";
|
|
679
686
|
const startTime = Date.now();
|
|
@@ -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.7133beea.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 { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
3
3
|
import { AddressBox } from "./business-components/AddressBox/AddressBox.js";
|
|
4
4
|
import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
|
|
5
|
-
import { B } from "./chunks/BusinessRecomendPlaceMap.
|
|
5
|
+
import { B } from "./chunks/BusinessRecomendPlaceMap.7133beea.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";
|
package/dist/v3/utils/helper.js
CHANGED
|
@@ -181,8 +181,13 @@ const createAbortableOneConcurrent = (creator, opt) => {
|
|
|
181
181
|
if (isRunning)
|
|
182
182
|
controller == null ? void 0 : controller.abort(MANUAL_ABORT_MESSAGE);
|
|
183
183
|
isRunning = true;
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
const ac = new AbortController();
|
|
185
|
+
controller = ac;
|
|
186
|
+
const result = creator(ac.signal)(...args).finally(() => {
|
|
187
|
+
if (ac.signal.aborted)
|
|
188
|
+
return;
|
|
189
|
+
isRunning = false;
|
|
190
|
+
});
|
|
186
191
|
return (opt == null ? void 0 : opt.silent) ? result.catch(throwNoneManualAbortError) : result;
|
|
187
192
|
};
|
|
188
193
|
const abort = () => {
|
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.0-
|
|
3
|
+
const pkgVersion = "2.3.0-drag3";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|