@heycar/heycars-map 2.4.6 → 2.5.1

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 (60) hide show
  1. package/README.md +26 -8
  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 +19 -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 +55 -43
  19. package/dist/v2/hooks/useMapSupplier.d.ts +1 -1
  20. package/dist/v2/hooks/useMapSupplier.js +0 -1
  21. package/dist/v2/hooks/useWalkingRoute.js +6 -0
  22. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  23. package/dist/v2/index.js +1 -1
  24. package/dist/v2/types/gmap.d.ts +10 -0
  25. package/dist/v2/types/interface.d.ts +6 -3
  26. package/dist/v2/utils/ManualAbortError.d.ts +3 -0
  27. package/dist/v2/utils/ManualAbortError.js +22 -0
  28. package/dist/v2/utils/log.js +1 -1
  29. package/dist/v2/utils/transform.js +1 -1
  30. package/dist/v2/utils/typeChecking.d.ts +5 -2
  31. package/dist/v2/utils/typeChecking.js +32 -4
  32. package/dist/v3/App.js +2 -4
  33. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +11 -6
  34. package/dist/v3/Demo/DemoBusinessReselectPlace.js +10 -5
  35. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
  36. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +1 -1
  37. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  38. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.d.ts +1 -1
  39. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +19 -10
  40. package/dist/v3/business-components/GreenZone/GreenZone.d.ts +1 -0
  41. package/dist/v3/business-components/GreenZone/GreenZone.js +7 -5
  42. package/dist/v3/chunks/{BusinessRecomendPlaceMap.7133beea.js → BusinessRecomendPlaceMap.4c38b1fb.js} +18 -9
  43. package/dist/v3/components/MapProvider/MapProvider.js +13 -14
  44. package/dist/v3/hooks/useMapCoordinatify.js +6 -4
  45. package/dist/v3/hooks/useMapRecomendPlace.d.ts +3 -3
  46. package/dist/v3/hooks/useMapRecomendPlace.js +55 -43
  47. package/dist/v3/hooks/useMapSupplier.d.ts +1 -1
  48. package/dist/v3/hooks/useMapSupplier.js +0 -1
  49. package/dist/v3/hooks/useWalkingRoute.js +6 -0
  50. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  51. package/dist/v3/index.js +1 -1
  52. package/dist/v3/types/gmap.d.ts +10 -0
  53. package/dist/v3/types/interface.d.ts +6 -3
  54. package/dist/v3/utils/ManualAbortError.d.ts +3 -0
  55. package/dist/v3/utils/ManualAbortError.js +22 -0
  56. package/dist/v3/utils/log.js +1 -1
  57. package/dist/v3/utils/transform.js +1 -1
  58. package/dist/v3/utils/typeChecking.d.ts +5 -2
  59. package/dist/v3/utils/typeChecking.js +32 -4
  60. package/package.json +1 -1
@@ -12,7 +12,8 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
12
12
  await new Promise((r) => setTimeout(r, 3e3));
