@heycar/heycars-map 1.0.0-coordinate7 → 2.0.0-switchMap2
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 +45 -52
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/v2/App.js +8 -4
- package/dist/v2/Demo/DemoBusinessQuoting.js +6 -12
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +3 -8
- package/dist/v2/Demo/DemoBusinessReselectPlace.js +2 -7
- package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +1 -3
- package/dist/v2/Demo/DemoBusinessTaxiEnd.js +2 -18
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +1 -2392
- package/dist/v2/Demo/DemoBusinessTaxiService.js +6 -19
- package/dist/v2/api/cdn.d.ts +1 -0
- package/dist/v2/api/cdn.js +2 -0
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +5 -5
- package/dist/v2/business-components/BusinessQuotingMap/BusinessQuotingMap.js +42 -11
- package/dist/v2/business-components/BusinessQuotingMap/index.js +3 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -3
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +4 -2
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +2 -1
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +3 -2
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +44 -17
- package/dist/v2/business-components/BusinessReselectPlaceMap/index.js +3 -2
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +2 -3
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +22 -8
- package/dist/v2/business-components/BusinessTaxiEndMap/index.js +3 -2
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +5 -5
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +42 -18
- package/dist/v2/business-components/BusinessTaxiServiceMap/index.js +3 -2
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.87ea3b2f.js → BusinessRecomendPlaceMap.5be4fdcf.js} +38 -15
- package/dist/v2/chunks/{Loading.fc6e75d0.js → Loading.da68a2a6.js} +31 -1
- package/dist/v2/chunks/throttle.8bdd8d3b.js +20 -0
- package/dist/v2/components/AmapMarker/AmapMarker.js +2 -1
- package/dist/v2/components/GmapAdvancedMarkerElement/GmapAdvancedMarkerElement.js +1 -1
- package/dist/v2/components/Loading/Loading.css.d.ts +5 -0
- package/dist/v2/components/Loading/Loading.d.ts +6 -0
- package/dist/v2/components/Loading/Loading.js +3 -1
- package/dist/v2/components/Loading/index.js +2 -1
- package/dist/v2/components/MapProvider/MapProvider.d.ts +2 -2
- package/dist/v2/components/MapProvider/MapProvider.js +20 -12
- package/dist/v2/css/Loading-0e058b68.css +51 -0
- package/dist/v2/demi-polyfill/demi-polyfill.d.ts +1 -0
- package/dist/v2/hooks/useDeviceOrientation.js +1 -17
- package/dist/v2/hooks/useMapGCJ02.js +1 -3
- package/dist/v2/hooks/useMapGraspRoad.js +1 -2
- package/dist/v2/hooks/useMapInChina.d.ts +3 -15
- package/dist/v2/hooks/useMapInChina.js +11 -16
- package/dist/v2/hooks/useMapLoader.d.ts +15 -9
- package/dist/v2/hooks/useMapLoader.js +105 -64
- package/dist/v2/hooks/useMapPlace.js +1 -2
- package/dist/v2/hooks/useMapSupplier.d.ts +2 -0
- package/dist/v2/hooks-business/useBusinessAlarm.d.ts +3 -0
- package/dist/v2/hooks-business/useBusinessQuotingMap.d.ts +7 -2393
- package/dist/v2/hooks-business/useBusinessQuotingMap.js +10 -10
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.d.ts +8 -17
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +8 -34
- package/dist/v2/hooks-business/useBusinessReselectPlaceMap.d.ts +4 -13
- package/dist/v2/hooks-business/useBusinessTaxiServiceMap.d.ts +5 -2393
- package/dist/v2/hooks-business/useBusinessTaxiServiceMap.js +5 -10
- package/dist/v2/index.js +1 -1
- package/dist/v2/utils/compare.d.ts +4 -0
- package/dist/v2/utils/compare.js +6 -0
- package/dist/v2/utils/helper.d.ts +4 -0
- package/dist/v2/utils/helper.js +14 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/App.js +8 -4
- package/dist/v3/Demo/DemoBusinessQuoting.js +7 -13
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +3 -8
- package/dist/v3/Demo/DemoBusinessReselectPlace.js +2 -7
- package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +1 -3
- package/dist/v3/Demo/DemoBusinessTaxiEnd.js +3 -17
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +1 -2392
- package/dist/v3/Demo/DemoBusinessTaxiService.js +6 -17
- package/dist/v3/api/cdn.d.ts +1 -0
- package/dist/v3/api/cdn.js +2 -0
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +16 -7
- package/dist/v3/business-components/BusinessQuotingMap/BusinessQuotingMap.js +42 -11
- package/dist/v3/business-components/BusinessQuotingMap/index.js +3 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +10 -3
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +4 -2
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +2 -1
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +10 -2
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +44 -17
- package/dist/v3/business-components/BusinessReselectPlaceMap/index.js +3 -2
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +22 -8
- package/dist/v3/business-components/BusinessTaxiEndMap/index.js +3 -2
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +19 -7
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +42 -18
- package/dist/v3/business-components/BusinessTaxiServiceMap/index.js +3 -2
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.57b15c64.js → BusinessRecomendPlaceMap.39888296.js} +38 -15
- package/dist/v3/chunks/{Loading.a8e2f26a.js → Loading.98d687c0.js} +27 -1
- package/dist/v3/chunks/throttle.8bdd8d3b.js +20 -0
- package/dist/v3/components/AmapMarker/AmapMarker.js +2 -1
- package/dist/v3/components/GmapAdvancedMarkerElement/GmapAdvancedMarkerElement.js +1 -1
- package/dist/v3/components/Loading/Loading.css.d.ts +5 -0
- package/dist/v3/components/Loading/Loading.d.ts +8 -0
- package/dist/v3/components/Loading/Loading.js +3 -1
- package/dist/v3/components/Loading/index.js +2 -1
- package/dist/v3/components/MapProvider/MapProvider.d.ts +6 -3
- package/dist/v3/components/MapProvider/MapProvider.js +18 -12
- package/dist/v3/css/Loading-0e058b68.css +51 -0
- package/dist/v3/demi-polyfill/demi-polyfill.d.ts +1 -0
- package/dist/v3/hooks/useDeviceOrientation.js +1 -17
- package/dist/v3/hooks/useMapGCJ02.js +1 -3
- package/dist/v3/hooks/useMapGraspRoad.js +1 -2
- package/dist/v3/hooks/useMapInChina.d.ts +3 -15
- package/dist/v3/hooks/useMapInChina.js +11 -16
- package/dist/v3/hooks/useMapLoader.d.ts +15 -9
- package/dist/v3/hooks/useMapLoader.js +105 -64
- package/dist/v3/hooks/useMapPlace.js +1 -2
- package/dist/v3/hooks/useMapSupplier.d.ts +2 -0
- package/dist/v3/hooks-business/useBusinessAlarm.d.ts +3 -0
- package/dist/v3/hooks-business/useBusinessQuotingMap.d.ts +7 -2393
- package/dist/v3/hooks-business/useBusinessQuotingMap.js +10 -10
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.d.ts +8 -17
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +8 -34
- package/dist/v3/hooks-business/useBusinessReselectPlaceMap.d.ts +4 -13
- package/dist/v3/hooks-business/useBusinessTaxiServiceMap.d.ts +5 -2393
- package/dist/v3/hooks-business/useBusinessTaxiServiceMap.js +5 -10
- package/dist/v3/index.js +1 -1
- package/dist/v3/utils/compare.d.ts +4 -0
- package/dist/v3/utils/compare.js +6 -0
- package/dist/v3/utils/helper.d.ts +4 -0
- package/dist/v3/utils/helper.js +14 -0
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
- package/dist/v2/Demo/Demo.d.ts +0 -3
- package/dist/v2/Demo/Demo.js +0 -1634
- package/dist/v2/components/AmapLoader/AmapLoader.d.ts +0 -5
- package/dist/v2/components/AmapLoader/AmapLoader.js +0 -21
- package/dist/v2/components/AmapLoader/index.d.ts +0 -1
- package/dist/v2/components/AmapLoader/index.js +0 -4
- package/dist/v2/components/GmapLoader/GmapLoader.d.ts +0 -5
- package/dist/v2/components/GmapLoader/GmapLoader.js +0 -21
- package/dist/v2/components/GmapLoader/index.d.ts +0 -1
- package/dist/v2/components/GmapLoader/index.js +0 -4
- package/dist/v2/css/Loading-523061b9.css +0 -9
- package/dist/v2/hooks-business/useBusinessTaxiEndMap.d.ts +0 -3
- package/dist/v2/hooks-business/useBusinessTaxiEndMap.js +0 -7
- package/dist/v3/Demo/Demo.d.ts +0 -9
- package/dist/v3/Demo/Demo.js +0 -1612
- package/dist/v3/components/AmapLoader/AmapLoader.d.ts +0 -10
- package/dist/v3/components/AmapLoader/AmapLoader.js +0 -21
- package/dist/v3/components/AmapLoader/index.d.ts +0 -1
- package/dist/v3/components/AmapLoader/index.js +0 -4
- package/dist/v3/components/GmapLoader/GmapLoader.d.ts +0 -10
- package/dist/v3/components/GmapLoader/GmapLoader.js +0 -21
- package/dist/v3/components/GmapLoader/index.d.ts +0 -1
- package/dist/v3/components/GmapLoader/index.js +0 -4
- package/dist/v3/css/Loading-523061b9.css +0 -9
- package/dist/v3/hooks-business/useBusinessTaxiEndMap.d.ts +0 -3
- package/dist/v3/hooks-business/useBusinessTaxiEndMap.js +0 -7
|
@@ -3,42 +3,52 @@ import { ref, watch } from "vue-demi";
|
|
|
3
3
|
import { apiGetAuxiliaryGrapStatus } from "../../api/browser.js";
|
|
4
4
|
import { setGlobalGoogleSnapRoadProxyUrl } from "../../api/googleSnapRoad.js";
|
|
5
5
|
import { HeycarMap } from "../../components/MapProvider/MapProvider.js";
|
|
6
|
+
import { createElement } from "../../demi-polyfill/demi-polyfill.js";
|
|
6
7
|
import { useGeoLocation } from "../../hooks/useGeoLocation.js";
|
|
7
|
-
import { useGoogleConnection } from "../../hooks/useGoogleConnection.js";
|
|
8
8
|
import { useHeycarMap } from "../../hooks/useHeycarMap.js";
|
|
9
9
|
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
10
|
-
import {
|
|
10
|
+
import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
11
|
+
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
12
|
+
import { defineSetup, defineLagecySetup } from "../../types/helper.js";
|
|
11
13
|
import { assertNotEmptyArray } from "../../utils/helper.js";
|
|
12
|
-
import { place2point,
|
|
14
|
+
import { place2point, pipeDefer, lnglat2point } from "../../utils/transform.js";
|
|
13
15
|
import { toCoordinatePlaceType, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
|
|
14
16
|
import { AuxiliaryGraspRoad } from "../AuxiliaryGraspRoad/AuxiliaryGraspRoad.js";
|
|
15
17
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
16
18
|
import { SectionDispatching, SectionConfirmed, SectionDriverStartService, SectionBookDispatched, SectionInService, SectionDriverArrived, SectionCanceled, SectionEndService } from "./BusinessTaxiServiceSection.js";
|
|
17
19
|
const STATUS_NEED_CAR_POSITION = ["book-driverStartService", "dispatched", "driverStartService", "inService", "driverArrived"];
|
|
20
|
+
const BUSINESS_TAXI_SERVICE_FITVIEW_PANDING = [19, 36, 19, 26];
|
|
18
21
|
const IS_ENABLE_AUXILIARY_GRASP_ROAD = apiGetAuxiliaryGrapStatus();
|
|
19
|
-
const
|
|
20
|
-
attrs
|
|
21
|
-
emit
|
|
22
|
+
const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", function(props, {
|
|
23
|
+
attrs
|
|
22
24
|
}) {
|
|
23
25
|
const {
|
|
24
26
|
interval,
|
|
25
27
|
disablePassenger,
|
|
26
|
-
|
|
27
|
-
mapRef: outerSetMap,
|
|
28
|
+
mapContext,
|
|
28
29
|
getDriverPositionTrack,
|
|
29
30
|
renderStartSerivceTitle,
|
|
30
31
|
renderInServiceTitle
|
|
31
32
|
} = props;
|
|
32
33
|
setGlobalGoogleSnapRoadProxyUrl(props.googleSnapRoadProxyUrl);
|
|
34
|
+
const {
|
|
35
|
+
mapRef,
|
|
36
|
+
setMap,
|
|
37
|
+
mapElementRef
|
|
38
|
+
} = useHeycarMap();
|
|
33
39
|
const {
|
|
34
40
|
unCoordinatifyPlace,
|
|
35
41
|
unCoordinatifyTrackPoint
|
|
36
42
|
} = useMapCoordinatify();
|
|
37
|
-
const deferedSetFitView = pipeDefer(() => registerOverlay.setFitView(true));
|
|
38
43
|
const {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} =
|
|
44
|
+
registerFitVeiw: registerOverlay,
|
|
45
|
+
setFitView
|
|
46
|
+
} = useMapFitView({
|
|
47
|
+
mapRef,
|
|
48
|
+
padding: BUSINESS_TAXI_SERVICE_FITVIEW_PANDING
|
|
49
|
+
});
|
|
50
|
+
mapContext.setFitView = () => setFitView(false);
|
|
51
|
+
const deferedSetFitView = pipeDefer(() => registerOverlay.setFitView(true));
|
|
42
52
|
const {
|
|
43
53
|
geoLoading,
|
|
44
54
|
geoPosition,
|
|
@@ -49,9 +59,6 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
|
|
|
49
59
|
const carPositionRef = ref();
|
|
50
60
|
const carAngleRef = ref();
|
|
51
61
|
const carTrackPositionsRef = ref([]);
|
|
52
|
-
useGoogleConnection({
|
|
53
|
-
onChange: (status) => emit("changeGoogleConnection", status)
|
|
54
|
-
});
|
|
55
62
|
watch(() => props.driverStatus, (status, _, onCleanup) => {
|
|
56
63
|
if (!STATUS_NEED_CAR_POSITION.includes(status))
|
|
57
64
|
return;
|
|
@@ -94,7 +101,7 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
|
|
|
94
101
|
"attrs": {
|
|
95
102
|
"center": place2point(from),
|
|
96
103
|
"zoom": 13,
|
|
97
|
-
"mapRef":
|
|
104
|
+
"mapRef": setMap,
|
|
98
105
|
"touchEnable": touchEnable
|
|
99
106
|
},
|
|
100
107
|
"on": {
|
|
@@ -212,7 +219,24 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
|
|
|
212
219
|
}
|
|
213
220
|
})]);
|
|
214
221
|
};
|
|
215
|
-
})
|
|
222
|
+
});
|
|
223
|
+
const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", function(props, {
|
|
224
|
+
attrs
|
|
225
|
+
}) {
|
|
226
|
+
const payload = useMapSupplier();
|
|
227
|
+
const instanceNo = Date.now();
|
|
228
|
+
return () => createElement(BusinessTaxiServiceMapInner, {
|
|
229
|
+
...attrs.class ? {
|
|
230
|
+
class: attrs.class
|
|
231
|
+
} : {},
|
|
232
|
+
...attrs.style ? {
|
|
233
|
+
style: attrs.style
|
|
234
|
+
} : {},
|
|
235
|
+
attrs: props,
|
|
236
|
+
key: `${payload.supplier}${instanceNo}`
|
|
237
|
+
});
|
|
238
|
+
}).props(["bookDispatchingTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "googleSnapRoadProxyUrl", "fallback", "from", "getDriverPositionTrack", "interval", "disablePassenger", "loading", "mapContext", "renderInServiceTitle", "renderStartSerivceTitle", "to"]);
|
|
216
239
|
export {
|
|
217
|
-
BusinessTaxiServiceMap
|
|
240
|
+
BusinessTaxiServiceMap,
|
|
241
|
+
BusinessTaxiServiceMapInner
|
|
218
242
|
};
|
package/dist/v2/chunks/{BusinessRecomendPlaceMap.87ea3b2f.js → BusinessRecomendPlaceMap.5be4fdcf.js}
RENAMED
|
@@ -3,21 +3,22 @@ import { computed, watch, watchEffect } from "vue-demi";
|
|
|
3
3
|
import { apiSaveCenterPlaceToCache } from "../api/browser.js";
|
|
4
4
|
import { apiMemoryShouldSkipByKey } from "../api/memory.js";
|
|
5
5
|
import { HeycarMap } from "../components/MapProvider/MapProvider.js";
|
|
6
|
+
import { createElement } from "../demi-polyfill/demi-polyfill.js";
|
|
6
7
|
import { useGeoLocation } from "../hooks/useGeoLocation.js";
|
|
7
|
-
import { useGoogleConnection } from "../hooks/useGoogleConnection.js";
|
|
8
8
|
import { useHeycarMap } from "../hooks/useHeycarMap.js";
|
|
9
9
|
import { useMapCoordinatify } from "../hooks/useMapCoordinatify.js";
|
|
10
10
|
import { useMapDrag } from "../hooks/useMapDrag.js";
|
|
11
|
+
import { useMapGeometry } from "../hooks/useMapGeometry.js";
|
|
11
12
|
import { useMapRecomendPlace } from "../hooks/useMapRecomendPlace.js";
|
|
12
13
|
import { useMapSupplier } from "../hooks/useMapSupplier.js";
|
|
13
14
|
import { useMapZoom } from "../hooks/useMapZoom.js";
|
|
14
|
-
import { defineLagecySetup } from "../types/helper.js";
|
|
15
|
+
import { defineSetup, defineLagecySetup } from "../types/helper.js";
|
|
15
16
|
import { CenterPlaceStatus } from "../types/interface.js";
|
|
16
|
-
import { watchPostEffectOnce } from "../utils/compare.js";
|
|
17
|
+
import { watchPostEffectOnce, generateCreateElementV2PropsOn } from "../utils/compare.js";
|
|
17
18
|
import { equalAssign, isPlacesInclude } from "../utils/helper.js";
|
|
18
19
|
import { detectBrowserPlatform } from "../utils/platform.js";
|
|
19
20
|
import { place2point, isPlaceEqual, pipeOnlyLastEffect, isZoneEqual, geoPositionError2businessTimeout } from "../utils/transform.js";
|
|
20
|
-
import { toCoordinateRecommendZonePlacesType, toCoordinatePlaceType } from "../utils/typeChecking.js";
|
|
21
|
+
import { toCoordinatePointType, toCoordinateRecommendZonePlacesType, toCoordinatePlaceType } from "../utils/typeChecking.js";
|
|
21
22
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
22
23
|
import { DeviceOrientation } from "../business-components/DeviceOrientation/DeviceOrientation.js";
|
|
23
24
|
import { GreenZone } from "../business-components/GreenZone/GreenZone.js";
|
|
@@ -271,7 +272,7 @@ const EMPTY_PLACE = {
|
|
|
271
272
|
name: "",
|
|
272
273
|
displayName: ""
|
|
273
274
|
};
|
|
274
|
-
const
|
|
275
|
+
const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner", function(props, {
|
|
275
276
|
emit,
|
|
276
277
|
slots,
|
|
277
278
|
attrs
|
|
@@ -287,6 +288,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
287
288
|
} = props;
|
|
288
289
|
const {
|
|
289
290
|
coordinatifyPoint,
|
|
291
|
+
unCoordinatifyPoint,
|
|
290
292
|
coordinatifyPlace,
|
|
291
293
|
unCoordinatifyPlace,
|
|
292
294
|
unCoordinatifyRecommendZonePlaces,
|
|
@@ -295,6 +297,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
295
297
|
} = useMapCoordinatify();
|
|
296
298
|
const pipedGetAvailable = getAvailable && pipeOnlyLastEffect((p) => getAvailable(coordinatifyPlace(p)));
|
|
297
299
|
const pipedGetRecomendPlace = pipeOnlyLastEffect((p) => getRecomendPlace(coordinatifyPlace(p)).then((r) => r && unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(r))));
|
|
300
|
+
const {
|
|
301
|
+
apiMapDistance
|
|
302
|
+
} = useMapGeometry();
|
|
298
303
|
const {
|
|
299
304
|
mapRef,
|
|
300
305
|
mapElementRef,
|
|
@@ -413,9 +418,9 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
413
418
|
emitGeoErrorOnce(error);
|
|
414
419
|
}
|
|
415
420
|
});
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
421
|
+
mapContext.apiMapDistance = (from, to) => {
|
|
422
|
+
return apiMapDistance(unCoordinatifyPoint(toCoordinatePointType(from)), unCoordinatifyPoint(toCoordinatePointType(to)));
|
|
423
|
+
};
|
|
419
424
|
mapContext.setCenterPlaceByUserSpecified = setCenterPlaceByUserSpecified;
|
|
420
425
|
mapContext.setCenterPlaceByUserSpecifiedInZone = setCenterPlaceByUserSpecifiedInZone;
|
|
421
426
|
mapContext.panToGeoPositionByRecomend = () => {
|
|
@@ -495,22 +500,19 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
495
500
|
if (!isFirstLoad)
|
|
496
501
|
updateRecommendPlaceOnlyInZone(defaultCenterPlace);
|
|
497
502
|
});
|
|
498
|
-
watch(centerPlace, () => {
|
|
503
|
+
watch(centerPlace, (place) => {
|
|
499
504
|
if (centerPlaceStatusRef.value === CenterPlaceStatus.OK) {
|
|
500
505
|
apiSaveCenterPlaceToCache(coordinatifyPlace({
|
|
501
|
-
...
|
|
506
|
+
...place
|
|
502
507
|
}));
|
|
503
508
|
}
|
|
504
|
-
mapContext.
|
|
505
|
-
...
|
|
509
|
+
equalAssign(mapContext.centerPlace, coordinatifyPlace({
|
|
510
|
+
...place
|
|
506
511
|
}));
|
|
507
512
|
}, {
|
|
508
513
|
deep: true,
|
|
509
514
|
flush: "post"
|
|
510
515
|
});
|
|
511
|
-
watchEffect(() => {
|
|
512
|
-
mapContext.onChangeRecomendPlaces(placeCandidates.value.map(coordinatifyPlace));
|
|
513
|
-
});
|
|
514
516
|
watchEffect(() => {
|
|
515
517
|
mapContext.centerPlaceStatusRef.value = centerPlaceStatusRef.value;
|
|
516
518
|
});
|
|
@@ -579,6 +581,26 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
|
|
|
579
581
|
}
|
|
580
582
|
})]);
|
|
581
583
|
};
|
|
584
|
+
});
|
|
585
|
+
const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", function(props, {
|
|
586
|
+
slots,
|
|
587
|
+
attrs,
|
|
588
|
+
emit
|
|
589
|
+
}) {
|
|
590
|
+
const payload = useMapSupplier();
|
|
591
|
+
const instanceNo = Date.now();
|
|
592
|
+
return () => createElement(BusinessRecomendPlaceMapInner, {
|
|
593
|
+
...attrs.class ? {
|
|
594
|
+
class: attrs.class
|
|
595
|
+
} : {},
|
|
596
|
+
...attrs.style ? {
|
|
597
|
+
style: attrs.style
|
|
598
|
+
} : {},
|
|
599
|
+
attrs: props,
|
|
600
|
+
scopedSlots: slots,
|
|
601
|
+
key: `${payload.supplier}${instanceNo}`,
|
|
602
|
+
on: generateCreateElementV2PropsOn(props, emit, ["loadGeoLocation", "loadDefaultGeoLocation", "changeByDrag", "changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
|
|
603
|
+
});
|
|
582
604
|
}).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
|
|
583
605
|
export {
|
|
584
606
|
BusinessRecomendPlaceMap as B,
|
|
@@ -591,5 +613,6 @@ export {
|
|
|
591
613
|
RECOMMEND_PLACE_ICON_ZOOM_MIN as c,
|
|
592
614
|
RECOMMEND_PLACE_ZONE_TEXT_MIN as d,
|
|
593
615
|
RECOMMEND_PLACE_TEXT_ZOOM_MIN as e,
|
|
616
|
+
BusinessRecomendPlaceMapInner as f,
|
|
594
617
|
memoize as m
|
|
595
618
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import "../css/Loading-
|
|
1
|
+
import "../css/Loading-0e058b68.css";
|
|
2
2
|
import { h } from "vue";
|
|
3
|
+
import { ICON_LOAD_FAILED_URL } from "../api/cdn.js";
|
|
3
4
|
import { AbsoluteAddressBox } from "../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
5
|
import { defineSetup } from "../types/helper.js";
|
|
5
6
|
const imgGrid = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzg1IiBoZWlnaHQ9IjgxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBzdHJva2U9IiNEOERCRTIiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWRhc2hhcnJheT0iMSI+PHBhdGggZD0iTS41IDgxN1YwTTI0LjUgODE3VjBNNDguNSA4MTdWME03Mi41IDgxN1YwTTk2LjUgODE3VjBNMTIwLjUgODE3VjBNMTQ0LjUgODE3VjBNMTY4LjUgODE3VjBNMTkyLjUgODE3VjBNMjE2LjUgODE3VjBNMjQwLjUgODE3VjBNMjY0LjUgODE3VjBNMjg4LjUgODE3VjBNMzEyLjUgODE3VjBNMzM2LjUgODE3VjBNMzYwLjUgODE3VjBNMzg0LjUgODE3VjBNMCAuNWgzODVNMCAyNC41aDM4NU0wIDQ4LjVoMzg1TTAgNzIuNWgzODVNMCA5Ni41aDM4NU0wIDEyMC41aDM4NU0wIDE0NC41aDM4NU0wIDE2OC41aDM4NU0wIDE5Mi41aDM4NU0wIDIxNi41aDM4NU0wIDI0MC41aDM4NU0wIDI2NC41aDM4NU0wIDI4OC41aDM4NU0wIDMxMi41aDM4NU0wIDMzNi41aDM4NU0wIDM2MC41aDM4NU0wIDM4NC41aDM4NU0wIDQwOC41aDM4NU0wIDQzMi41aDM4NU0wIDQ1Ni41aDM4NU0wIDQ4MC41aDM4NU0wIDUwNC41aDM4NU0wIDUyOC41aDM4NU0wIDU1Mi41aDM4NU0wIDU3Ni41aDM4NU0wIDYwMC41aDM4NU0wIDYyNC41aDM4NU0wIDY0OC41aDM4NU0wIDY3Mi41aDM4NU0wIDY5Ni41aDM4NU0wIDcyMC41aDM4NU0wIDc0NC41aDM4NU0wIDc2OC41aDM4NU0wIDc5Mi41aDM4NU0wIDgxNi41aDM4NSIvPjwvZz48L3N2Zz4=";
|
|
6
7
|
const Loading_css_ts_vanilla = "";
|
|
8
|
+
var description = "_17ify496";
|
|
9
|
+
var iconLayout = "_17ify492";
|
|
10
|
+
var iconLoadFailed = "_17ify493";
|
|
7
11
|
var loadingBg = "_17ify491";
|
|
8
12
|
var loadingLayout = "_17ify490";
|
|
13
|
+
var textLayout = "_17ify494";
|
|
14
|
+
var title = "_17ify495";
|
|
9
15
|
const Loading = defineSetup("Loading", function() {
|
|
10
16
|
return () => h("div", {
|
|
11
17
|
"class": loadingLayout
|
|
@@ -21,7 +27,31 @@ const Loading = defineSetup("Loading", function() {
|
|
|
21
27
|
}
|
|
22
28
|
})]);
|
|
23
29
|
});
|
|
30
|
+
const LoadFailed = defineSetup("LoadFailed", function(props) {
|
|
31
|
+
return () => h("div", {
|
|
32
|
+
"class": loadingLayout
|
|
33
|
+
}, [h("img", {
|
|
34
|
+
"class": loadingBg,
|
|
35
|
+
"attrs": {
|
|
36
|
+
"src": imgGrid
|
|
37
|
+
}
|
|
38
|
+
}), h("div", {
|
|
39
|
+
"class": iconLayout
|
|
40
|
+
}, [h("img", {
|
|
41
|
+
"class": iconLoadFailed,
|
|
42
|
+
"attrs": {
|
|
43
|
+
"src": ICON_LOAD_FAILED_URL
|
|
44
|
+
}
|
|
45
|
+
}), h("div", {
|
|
46
|
+
"class": textLayout
|
|
47
|
+
}, [h("span", {
|
|
48
|
+
"class": title
|
|
49
|
+
}, [props.title]), h("span", {
|
|
50
|
+
"class": description
|
|
51
|
+
}, [props.description])])])]);
|
|
52
|
+
});
|
|
24
53
|
export {
|
|
25
54
|
Loading as L,
|
|
55
|
+
LoadFailed as a,
|
|
26
56
|
imgGrid as i
|
|
27
57
|
};
|
|
@@ -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
|
+
};
|
|
@@ -11,7 +11,8 @@ const AmapMarker = defineSetup("AmapMarker", function(props, { emit }) {
|
|
|
11
11
|
const mapRef = useAmap();
|
|
12
12
|
onMounted(() => {
|
|
13
13
|
referenceCount.add();
|
|
14
|
-
|
|
14
|
+
const { registerOverlay: registerOverlay2, onClick, ...option } = props;
|
|
15
|
+
markerRef.value = new AMap.Marker({ ...option });
|
|
15
16
|
});
|
|
16
17
|
useMapOverlay({ registerOverlay, overlayRef: markerRef });
|
|
17
18
|
onUnmounted(() => {
|
|
@@ -11,7 +11,7 @@ const GmapAdvancedMarkerElement = defineSetup(
|
|
|
11
11
|
const mapRef = useGmap();
|
|
12
12
|
const handleGmpClick = (name) => emit(name, { target: markerRef.value });
|
|
13
13
|
onMounted(() => {
|
|
14
|
-
const { registerOverlay: registerOverlay2, ...markerViewProps } = props;
|
|
14
|
+
const { registerOverlay: registerOverlay2, onClick, ...markerViewProps } = props;
|
|
15
15
|
markerRef.value = new google.maps.marker.AdvancedMarkerElement({ ...markerViewProps });
|
|
16
16
|
});
|
|
17
17
|
onUnmounted(() => {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const loadingLayout: string;
|
|
2
2
|
export declare const loadingBg: string;
|
|
3
|
+
export declare const iconLayout: string;
|
|
4
|
+
export declare const iconLoadFailed: string;
|
|
5
|
+
export declare const textLayout: string;
|
|
6
|
+
export declare const title: string;
|
|
7
|
+
export declare const description: string;
|
|
@@ -1 +1,7 @@
|
|
|
1
1
|
export declare const Loading: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<unknown>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<unknown, Required<unknown>>, never, unknown>;
|
|
2
|
+
interface LoadFailedProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const LoadFailed: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<LoadFailedProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<LoadFailedProps, Required<LoadFailedProps>>, never, LoadFailedProps>;
|
|
7
|
+
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import
|
|
2
|
+
import "../../api/cdn.js";
|
|
3
|
+
import { a, L } from "../../chunks/Loading.da68a2a6.js";
|
|
3
4
|
import "../../business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
4
5
|
import "../../types/helper.js";
|
|
5
6
|
export {
|
|
7
|
+
a as LoadFailed,
|
|
6
8
|
L as Loading
|
|
7
9
|
};
|
|
@@ -5,8 +5,8 @@ import { type GmapLoaderProps, type UseMapLoaderProps } from "../../hooks/useMap
|
|
|
5
5
|
import { type MapSupplierPayolad } from "../../hooks/useMapSupplier";
|
|
6
6
|
import type { AmapMap } from "../../types/interface";
|
|
7
7
|
import { type AmapProps } from "../Amap";
|
|
8
|
-
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId">;
|
|
9
|
-
export declare const MapProvider: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<MapProviderProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<MapProviderProps, Required<MapProviderProps>>, "
|
|
8
|
+
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "renderLoadFailedTitle" | "renderLoadFailedDescription">;
|
|
9
|
+
export declare const MapProvider: import("vue").DefineComponent<import("vue3").ComponentObjectPropsOptions<MapProviderProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<MapProviderProps, Required<MapProviderProps>>, "success" | "fail", MapProviderProps>;
|
|
10
10
|
export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom"> {
|
|
11
11
|
mapRef?: SetMap<AmapMap> | SetMap<google.maps.Map>;
|
|
12
12
|
outerArea?: () => VueNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../css/MapProvider-156bfd53.css";
|
|
2
2
|
import { h } from "vue";
|
|
3
|
-
import { L as Loading, i as imgGrid } from "../../chunks/Loading.
|
|
3
|
+
import { L as Loading, a as LoadFailed, i as imgGrid } from "../../chunks/Loading.da68a2a6.js";
|
|
4
4
|
import { useMapLoader, Status } from "../../hooks/useMapLoader.js";
|
|
5
5
|
import { provideMapSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
6
6
|
import { defineLagecySetup } from "../../types/helper.js";
|
|
@@ -21,16 +21,13 @@ if (detectWebGL() === WEBGL_STATUS.ENABLED) {
|
|
|
21
21
|
const MapProvider = defineLagecySetup("MapProvider", function(props, {
|
|
22
22
|
slots
|
|
23
23
|
}) {
|
|
24
|
-
const
|
|
25
|
-
statusRef,
|
|
26
|
-
readyPromise
|
|
27
|
-
} = useMapLoader(props);
|
|
24
|
+
const payload = useMapLoader(props);
|
|
28
25
|
const context = new Proxy(props, {
|
|
29
26
|
get(target, name, receiver) {
|
|
30
27
|
if (name === "status")
|
|
31
|
-
return statusRef.value;
|
|
28
|
+
return payload.statusRef.value;
|
|
32
29
|
if (name === "readyPromise")
|
|
33
|
-
return readyPromise;
|
|
30
|
+
return payload.readyPromise;
|
|
34
31
|
return Reflect.get(target, name, receiver);
|
|
35
32
|
}
|
|
36
33
|
});
|
|
@@ -39,7 +36,7 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
|
|
|
39
36
|
var _a;
|
|
40
37
|
return h("div", [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
41
38
|
};
|
|
42
|
-
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language"]);
|
|
39
|
+
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "renderLoadFailedTitle", "renderLoadFailedDescription"]);
|
|
43
40
|
const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
44
41
|
slots,
|
|
45
42
|
emit,
|
|
@@ -82,10 +79,21 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
|
82
79
|
touchEnable = true,
|
|
83
80
|
touchZoomCenter
|
|
84
81
|
} = props;
|
|
85
|
-
if (status === Status.LOADING)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
if (status === Status.LOADING) {
|
|
83
|
+
const node = (_a = slots.loading) == null ? void 0 : _a.call(slots);
|
|
84
|
+
return node ? h("div", [node]) : h(Loading);
|
|
85
|
+
}
|
|
86
|
+
if (status === Status.FAILURE || status === Status.TIMEOUT) {
|
|
87
|
+
const node = (_b = slots.fallback) == null ? void 0 : _b.call(slots);
|
|
88
|
+
const title = (_c = payload.renderLoadFailedTitle) == null ? void 0 : _c.call(payload, status);
|
|
89
|
+
const description = (_d = payload.renderLoadFailedDescription) == null ? void 0 : _d.call(payload, status);
|
|
90
|
+
return node ? h("div", [node]) : h(LoadFailed, {
|
|
91
|
+
"attrs": {
|
|
92
|
+
"title": title,
|
|
93
|
+
"description": description
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
89
97
|
const children = (_e = slots.default) == null ? void 0 : _e.call(slots);
|
|
90
98
|
const outArea = (_f = slots.outerArea) == null ? void 0 : _f.call(slots);
|
|
91
99
|
const mapId = patchGmapIdForAlipayCompatible({
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
._17ify490 {
|
|
2
|
+
position: relative;
|
|
3
|
+
background-color: #EDF1F5;
|
|
4
|
+
}
|
|
5
|
+
._17ify491 {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
object-fit: cover;
|
|
9
|
+
}
|
|
10
|
+
._17ify492 {
|
|
11
|
+
position: absolute;
|
|
12
|
+
margin: auto;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
width: fit-content;
|
|
18
|
+
height: fit-content;
|
|
19
|
+
}
|
|
20
|
+
._17ify493 {
|
|
21
|
+
width: 40.8vw;
|
|
22
|
+
height: 24.53vw;
|
|
23
|
+
}
|
|
24
|
+
._17ify494 {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: max-content;
|
|
31
|
+
left: 50%;
|
|
32
|
+
transform: translate(-50%, 0);
|
|
33
|
+
}
|
|
34
|
+
._17ify495 {
|
|
35
|
+
margin-top: 1.6vw;
|
|
36
|
+
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
font-size: 4vw;
|
|
39
|
+
color: #1E1E1E;
|
|
40
|
+
line-height: 6.4vw;
|
|
41
|
+
}
|
|
42
|
+
._17ify496 {
|
|
43
|
+
margin-top: 1.6vw;
|
|
44
|
+
font-family: var(--HEYCAR_MAP_CSS_VAR_FONT_REGULAR);
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
font-size: 3.73vw;
|
|
47
|
+
color: #999BA1;
|
|
48
|
+
line-height: 6.4vw;
|
|
49
|
+
white-space: pre-line;
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
@@ -6,6 +6,7 @@ import type { Slot as Slot_V2 } from "vue2/types/v3-setup-context";
|
|
|
6
6
|
import type { ScopedSlot as ScopedSlot_V2 } from "vue2/types/vnode";
|
|
7
7
|
import type { DefineComponent as DefineComponent_V3, HTMLAttributes as HTMLAttributes_V3, ImgHTMLAttributes as ImgHTMLAttributes_V3, Ref as Ref_V3, Slot as Slot_V3, StyleValue as StyleValue_V3, VNodeArrayChildren as VNodeArrayChildren_V3, VNodeChild as VNodeChild_V3, VNode as VNode_V3, WatchOptions as WatchOptions_V3 } from "vue3";
|
|
8
8
|
export * from "vue-demi";
|
|
9
|
+
export type { StyleValue_V2 };
|
|
9
10
|
export type { Data } from "vue2";
|
|
10
11
|
export type { EmitFn } from "vue2/types/v3-setup-context";
|
|
11
12
|
export type { ComponentObjectPropsOptions, ObjectEmitsOptions, PublicProps, SlotsType } from "vue3";
|
|
@@ -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) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AMAP_TO_GCJ02_TIMEOUT } from "../api/contants.js";
|
|
2
2
|
import { lnglat2point } from "../utils/transform.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inChina, inHongkong, inMacau } from "./useMapInChina.js";
|
|
4
4
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
5
5
|
/**
|
|
6
6
|
* @preserve
|
|
@@ -515,7 +515,6 @@ const exported = Object.assign(Object.assign({}, CRSTypes), {
|
|
|
515
515
|
});
|
|
516
516
|
const useAmapGCJ02 = () => {
|
|
517
517
|
const { readyPromise } = useMapSupplier();
|
|
518
|
-
const { inChina } = useMapInChina();
|
|
519
518
|
const toCoordinateType = (p) => {
|
|
520
519
|
return inChina(p) ? "gcj02" : "wgs84";
|
|
521
520
|
};
|
|
@@ -567,7 +566,6 @@ const useAmapGCJ02 = () => {
|
|
|
567
566
|
};
|
|
568
567
|
const useGmapGCJ02 = () => {
|
|
569
568
|
const { readyPromise } = useMapSupplier();
|
|
570
|
-
const { inChina, inHongkong, inMacau } = useMapInChina();
|
|
571
569
|
const toCoordinateType = (p) => {
|
|
572
570
|
return inChina(p) && !inHongkong(p) && !inMacau(p) ? "gcj02" : "wgs84";
|
|
573
571
|
};
|
|
@@ -3,7 +3,7 @@ import { apiGoogleSnapRoad } from "../api/googleSnapRoad.js";
|
|
|
3
3
|
import { watchEffectForDeepOption } from "../utils/compare.js";
|
|
4
4
|
import { lnglat2point, trackPoints2amapGraspRoadPoints } from "../utils/transform.js";
|
|
5
5
|
import { useMapAngle } from "./useMapAngle.js";
|
|
6
|
-
import {
|
|
6
|
+
import { inChina } from "./useMapInChina.js";
|
|
7
7
|
import { useMapSupplier } from "./useMapSupplier.js";
|
|
8
8
|
const GRASP_ROAD_INPUT_MIN_AMOUNT = 2;
|
|
9
9
|
const GRASP_ROAD_INPUT_MAX_AMOUNT = 500;
|
|
@@ -12,7 +12,6 @@ const useAmapGraspRoad = (props) => {
|
|
|
12
12
|
const pathRef = ref([]);
|
|
13
13
|
const angleRef = ref(0);
|
|
14
14
|
const { apiMapComputeHeading } = useMapAngle();
|
|
15
|
-
const { inChina } = useMapInChina();
|
|
16
15
|
const apiMapToGraspRoadPath = (tracks) => {
|
|
17
16
|
return new Promise((resolve) => {
|
|
18
17
|
var _a, _b, _c;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import { type Point } from "../types/interface";
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
inMacau: (point: Point) => boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const useAmapInChina: () => {
|
|
8
|
-
inChina: (point: Point) => boolean;
|
|
9
|
-
inHongkong: (point: Point) => boolean;
|
|
10
|
-
inMacau: (point: Point) => boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const useGmapInChina: () => {
|
|
13
|
-
inChina: (point: Point) => boolean;
|
|
14
|
-
inHongkong: (point: Point) => boolean;
|
|
15
|
-
inMacau: (point: Point) => boolean;
|
|
16
|
-
};
|
|
2
|
+
export declare const inChina: (point: Point) => boolean;
|
|
3
|
+
export declare const inHongkong: (point: Point) => boolean;
|
|
4
|
+
export declare const inMacau: (point: Point) => boolean;
|
|
@@ -2593,22 +2593,17 @@ const macauBounds = [
|
|
|
2593
2593
|
22.19885
|
|
2594
2594
|
]
|
|
2595
2595
|
];
|
|
2596
|
-
const
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
return pointInPolygon(point, macauBounds) >= 0;
|
|
2605
|
-
};
|
|
2606
|
-
return { inChina, inHongkong, inMacau };
|
|
2596
|
+
const inChina = (point) => {
|
|
2597
|
+
return pointInPolygon(point, chinaBounds) >= 0;
|
|
2598
|
+
};
|
|
2599
|
+
const inHongkong = (point) => {
|
|
2600
|
+
return pointInPolygon(point, hongkongBounds) >= 0;
|
|
2601
|
+
};
|
|
2602
|
+
const inMacau = (point) => {
|
|
2603
|
+
return pointInPolygon(point, macauBounds) >= 0;
|
|
2607
2604
|
};
|
|
2608
|
-
const useAmapInChina = useMapInChina;
|
|
2609
|
-
const useGmapInChina = useMapInChina;
|
|
2610
2605
|
export {
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2606
|
+
inChina,
|
|
2607
|
+
inHongkong,
|
|
2608
|
+
inMacau
|
|
2614
2609
|
};
|