@heycar/heycars-map 2.5.1 → 2.5.3

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.
@@ -1,5 +1,5 @@
1
1
  import { h } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.d8f5b904.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.824002ef.js";
3
3
  import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
4
4
  import { defineSetup } from "../types/helper.js";
5
5
  import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
@@ -117,7 +117,8 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
117
117
  }
118
118
  }), h(FitViewOnce, {
119
119
  "attrs": {
120
- "registerOverlay": registerOverlay
120
+ "registerOverlay": registerOverlay,
121
+ "immediate": true
121
122
  }
122
123
  })]);
123
124
  };
@@ -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.d8f5b904.js";
30
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.824002ef.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.d8f5b904.js";
1
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.824002ef.js";
2
2
  export {
3
3
  B as BusinessRecomendPlaceMap,
4
4
  f as BusinessRecomendPlaceMapInner,
@@ -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.d8f5b904.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.824002ef.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";
@@ -237,7 +237,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
237
237
  equalAssign(centerPlace, {
238
238
  ...place
239
239
  });
240
- if (type === "Restricted" && !isSameZone)
240
+ if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
241
241
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path);
242
242
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
243
243
  place,
@@ -511,7 +511,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
511
511
  equalAssign(centerPlace, {
512
512
  ...place
513
513
  });
514
- if (type === "Restricted" && !isSameZone)
514
+ if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
515
515
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path, place2point(place));
516
516
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
517
517
  place,
@@ -41,6 +41,7 @@ const useAmapPlace = (props) => {
41
41
  const pipeTw = createPipeTw(language === "zh-TW");
42
42
  const isChina = inChina([lng, lat]);
43
43
  geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
44
+ clearTimeout(timer);
44
45
  switch (status) {
45
46
  case "complete": {
46
47
  const { formattedAddress, addressComponent } = result.regeocode;
@@ -59,7 +60,7 @@ const useAmapPlace = (props) => {
59
60
  }
60
61
  });
61
62
  }, handleFailed);