13
13
  return {
14
14
  available: true,
15
- zone: {
15
+ type: "Restricted",
16
+ zone: Object.assign({
16
17
  name: "",
17
18
  path: [{
18
19
  lng: lng - 1e-3,
@@ -27,7 +28,9 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
27
28
  lat: lat + 5e-4,
28
29
  type
29
30
  }]
30
- },
31
+ }, {
32
+ extra: "extra information 1"
33
+ }),
31
34
  places: [{
32
35
  lat: lat - 1e-5,
33
36
  lng: lng + 1e-4,
@@ -112,6 +115,7 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
112
115
  return createVNode("div", null, [createVNode("div", null, [JSON.stringify(centerPlace)]), createVNode(BusinessReselectPlaceMap, {
113
116
  "class": demo,
114
117
  "unavailableTitle": "当前区域暂未开通服务",
118
+ "forbiddenTitle": "当前区域不可叫车",
115
119
  "emptyTitle": "当前位置",
116
120
  "queryingTitle": "正在获取地址信息",
117
121
  "recomendDescription": "您将在此处上车",
@@ -119,7 +123,7 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
119
123
  "defaultPlace": {
120
124
  lng: 139.777777,
121
125
  lat: 35.777777,
122
- type: "gcj02",
126
+ type: "wgs84",
123
127
  name: "default place name",
124
128
  displayName: "default place display name"
125
129
  },
@@ -135,10 +139,11 @@ const DemoBusinessReselectPlace = defineSetup("DemoBusinessReselectPlace", funct
135
139
  "onChangeRecomandPlace": ({
136
140
  place,
137
141
  inputPlace,
138
- isInZone
142
+ type,
143
+ zone
139
144
  }) => {
140
145
  console.log("用户操作地图,计算推荐点后得出的最终位置时触发,此时可以向后端查询城市信息");
141
- console.log("计算推荐点之前的地址是: ", inputPlace, " 最终的地址是: ", place, " 是否在绿区内: ", isInZone);
146
+ console.log("计算推荐点之前的地址是: ", inputPlace, " 最终的地址是: ", place, " 推荐类型: ", type, "绿区(或红区):", zone);
142
147
  },
143
148
  "onClickLocatorText": () => console.log("用户点击了蓝色光标文字触发,此时可以执行用户点击起点输入框相同的逻辑"),
144
149
  "onClickLocatorPhoto": () => console.log("用户点击了蓝色光标图片触发,此时可以执行用户点击起点输入框相同的逻辑"),
@@ -24,6 +24,7 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
24
24
  log?: boolean;
25
25
  geoLoadingTitle: string;
26
26
  unavailableTitle: string;
27
+ forbiddenTitle: string;
27
28
  emptyTitle: string;
28
29
  queryingTitle: string;
29
30
  recomendDescription: string;
@@ -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.7133beea.js";
30
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.4c38b1fb.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.7133beea.js";
1
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.4c38b1fb.js";
2
2
  export {
3
3
  B as BusinessRecomendPlaceMap,
4
4
  f as BusinessRecomendPlaceMapInner,
@@ -1,6 +1,6 @@
1
1
  import { type CoordinatePlace, type Place } from "../../types/interface";
2
2
  import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap";
3
- export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "renderPlacePhoto" | "renderPlaceTag" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
3
+ export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "loading" | "fallback" | "log" | "getAvailable" | "getRecomendPlace" | "unavailableTitle" | "forbiddenTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "disableLocatorPhoto" | "mapContext" | "renderPlacePhoto" | "renderPlaceTag" | "onChangeGeoLocation" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocatorText" | "onClickLocatorPhoto"> {
4
4
  defaultPlace?: CoordinatePlace;
5
5
  }
6
6
  export declare const BusinessReselectPlaceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessReselectPlaceMapProps>, 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<BusinessReselectPlaceMapProps, Required<BusinessReselectPlaceMapProps>>, "changePlace" | "changeGeoLocation" | "changeRecomandPlace" | "geoError" | "geoErrorOnce" | "clickLocatorText" | "clickLocatorPhoto", import("vue-demi").PublicProps, BusinessReselectPlaceMapProps, BusinessReselectPlaceMapProps, import("vue-demi").SlotsType<{
@@ -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,8 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
222
226
  onChange: ({
223
227
  place,
224
228
  inputPlace,
225
- isInZone,
229
+ type,
230
+ zone,
226
231
  isSameZone
227
232
  }) => {
228
233
  var _a;
@@ -232,12 +237,13 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
232
237
  equalAssign(centerPlace, {
233
238
  ...place
234
239
  });
235
- if (isInZone && !isSameZone)
240
+ if (type === "Restricted" && !isSameZone)
236
241
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path);
237
242
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
238
243
  place,
239
244
  inputPlace,
240
- isInZone,
245
+ type,
246
+ zone,
241
247
  isSameZone
242
248
  }));
243
249
  }
@@ -256,7 +262,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
256
262
  flush: "post"
257
263
  });
258
264
  watchEffect(() => {
259
- mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
265
+ mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value || recommendTypeRef.value === "Forbidden" ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
260
266
  });
261
267
  onUnmounted(() => abortController.abort(MANUAL_ABORT_MESSAGE));
262
268
  return () => {
@@ -264,12 +270,14 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
264
270
  const {
265
271
  recomendDescription,
266
272
  unavailableTitle,
273
+ forbiddenTitle,
267
274
  renderPlacePhoto,
268
275
  renderPlaceTag
269
276
  } = props;
277
+ const isForbidden = recommendTypeRef.value === "Forbidden";
270
278
  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;
279
+ const title = centerPlace.displayName;
280
+ const description = !availableRef.value ? unavailableTitle : isForbidden ? forbiddenTitle : isElected ? (_a = renderPlaceTag == null ? void 0 : renderPlaceTag(centerPlace)) != null ? _a : recomendDescription : void 0;
273
281
  return createVNode(HeycarMap, {
274
282
  "class": attrs.class,
275
283
  "style": attrs.style,
@@ -293,6 +301,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
293
301
  default: () => {
294
302
  var _a2, _b;
295
303
  return [((_a2 = zoneRef.value) == null ? void 0 : _a2.path.length) && createVNode(GreenZone, {
304
+ "isRed": isForbidden,
296
305
  "path": (_b = zoneRef.value) == null ? void 0 : _b.path
297
306
  }, null), !geoLoading.value && !geoError.value && createVNode(DeviceOrientation, {
298
307
  "elementRef": mapElementRef,
@@ -331,7 +340,7 @@ const BusinessReselectPlaceMap = defineLagecySetup("BusinessReselectPlaceMap", f
331
340
  key: `${payload.supplier}${instanceNo}`,
332
341
  on: generateCreateElementV2PropsOn(props, emit, ["changeGeoLocation", "changePlace", "changeRecomandPlace", "geoError", "geoErrorOnce", "clickLocatorText", "clickLocatorPhoto"])
333
342
  });
334
- }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "disableLocator", "getAvailable", "getRecomendPlace", "renderPlacePhoto", "renderPlaceTag", "mapContext"]);
343
+ }).props(["loading", "fallback", "log", "defaultPlace", "unavailableTitle", "forbiddenTitle", "emptyTitle", "queryingTitle", "recomendDescription", "geoErrorOnceNotificationKey", "disableLocator", "getAvailable", "getRecomendPlace", "renderPlacePhoto", "renderPlaceTag", "mapContext"]);
335
344
  export {
336
345
  BusinessReselectPlaceMap,
337
346
  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
  };