@heycar/heycars-map 2.4.6 → 2.5.0

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.
Files changed (52) hide show
  1. package/README.md +25 -9
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/v2/App.js +2 -4
  5. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +11 -6
  6. package/dist/v2/Demo/DemoBusinessReselectPlace.js +10 -5
  7. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
  8. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  10. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +1 -1
  11. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +17 -10
  12. package/dist/v2/business-components/GreenZone/GreenZone.d.ts +1 -0
  13. package/dist/v2/business-components/GreenZone/GreenZone.js +7 -5
  14. package/dist/v2/chunks/{BusinessRecomendPlaceMap.81a4b640.js → BusinessRecomendPlaceMap.d8f5b904.js} +18 -9
  15. package/dist/v2/components/MapProvider/MapProvider.js +13 -14
  16. package/dist/v2/hooks/useMapCoordinatify.js +6 -4
  17. package/dist/v2/hooks/useMapRecomendPlace.d.ts +3 -3
  18. package/dist/v2/hooks/useMapRecomendPlace.js +50 -40
  19. package/dist/v2/hooks/useMapSupplier.d.ts +1 -1
  20. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  21. package/dist/v2/index.js +1 -1
  22. package/dist/v2/types/gmap.d.ts +10 -0
  23. package/dist/v2/types/interface.d.ts +6 -3
  24. package/dist/v2/utils/log.js +1 -1
  25. package/dist/v2/utils/transform.js +1 -1
  26. package/dist/v2/utils/typeChecking.d.ts +5 -2
  27. package/dist/v2/utils/typeChecking.js +32 -4
  28. package/dist/v3/App.js +2 -4
  29. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +11 -6
  30. package/dist/v3/Demo/DemoBusinessReselectPlace.js +10 -5
  31. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
  32. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
  33. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  34. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +1 -1
  35. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +17 -10
  36. package/dist/v3/business-components/GreenZone/GreenZone.d.ts +1 -0
  37. package/dist/v3/business-components/GreenZone/GreenZone.js +7 -5
  38. package/dist/v3/chunks/{BusinessRecomendPlaceMap.7133beea.js → BusinessRecomendPlaceMap.4c38b1fb.js} +18 -9
  39. package/dist/v3/components/MapProvider/MapProvider.js +13 -14
  40. package/dist/v3/hooks/useMapCoordinatify.js +6 -4
  41. package/dist/v3/hooks/useMapRecomendPlace.d.ts +3 -3
  42. package/dist/v3/hooks/useMapRecomendPlace.js +50 -40
  43. package/dist/v3/hooks/useMapSupplier.d.ts +1 -1
  44. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  45. package/dist/v3/index.js +1 -1
  46. package/dist/v3/types/gmap.d.ts +10 -0
  47. package/dist/v3/types/interface.d.ts +6 -3
  48. package/dist/v3/utils/log.js +1 -1
  49. package/dist/v3/utils/transform.js +1 -1
  50. package/dist/v3/utils/typeChecking.d.ts +5 -2
  51. package/dist/v3/utils/typeChecking.js +32 -4
  52. package/package.json +1 -1
@@ -21,7 +21,7 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
21
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.7133beea.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.4c38b1fb.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";
@@ -108,7 +108,10 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
108
108
  var _a;
109
109
  centerSource.source = "api";
110
110
  const place = unCoordinatifyPlace(toCoordinatePlaceType(inputPlace));
111
- const recommends = unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(inputRecommends));
111
+ const recommends = unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType({
112
+ ...inputRecommends,
113
+ type: "Restricted"
114
+ }));
112
115
  const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
113
116
  if (!isSameZone)
114
117
  setFitZoom((_a = recommends.zone) == null ? void 0 : _a.path);
@@ -132,7 +135,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
132
135
  inputPlace: {
133
136
  ...place
134
137
  },
135
- isInZone: !!zoneRef.value,
138
+ type: recommendTypeRef.value,
136
139
  isSameZone: !!zoneRef.value
137
140
  }));
138
141
  };
@@ -191,6 +194,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
191
194
  setPlaceCandidatesAndZone,
192
195
  placeCandidates,
193
196
  zoneRef,
197
+ recommendTypeRef,
194
198
  availableRef,
195
199
  isQueryingRef
196
200
  } = useMapRecomendPlace({
@@ -222,7 +226,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
222
226
  onChange: ({
223
227
  place,
224
228
  inputPlace,
225
- isInZone,
229
+ type,
226
230
  isSameZone
227
231
  }) => {
228
232
  var _a;
@@ -232,12 +236,12 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
232
236
  equalAssign(centerPlace, {
233
237
  ...place
234
238
  });
235
- if (isInZone && !isSameZone)
239
+ if (type === "Restricted" && !isSameZone)
236
240
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path);
237
241
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
238
242
  place,
239
243
  inputPlace,
240
- isInZone,
244
+ type,
241
245
  isSameZone
242
246
  }));