62
- setTimeout(() => {
63
+ const timer = setTimeout(() => {
63
64
  console.warn("高德逆地理请求超时!");
64
65
  handleFailed();
65
66
  }, REGEO_TIMEOUT);
@@ -112,13 +113,13 @@ const useGmapPlace = (props) => {
112
113
  readyPromise.then(() => {
113
114
  const geocoder = new google.maps.Geocoder();
114
115
  const pipeTw = createPipeTw(language === "zh-TW");
115
- geocoder.geocode({ language, location: { lng, lat } }).then(({ results }) => {
116
+ geocoder.geocode({ language, location: { lng, lat } }).finally(() => clearTimeout(timer)).then(({ results }) => {
116
117
  const name = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
117
118
  const displayName = gmapPlaceName2DisplayName(name, results[0].address_components);
118
119
  resolve({ lng, lat, name: pipeTw(name), displayName: pipeTw(displayName) });
119
120
  }).catch(handleFailed);
120
121
  }, handleFailed);
121
- setTimeout(() => {
122
+ const timer = setTimeout(() => {
122
123
  console.warn("谷歌逆地理请求超时!");
123
124
  handleFailed();
124
125
  }, REGEO_TIMEOUT);
@@ -1,5 +1,5 @@
1
1
  import { reactive, ref, readonly } from "vue-demi";
2
- import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.d8f5b904.js";
2
+ import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.824002ef.js";
3
3
  import { CenterPlaceStatus } from "../types/interface.js";
4
4
  import { proxyFunctionalProperty, assertAssingedBeforeUsed } from "../utils/helper.js";
5
5
  const useBusinessRecomendPlaceMap = () => {
package/dist/v2/index.js CHANGED
@@ -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.d8f5b904.js";
6
+ import { B } from "./chunks/BusinessRecomendPlaceMap.824002ef.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,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.5.1";
3
+ const pkgVersion = "2.5.2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.4c38b1fb.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
3
3
  import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
4
4
  import { defineSetup } from "../types/helper.js";
5
5
  import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
@@ -101,7 +101,8 @@ const BusinessQuotingMapInner = defineSetup("BusinessQuotingMapInner", function(
101
101
  "onClick": () => emit("clickEndPoint", coordinatifyPlace(toPlace))
102
102
  }, null)]
103
103
  }, null), createVNode(FitViewOnce, {
104
- "registerOverlay": registerOverlay
104
+ "registerOverlay": registerOverlay,
105
+ "immediate": true
105
106
  }, null)]
106
107
  });
107
108
  };
@@ -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.4c38b1fb.js";
30
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.d14dbe4e.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.4c38b1fb.js";
1
+ import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.d14dbe4e.js";
2
2
  export {
3
3
  B as BusinessRecomendPlaceMap,
4
4
  f as BusinessRecomendPlaceMapInner,
@@ -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.4c38b1fb.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.d14dbe4e.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";
@@ -237,7 +237,7 @@ const BusinessReselectPlaceMapInner = defineSetup("BusinessReselectPlaceMapInner
237
237
  equalAssign(centerPlace, {
238
238
  ...place
239
239
  });
240
- if (type === "Restricted" && !isSameZone)
240
+ if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
241
241
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path);
242
242
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
243
243
  place,
@@ -511,7 +511,7 @@ const BusinessRecomendPlaceMapInner = defineSetup("BusinessRecomendPlaceMapInner
511
511
  equalAssign(centerPlace, {
512
512
  ...place
513
513
  });
514
- if (type === "Restricted" && !isSameZone)
514
+ if ((type === "Restricted" || type === "Forbidden") && !isSameZone)
515
515
  setFitZoom((_a = zoneRef.value) == null ? void 0 : _a.path, place2point(place));
516
516
  emit("changeRecomandPlace", coordinatifyValueOfOnChangeRecommendPlace({
517
517
  place,
@@ -41,6 +41,7 @@ const useAmapPlace = (props) => {
41
41
  const pipeTw = createPipeTw(language === "zh-TW");
42
42
  const isChina = inChina([lng, lat]);
43
43
  geocoder.getAddress(new AMap.LngLat(lng, lat), (status, result) => {
44
+ clearTimeout(timer);
44
45
  switch (status) {
45
46
  case "complete": {
46
47
  const { formattedAddress, addressComponent } = result.regeocode;
@@ -59,7 +60,7 @@ const useAmapPlace = (props) => {
59
60
  }
60
61
  });
61
62
  }, handleFailed);
62
- setTimeout(() => {
63
+ const timer = setTimeout(() => {
63
64
  console.warn("高德逆地理请求超时!");
64
65
  handleFailed();
65
66
  }, REGEO_TIMEOUT);
@@ -112,13 +113,13 @@ const useGmapPlace = (props) => {
112
113
  readyPromise.then(() => {
113
114
  const geocoder = new google.maps.Geocoder();
114
115
  const pipeTw = createPipeTw(language === "zh-TW");
115
- geocoder.geocode({ language, location: { lng, lat } }).then(({ results }) => {
116
+ geocoder.geocode({ language, location: { lng, lat } }).finally(() => clearTimeout(timer)).then(({ results }) => {
116
117
  const name = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
117
118
  const displayName = gmapPlaceName2DisplayName(name, results[0].address_components);
118
119
  resolve({ lng, lat, name: pipeTw(name), displayName: pipeTw(displayName) });
119
120
  }).catch(handleFailed);
120
121
  }, handleFailed);
121
- setTimeout(() => {
122
+ const timer = setTimeout(() => {
122
123
  console.warn("谷歌逆地理请求超时!");
123
124
  handleFailed();
124
125
  }, REGEO_TIMEOUT);
@@ -1,5 +1,5 @@
1
1
  import { reactive, ref, readonly } from "vue-demi";
2
- import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.4c38b1fb.js";
2
+ import { E as EMPTY_PLACE } from "../chunks/BusinessRecomendPlaceMap.d14dbe4e.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.4c38b1fb.js";
6
+ import { B } from "./chunks/BusinessRecomendPlaceMap.d14dbe4e.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,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.5.1";
3
+ const pkgVersion = "2.5.2";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",