243
247
  }
@@ -256,7 +260,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
256
260
  flush: "post"
257
261
  });
258
262
  watchEffect(() => {
259
- mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
263
+ mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value || recommendTypeRef.value === "Forbidden" ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
260
264
  });
261
265
  onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
262
266
  return () => {
@@ -264,12 +268,14 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
264
268
  const {
265
269
  recomendDescription,
266
270
  unavailableTitle,
271
+ forbiddenTitle,
267
272
  renderPlacePhoto,
268
273
  renderPlaceTag
269
274
  } = props;
275
+ const isForbidden = recommendTypeRef.value === "Forbidden";
270
276
  const isElected = isPlacesInclude(placeCandidates.value, centerPlace);
271
- const title = !availableRef.value ? unavailableTitle : centerPlace.displayName;
272
- const description = !availableRef.value ? void 0 : isElected ? (_a = renderPlaceTag == null ? void 0 : renderPlaceTag(centerPlace)) != null ? _a : recomendDescription : void 0;
277
+ const title = centerPlace.displayName;
278
+ const description = !availableRef.value ? unavailableTitle : isForbidden ? forbiddenTitle : isElected ? (_a = renderPlaceTag == null ? void 0 : renderPlaceTag(centerPlace)) != null ? _a : recomendDescription : void 0;
273
279
  return createVNode(HeycarMap, {
274
280
  "class": attrs.class,
275
281
  "style": attrs.style,
@@ -293,6 +299,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
293
299
  default: () => {
294
300
  var _a2, _b;
295
301
  return [((_a2 = zoneRef.value) == null ? void 0 : _a2.path.length) && createVNode(GreenZone, {
302
+ "isRed": isForbidden,
296
303
  "path": (_b = zoneRef.value) == null ? void 0 : _b.path
297
304
  }, null), !geoLoading.value && !geoError.value && createVNode(DeviceOrientation, {
298
305
  "elementRef": mapElementRef,
@@ -331,7 +338,7 @@ const BusinessReselectPlaceMap = defineLagecySetup("BusinessReselectPlaceMap", f
331
338
  key: `${payload.supplier}${instanceNo}`,
332
339
  on: generateCreateElementV2PropsOn(props, emit, ["changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
333
340
  });
334
- }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "disableLocator", "getAvailable", "getRecomendPlace", "renderPlacePhoto", "renderPlaceTag", "mapContext"]);
341
+ }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "forbiddenTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "disableLocator", "getAvailable", "getRecomendPlace", "renderPlacePhoto", "renderPlaceTag", "mapContext"]);
335
342
  export {
336
343
  BusinessReselectPlaceMap,
337
344
  BusinessReselectPlaceMapInner
@@ -1,6 +1,7 @@
1
1
  import type { GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
2
2
  import type { Point } from "../../types/interface";
3
3
  interface GreenZoneProps<T> extends MapRegisterOverlayProps<T> {
4
+ isRed?: boolean;
4
5
  path: Point[];
5
6
  }
6
7
  export declare const AGreenZone: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<GreenZoneProps<{
@@ -12,6 +12,8 @@ const GREEN_ZONE_FILL_COLOR = "#C7E5FB";
12
12
  const GREEN_ZONE_FILL_OPACITY = 0.5;
13
13
  const GREEN_ZONE_STROKE_COLOR = "#4BA7FF";
14
14
  const GREEN_ZONE_STROKE_WEIGHT_VW = 1;
15
+ const GREEN_ZONE_FILL_COLOR_RED = "#F27878";
16
+ const GREEN_ZONE_STROKE_COLOR_RED = "#F41717";
15
17
  const toClosedPath = (path) => {
16
18
  const first = path[0];
17
19
  if (!first)
@@ -27,10 +29,10 @@ const AGreenZone = defineSetup("AGreenZone", function(props) {
27
29
  return createVNode(AmapPolygon, {
28
30
  "registerOverlay": props.registerOverlay,
29
31
  "path": props.path,
30
- "strokeColor": GREEN_ZONE_STROKE_COLOR,
32
+ "strokeColor": props.isRed ? GREEN_ZONE_STROKE_COLOR_RED : GREEN_ZONE_STROKE_COLOR,
31
33
  "strokeStyle": "dashed",
32
34
  "strokeWeight": strokeWeight,
33
- "fillColor": GREEN_ZONE_FILL_COLOR,
35
+ "fillColor": props.isRed ? GREEN_ZONE_FILL_COLOR_RED : GREEN_ZONE_FILL_COLOR,
34
36
  "fillOpacity": GREEN_ZONE_FILL_OPACITY,
35
37
  "zIndex": ZINDEX_GREEN_ZONE
36
38
  }, null);
@@ -50,15 +52,15 @@ const GGreenZone = defineSetup("GGreenZone", function(props) {
50
52
  return createVNode("div", null, [createVNode(GmapPolygon, {
51
53
  "registerOverlay": props.registerOverlay,
52
54
  "paths": path,
53
- "strokeColor": GREEN_ZONE_STROKE_COLOR,
55
+ "strokeColor": props.isRed ? GREEN_ZONE_STROKE_COLOR_RED : GREEN_ZONE_STROKE_COLOR,
54
56
  "strokeOpacity": 0,
55
57
  "strokeWeight": strokeWeight,
56
- "fillColor": GREEN_ZONE_FILL_COLOR,
58
+ "fillColor": props.isRed ? GREEN_ZONE_FILL_COLOR_RED : GREEN_ZONE_FILL_COLOR,
57
59
  "fillOpacity": GREEN_ZONE_FILL_OPACITY,
58
60
  "zIndex": ZINDEX_GREEN_ZONE
59
61
  }, null), createVNode(GmapPolyline, {
60
62
  "path": closedPath,
61
- "strokeColor": GREEN_ZONE_STROKE_COLOR,
63
+ "strokeColor": props.isRed ? GREEN_ZONE_STROKE_COLOR_RED : GREEN_ZONE_STROKE_COLOR,
62
64
  "strokeWeight": GREEN_ZONE_STROKE_WEIGHT_VW,
63
65
  "strokeOpacity": 0,
64
66
  "icons": [{
@@ -360,7 +360,10 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
360
360
  var _a;
361
361
  centerSource.source = "api";
362
362
  const place = unCoordinatifyPlace(toCoordinatePlaceType(inputPlace));
363
- const recommends = unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType(inputRecommends));
363
+ const recommends = unCoordinatifyRecommendZonePlaces(toCoordinateRecommendZonePlacesType({
364
+ ...inputRecommends,
365
+ type: "Restricted"
366
+ }));
364
367
  const isSameZone = recommends.zone && isZoneEqual(recommends.zone, zoneRef.value);
365
368
  if (!isSameZone)
366
369
  setFitZoom((_a = recommends.zone) == null ? void 0 : _a.path, place2point(place));
@@ -384,7 +387,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
384
387
  inputPlace: {
385
388
  ...place
386
389
  },
387
- isInZone: !!zoneRef.value,
390
+ type: recommendTypeRef.value,
388
391
  isSameZone: !!zoneRef.value
389
392
  }));
390
393
  };
@@ -465,6 +468,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
465
468
  setPlaceCandidatesAndZone,
466
469
  placeCandidates,
467
470
  zoneRef,
471
+ recommendTypeRef,
468
472
  availableRef,
469
473
  isQueryingRef
470
474
  } = useMapRecomendPlace({
@@ -496,7 +500,8 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
496
500
  onChange: ({
497
501
  place,
498
502
  inputPlace,
499
- isInZone,
503
+ type,
504
+ zone,
500
505
  isSameZone
501
506
  }) => {
502
507
  var _a;
@@ -506,17 +511,18 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
506
511
  equalAssign(centerPlace, {
507
512
  ...place
508
513
  });
509
- if (isInZone && !isSameZone)
514
+ if (type === "Restricted" && !isSameZone)
510
515
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path, place2point(place));
511
516
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
512
517
  place,
513
518
  inputPlace,
514
- isInZone,
519
+ type,
520
+ zone,
515
521
  isSameZone
516
522
  }));
517
523
  }
518
524
  });
519
- const centerPlaceStatusRef = computed(() => isFirstLoad && geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK);
525
+ const centerPlaceStatusRef = computed(() => isFirstLoad && geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value || recommendTypeRef.value === "Forbidden" ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK);
520
526
  const handleResize = pipeDefer(() => {
521
527
  var _a;
522
528
  return zoomRef.value && setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path, void 0, true);
@@ -548,13 +554,15 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
548
554
  geoLoadingTitle: geoLoadingTitle2,
549
555
  recomendDescription,
550
556
  unavailableTitle,
557
+ forbiddenTitle,
551
558
  disableLocator,
552
559
  renderPlacePhoto,
553
560
  renderPlaceTag
554
561
  } = props;
562
+ const isForbidden = recommendTypeRef.value === "Forbidden";
555
563
  const isElected = isPlacesInclude(placeCandidates.value, centerPlace);
556
- const title = isFirstLoad && geoLoading.value ? geoLoadingTitle2 : !availableRef.value ? unavailableTitle : centerPlace.displayName;
557
- const description = !availableRef.value ? void 0 : isElected ? (_a = renderPlaceTag == null ? void 0 : renderPlaceTag(centerPlace)) != null ? _a : recomendDescription : void 0;
564
+ const title = isFirstLoad && geoLoading.value ? geoLoadingTitle2 : centerPlace.displayName;
565
+ const description = !availableRef.value ? unavailableTitle : isForbidden ? forbiddenTitle : isElected ? (_a = renderPlaceTag == null ? void 0 : renderPlaceTag(centerPlace)) != null ? _a : recomendDescription : void 0;
558
566
  return createVNode(HeycarMap, {
559
567
  "class": attrs.class,
560
568
  "style": attrs.style,
@@ -578,6 +586,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
578
586
  default: () => {
579
587
  var _a2, _b;
580
588
  return [((_a2 = zoneRef.value) == null ? void 0 : _a2.path.length) && createVNode(GreenZone, {
589
+ "isRed": isForbidden,
581
590
  "path": (_b = zoneRef.value) == null ? void 0 : _b.path
582
591
  }, null), !geoLoading.value && !geoError.value && createVNode(DeviceOrientation, {
583
592
  "elementRef": mapElementRef,
@@ -617,7 +626,7 @@ const BusinessRecomendPlaceMap = defineLagecySetup("BusinessRecomendPlaceMap", f
617
626
  key: `${payload.supplier}${instanceNo}`,
618
627
  on: generateCreateElementV2PropsOn(props, emit, ["loadGeoLocation", "loadDefaultGeoLocation", "changeByDrag", "changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
619
628
  });
620
- }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "recomendDescription", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
629
+ }).props(["log", "geoLoadingTitle", "emptyTitle", "queryingTitle", "defaultCenterPlace", "geoErrorOnceNotificationKey", "unavailableTitle", "forbiddenTitle", "recomendDescription", "disableLocator", "fallback", "getRecomendPlace", "getAvailable", "renderPlacePhoto", "renderPlaceTag", "loading", "mapContext"]);
621
630
  export {
622
631
  BusinessRecomendPlaceMap as B,
623
632
  DEFAULT_ZOOM as D,
@@ -83,7 +83,6 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
83
83
  const {
84
84
  supplier,
85
85
  gmapId,
86
- gmapRasterId,
87
86
  language = "zh",
88
87
  status,
89
88
  pingStatus
@@ -110,26 +109,27 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
110
109
  }
111
110
  const children = (_e = slots.default) == null ? void 0 : _e.call(slots);
112
111
  const outArea = (_f = slots.outerArea) == null ? void 0 : _f.call(slots);
113
- const mapId = patchGmapIdForAlipayCompatible({
114
- gmapId,
115
- gmapRasterId,
116
- touchEnable,
117
- touchZoomCenter
118
- });
119
112
  switch (supplier) {
120
- case "gmap":
113
+ case "gmap": {
114
+ const renderingType = compatibleGmapRenderingType({
115
+ touchEnable,
116
+ touchZoomCenter
117
+ });
121
118
  return createVNode("div", {
122
119
  "class": `${heycarMap} ${(_g = attrs.class) != null ? _g : ""}`,
123
120
  "lang": language,
124
121
  "style": attrs.style
125
122
  }, [createVNode(Gmap, {
126
123
  "mapRef": setMap,
127
- "mapId": mapId,
124
+ "mapId": gmapId,
125
+ "renderingType": renderingType,
128
126
  "center": center ? vec2lnglat(center) : void 0,
129
127
  "zoom": zoom,
130
128
  "disableDefaultUI": true,
131
129
  "clickableIcons": false,
132
130
  "disableDoubleClickZoom": !touchEnable,
131
+ "headingInteractionEnabled": false,
132
+ "tiltInteractionEnabled": false,
133
133
  "gestureHandling": touchEnable ? "greedy" : "none",
134
134
  "keyboardShortcuts": touchEnable,
135
135
  "touchZoomCenter": touchZoomCenter,
@@ -142,6 +142,7 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
142
142
  "class": heycarGmapBackgroundDefaultLoadingImage,
143
143
  "src": imgGrid
144
144
  }, null), outArea]);
145
+ }
145
146
  default:
146
147
  return createVNode("div", {
147
148
  "class": `${heycarMap} ${(_h = attrs.class) != null ? _h : ""}`,
@@ -169,18 +170,16 @@ const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
169
170
  }
170
171
  };
171
172
  }).props(["center", "fallback", "loading", "outerArea", "mapRef", "zoom", "touchEnable", "touchZoomCenter"]);
172
- function patchGmapIdForAlipayCompatible(props) {
173
+ function compatibleGmapRenderingType(props) {
173
174
  const {
174
- gmapId,
175
- gmapRasterId,
176
175
  touchEnable,
177
176
  touchZoomCenter
178
177
  } = props;
179
178
  const os = detectOSPlatform();
180
179
  const platform = detectBrowserPlatform();
181
180
  if (os !== OS_PLATFORM.ANDROID || platform !== BRWOSER_PLATFORM.ALIPAY_MINIPROGRAM)
182
- return gmapId;
183
- return touchEnable && !touchZoomCenter ? gmapRasterId : gmapId;
181
+ return google.maps.RenderingType.VECTOR;
182
+ return touchEnable && !touchZoomCenter ? google.maps.RenderingType.RASTER : google.maps.RenderingType.VECTOR;
184
183
  }
185
184
  export {
186
185
  HeycarMap,
@@ -52,19 +52,21 @@ function useMapCoordinatify() {
52
52
  };
53
53
  };
54
54
  const coordinatifyValueOfOnChangeRecommendPlace = (value) => {
55
- const { place, inputPlace } = value;
55
+ const { place, inputPlace, zone } = value;
56
56
  return {
57
57
  ...value,
58
58
  place: coordinatifyPlace(place),
59
- inputPlace: coordinatifyPlace(inputPlace)
59
+ inputPlace: coordinatifyPlace(inputPlace),
60
+ zone: zone ? coordinatifyZone(zone) : void 0
60
61
  };
61
62
  };
62
63
  const unCoordinatifyValueOfOnChangeRecommendPlace = (value) => {
63
- const { place, inputPlace } = value;
64
+ const { place, inputPlace, zone } = value;
64
65
  return {
65
66
  ...value,
66
67
  place: unCoordinatifyPlace(place),
67
- inputPlace: unCoordinatifyPlace(inputPlace)
68
+ inputPlace: unCoordinatifyPlace(inputPlace),
69
+ zone: zone ? unCoordinatifyZone(zone) : void 0
68
70
  };
69
71
  };
70
72
  const unCoordinatifyTrackPoint = (value) => {
@@ -1,4 +1,4 @@
1
- import type { Place, Point, RecommendZonePlaces, ValueOfOnChangeRecommendPlace, Zone } from "../types/interface";
1
+ import type { Place, Point, RecommendType, RecommendZonePlaces, ValueOfOnChangeRecommendPlace, Zone } from "../types/interface";
2
2
  import { type AbortSignalOption } from "../utils/helper";
3
3
  import { type UseMapPlaceProps } from "./useMapPlace";
4
4
  export interface UseMapRecomendPlaceProps<C = Record<string, any>> {
@@ -29,12 +29,12 @@ export declare const useMapRecomendPlace: <C>(props: UseMapRecomendPlaceProps<C>
29
29
  displayName: string;
30
30
  }[]>;
31
31
  availableRef: import("vue-demi").Ref<boolean>;
32
- forceRef: import("vue-demi").Ref<boolean>;
32
+ recommendTypeRef: import("vue-demi").Ref<RecommendType>;
33
33
  isQueryingRef: import("vue-demi").Ref<boolean>;
34
34
  updateRecommendPlace: (place: Place, opt?: AbortSignalOption) => Promise<void>;
35
35
  updateRecommendPlaceOnlyInZone: (place: Place, opt?: AbortSignalOption) => Promise<void>;
36
36
  updatePlaceCandidates: (place: Place, opt?: AbortSignalOption) => Promise<ValueOfOnChangeRecommendPlace>;
37
37
  updatePlace: (point: Point) => Promise<void>;
38
38
  abortUpdatePlace: () => void;
39
- setPlaceCandidatesAndZone: ({ zone, places: placeCandidates }: RecommendZonePlaces) => void;
39
+ setPlaceCandidatesAndZone: ({ type, zone, places: placeCandidates, }: RecommendZonePlaces) => void;
40
40
  };
@@ -3,8 +3,10 @@ import { GET_RECOMMEND_PLACE_TIMEOUT } from "../api/contants.js";
3
3
  import { logNoneManualAbortError } from "../utils/ManualAbortError.js";
4
4
  import { createAbortableOneConcurrent, AbortSignalAny, equalAssign, isPlacesInclude, createAbortable } from "../utils/helper.js";
5
5
  import { isZoneEqual, place2point, isPlaceEqual, businessCandidatesToAdsorptionPlace } from "../utils/transform.js";
6
+ import { assertNoConflictTypeAndZone } from "../utils/typeChecking.js";
6
7
  import { useMapGeometry, apiLocalIsPointInRing } from "./useMapGeometry.js";
7
8
  import { useMapPlace } from "./useMapPlace.js";
9
+ const DEFAULT_RECOMMEND_TYPE = "Recommend";
8
10
  function mergeGetRecommendPlaceAndGetAvailable(getRecomendPlace, getAvailable, timeout) {
9
11
  return function mergedGetRecommendPlace(place, context) {
10
12
  const available = true;
@@ -49,7 +51,7 @@ const useMapRecomendPlace = (props) => {
49
51
  onChangePlace
50
52
  } = props;
51
53
  const availableRef = ref(true);
52
- const forceRef = ref(false);
54
+ const recommendTypeRef = ref(DEFAULT_RECOMMEND_TYPE);
53
55
  const placeCandidatesRef = ref([]);
54
56
  const zoneRef = ref();
55
57
  const abortable = createAbortable(inputSignal);
@@ -77,16 +79,16 @@ const useMapRecomendPlace = (props) => {
77
79
  places: placeCandidates,
78
80
  zone,
79
81
  available = false,
80
- force = false,
82
+ type = DEFAULT_RECOMMEND_TYPE,
81
83
  adsorption = false
82
84
  } = await getRecomendPlaceNoFail({ ...place }, context);
83
85
  (_a = opt == null ? void 0 : opt.signal) == null ? void 0 : _a.throwIfAborted();
84
- if (!available || !placeCandidates) {
85
- return { place: { ...place }, zone, candidates: [], available, force };
86
+ if (!available || !placeCandidates || placeCandidates.length === 0) {
87
+ return { place: { ...place }, zone, candidates: [], available, type };
86
88
  }
87
89
  if (!zone) {
88
90
  const resultPlace2 = adsorption ? businessCandidatesToAdsorptionPlace(placeCandidates) : place;
89
- return { place: { ...resultPlace2 }, zone, candidates: placeCandidates, available, force };
91
+ return { place: { ...resultPlace2 }, zone, candidates: placeCandidates, available, type };
90
92
  }
91
93
  const { shortestPlace, shortestDistance } = findNearestPlace(
92
94
  place,
@@ -95,42 +97,41 @@ const useMapRecomendPlace = (props) => {
95
97
  );
96
98
  const limit = getLimit(context);
97
99
  const resultPlace = zone || shortestDistance <= limit ? shortestPlace : place;
98
- return { place: { ...resultPlace }, zone, candidates: placeCandidates, available, force };
100
+ return { place: { ...resultPlace }, zone, candidates: placeCandidates, available, type };
99
101
  };
100
102
  const getRecommendPlaceZoneState = async (point, prevState, opt) => {
101
103
  const [lng, lat] = point;
102
- const zone = zoneRef.value;
104
+ const { type, zone, available, candidates } = prevState;
103
105
  if (!zone || !apiLocalIsPointInRing(point, zone.path)) {
104
106
  const reGeoPlacePromise = getPlaceByRegeo(point, opt);
105
107
  const {
106
108
  place: closestPlace,
107
- candidates,
108
- available,
109
- force,
109
+ candidates: candidates2,
110
+ available: available2,
111
+ type: type2,
110
112
  zone: zone2
111
113
  } = await findAttachedPlace({ lng, lat, name: "", displayName: "" }, opt);
112
- if (isPlacesInclude(candidates, closestPlace)) {
113
- return { place: { ...closestPlace }, zone: zone2, available, candidates, force };
114
+ if (isPlacesInclude(candidates2, closestPlace)) {
115
+ return { place: { ...closestPlace }, zone: zone2, available: available2, candidates: candidates2, type: type2 };
114
116
  }
115
117
  const regeoPlace = await reGeoPlacePromise;
116
- return { place: { ...regeoPlace }, zone: zone2, available, candidates, force };
118
+ return { place: { ...regeoPlace }, zone: zone2, available: available2, candidates: candidates2, type: type2 };
119
+ }
120
+ if (type === "Forbidden") {
121
+ const regeoPlace = await getPlaceByRegeo(point, opt);
122
+ return { place: { ...regeoPlace }, zone, available, candidates, type };
117
123
  }
118
124
  const { shortestPlace: resultPlace } = findNearestPlace(
119
125
  { lng, lat, name: "", displayName: "" },
120
- prevState.candidates,
126
+ candidates,
121
127
  apiMapDistance
122
128
  );
123
- return {
124
- place: { ...resultPlace },
125
- zone,
126
- available: prevState.available,
127
- force: prevState.force,
128
- candidates: prevState.candidates
129
- };
129
+ return { place: { ...resultPlace }, zone, type, available, candidates };
130
130
  };
131
131
  const updateIntermediateQueryingState = (point) => {
132
+ const type = recommendTypeRef.value;
132
133
  const zone = zoneRef.value;
133
- if (zone && apiLocalIsPointInRing(point, zone.path))
134
+ if (type === "Restricted" && zone && apiLocalIsPointInRing(point, zone.path))
134
135
  return;
135
136
  const [lng, lat] = point;
136
137
  const intermediateQueryingPlace = {
@@ -141,8 +142,10 @@ const useMapRecomendPlace = (props) => {
141
142
  };
142
143
  isQueryingRef.value = true;
143
144
  availableRef.value = true;
144
- if (zone)
145
+ if (type === "Restricted" || type === "Forbidden" && (!zone || !apiLocalIsPointInRing(point, zone.path))) {
145
146
  zoneRef.value = void 0;
147
+ recommendTypeRef.value = "Recommend";
148
+ }
146
149
  placeCandidatesRef.value = [];
147
150
  equalAssign(recomendPlace, { ...intermediateQueryingPlace });
148
151
  onQueryingPlace == null ? void 0 : onQueryingPlace({ ...intermediateQueryingPlace });
@@ -156,13 +159,13 @@ const useMapRecomendPlace = (props) => {
156
159
  candidates,
157
160
  zone,
158
161
  available,
159
- force
162
+ type
160
163
  } = await getRecommendPlaceZoneState(
161
164
  point,
162
165
  {
163
166
  place: recomendPlace,
164
167
  available: availableRef.value,
165
- force: forceRef.value,
168
+ type: recommendTypeRef.value,
166
169
  candidates: placeCandidatesRef.value,
167
170
  zone: zoneRef.value
168
171
  },
@@ -171,13 +174,13 @@ const useMapRecomendPlace = (props) => {
171
174
  const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
172
175
  isQueryingRef.value = false;
173
176
  availableRef.value = available;
174
- forceRef.value = force;
177
+ recommendTypeRef.value = type;
175
178
  zoneRef.value = zone;
176
179
  placeCandidatesRef.value = candidates;
177
180
  equalAssign(recomendPlace, { ...resultPlace });
178
181
  onChangePlace == null ? void 0 : onChangePlace({ ...resultPlace });
179
182
  const inputPlace = { name: "", displayName: "", lng: point[0], lat: point[1] };
180
- onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace, isInZone: !!zone, isSameZone });
183
+ onChange == null ? void 0 : onChange({ place: { ...resultPlace }, inputPlace, type, zone, isSameZone });
181
184
  },
182
185
  { silent: true }
183
186
  );
@@ -188,19 +191,19 @@ const useMapRecomendPlace = (props) => {
188
191
  places: placeCandidates,
189
192
  zone,
190
193
  available = false,
191
- force = false
194
+ type = DEFAULT_RECOMMEND_TYPE
192
195
  } = await getRecomendPlaceNoFail({ ...place }, context);
193
196
  signal.throwIfAborted();
194
197
  const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
195
198
  isQueryingRef.value = false;
196
199
  availableRef.value = !!available;
197
- forceRef.value = !!force;
200
+ recommendTypeRef.value = type;
198
201
  zoneRef.value = zone;
199
202
  placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
200
203
  return {
201
204
  inputPlace: { ...place },
202
- isInZone: !!zone,
203
205
  place: { ...place },
206
+ type,
204
207
  isSameZone
205
208
  };
206
209
  };
@@ -210,13 +213,13 @@ const useMapRecomendPlace = (props) => {
210
213
  place: resultPlace,
211
214
  candidates,
212
215
  available,
213
- force,
216
+ type,
214
217
  zone
215
218
  } = await findAttachedPlace(place, opt);
216
219
  const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
217
220
  isQueryingRef.value = false;
218
221
  availableRef.value = available;
219
- forceRef.value = force;
222
+ recommendTypeRef.value = type;
220
223
  zoneRef.value = zone;
221
224
  placeCandidatesRef.value = candidates;
222
225
  equalAssign(recomendPlace, { ...resultPlace });
@@ -224,7 +227,8 @@ const useMapRecomendPlace = (props) => {
224
227
  onChange == null ? void 0 : onChange({
225
228
  place: { ...resultPlace },
226
229
  inputPlace: { ...place },
227
- isInZone: !!zone,
230
+ type,
231
+ zone,
228
232
  isSameZone
229
233
  });
230
234
  };
@@ -235,14 +239,14 @@ const useMapRecomendPlace = (props) => {
235
239
  place: foundPlace,
236
240
  candidates,
237
241
  available,
238
- force,
242
+ type,
239
243
  zone
240
244
  } = await findAttachedPlace(place, opt);
241
- const resultPlace = zone ? foundPlace : (_a = candidates.find((p) => isPlaceEqual(p, place))) != null ? _a : place;
245
+ const resultPlace = type === "Restricted" ? foundPlace : (_a = candidates.find((p) => isPlaceEqual(p, place))) != null ? _a : place;
242
246
  const isSameZone = !!zone && isZoneEqual(zone, zoneRef.value);
243
247
  isQueryingRef.value = false;
244
248
  availableRef.value = available;
245
- forceRef.value = force;
249
+ recommendTypeRef.value = type;
246
250
  zoneRef.value = zone;
247
251
  placeCandidatesRef.value = candidates;
248
252
  equalAssign(recomendPlace, { ...resultPlace });
@@ -250,13 +254,19 @@ const useMapRecomendPlace = (props) => {
250
254
  onChange == null ? void 0 : onChange({
251
255
  place: { ...resultPlace },
252
256
  inputPlace: { ...place },
253
- isInZone: !!zone,
257
+ type,
258
+ zone,
254
259
  isSameZone
255
260
  });
256
261
  };
257
- const setPlaceCandidatesAndZone = ({ zone, places: placeCandidates }) => {
262
+ const setPlaceCandidatesAndZone = ({
263
+ type = DEFAULT_RECOMMEND_TYPE,
264
+ zone,
265
+ places: placeCandidates
266
+ }) => {
267
+ assertNoConflictTypeAndZone(type, zone);
258
268
  availableRef.value = true;
259
- forceRef.value = !!zone;
269
+ recommendTypeRef.value = type;
260
270
  zoneRef.value = zone ? zone : void 0;
261
271
  placeCandidatesRef.value = placeCandidates != null ? placeCandidates : [];
262
272
  };
@@ -265,7 +275,7 @@ const useMapRecomendPlace = (props) => {
265
275
  recomendPlace,
266
276
  placeCandidates: placeCandidatesRef,
267
277
  availableRef,
268
- forceRef,
278
+ recommendTypeRef,
269
279
  isQueryingRef,
270
280
  updateRecommendPlace,
271
281
  updateRecommendPlaceOnlyInZone,
@@ -2,7 +2,7 @@ import type { AnyFn } from "@vueuse/core";
2
2
  import type { ConnectionStatus } from "../types/interface";
3
3
  import type { Status, UseMapLoaderOutput, UseMapLoaderProps } from "./useMapLoader";
4
4
  export interface MapSupplierPayolad extends UseMapLoaderProps {
5
- gmapRasterId: string;
5
+ gmapRasterId?: string;
6
6
  gmapId: string;
7
7
  readyPromise: UseMapLoaderOutput["readyPromise"];
8
8
  status: Status;
@@ -1,5 +1,5 @@
1
1
  import { reactive, ref, readonly } from "vue-demi";
2
- import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.7133beea.js";
2
+ import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.4c38b1fb.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
@@ -3,7 +3,7 @@ import { isCoordinatePointEqual } from "./api/geometry.js";
3
3
  import { AbsoluteAddressBox } from "./business-components/AbsoluteAddressBox/AbsoluteAddressBox.js";
4
4
  import { AddressBox } from "./business-components/AddressBox/AddressBox.js";
5
5
  import { BusinessQuotingMap } from "./business-components/BusinessQuotingMap/BusinessQuotingMap.js";
6
- import { B } from "./chunks/BusinessRecomendPlaceMap.7133beea.js";
6
+ import { B } from "./chunks/BusinessRecomendPlaceMap.4c38b1fb.js";
7
7
  import { BusinessReselectPlaceMap } from "./business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js";
8
8
  import { BusinessTaxiEndMap } from "./business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
9
9
  import { BusinessTaxiServiceMap } from "./business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js";
@@ -1 +1,11 @@
1
+ /// <reference types="google.maps" />
2
+ declare global {
3
+ namespace google.maps {
4
+ interface MapOptions {
5
+ headingInteractionEnabled?: boolean;
6
+ tiltInteractionEnabled?: boolean;
7
+ renderingType?: RenderingType;
8
+ }
9
+ }
10
+ }
1
11
  export type GmapGeocoderAddressComponentType = "street_number" | "street_address" | "route" | "intersection" | "political" | "country" | "administrative_area_level_1" | "administrative_area_level_2" | "administrative_area_level_3" | "administrative_area_level_4" | "administrative_area_level_5" | "administrative_area_level_6" | "administrative_area_level_7" | "colloquial_area" | "locality" | "sublocality" | "neighborhood" | "premise" | "subpremise" | "plus_code" | "postal_code" | "natural_feature" | "airport" | "park" | "point_of_interest";