@heycar/heycars-map 0.9.20-querying → 0.9.20-querying2

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 CHANGED
@@ -59,6 +59,13 @@ export interface RecommendZonePlaces {
59
59
  zone?: Zone;
60
60
  places?: Place[];
61
61
  }
62
+
63
+ export enum CenterPlaceStatus {
64
+ GEO_LOADING = "GEO_LOADING",
65
+ QUERYING_INFO = "QUERYING_INFO",
66
+ SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
67
+ OK = "OK",
68
+ }
62
69
  ```
63
70
 
64
71
  #### 在 入口文件添加 `MapProvider`
package/dist/index.cjs CHANGED
@@ -163,7 +163,7 @@ const mockWxByUrl = () => {
163
163
  };
164
164
  mockWxByUrl();
165
165
  const name = "@heycar/heycars-map";
166
- const version = "0.9.20-querying";
166
+ const version = "0.9.20-querying2";
167
167
  const type = "module";
168
168
  const bin = {
169
169
  checkVersion: "./bin/checkVersion.js"
@@ -7043,6 +7043,13 @@ const useMapZoom = (props) => {
7043
7043
  const { supplier } = useMapSupplier();
7044
7044
  return supplier === "gmap" ? useGmapZoom(props) : useAmapZoom(props);
7045
7045
  };
7046
+ var CenterPlaceStatus = /* @__PURE__ */ ((CenterPlaceStatus2) => {
7047
+ CenterPlaceStatus2["GEO_LOADING"] = "GEO_LOADING";
7048
+ CenterPlaceStatus2["QUERYING_INFO"] = "QUERYING_INFO";
7049
+ CenterPlaceStatus2["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
7050
+ CenterPlaceStatus2["OK"] = "OK";
7051
+ return CenterPlaceStatus2;
7052
+ })(CenterPlaceStatus || {});
7046
7053
  const AmapPolygon = defineSetup(function AmapPolygon2(props) {
7047
7054
  const polygonRef = Vue.shallowRef();
7048
7055
  const mapRef = useAmap();
@@ -7858,7 +7865,8 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
7858
7865
  placeCandidates,
7859
7866
  zoneRef,
7860
7867
  availableRef,
7861
- isElectedRef
7868
+ isElectedRef,
7869
+ isQueryingRef
7862
7870
  } = useMapRecomendPlace({
7863
7871
  defaultPoint: place2point(centerPlace),
7864
7872
  emptyPlaceName: emptyTitle,
@@ -7912,6 +7920,11 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
7912
7920
  Vue.watchEffect(() => {
7913
7921
  mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
7914
7922
  });
7923
+ Vue.watchEffect(() => {
7924
+ const centerPlaceStatus = geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
7925
+ mapContext.centerPlaceStatusRef.value = centerPlaceStatus;
7926
+ console.log("centerPlaceStatus = ", centerPlaceStatus);
7927
+ });
7915
7928
  return () => {
7916
7929
  var _a2, _b2;
7917
7930
  const {
@@ -8104,7 +8117,8 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8104
8117
  placeCandidates,
8105
8118
  zoneRef,
8106
8119
  availableRef,
8107
- isElectedRef
8120
+ isElectedRef,
8121
+ isQueryingRef
8108
8122
  } = useMapRecomendPlace({
8109
8123
  defaultPoint: place2point(centerPlace),
8110
8124
  emptyPlaceName: emptyTitle,
@@ -8159,6 +8173,9 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8159
8173
  Vue.watchEffect(() => {
8160
8174
  mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
8161
8175
  });
8176
+ Vue.watchEffect(() => {
8177
+ mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
8178
+ });
8162
8179
  return () => {
8163
8180
  var _a, _b;
8164
8181
  const {
@@ -10257,6 +10274,7 @@ const useBusinessRecomendPlaceMap = () => {
10257
10274
  });
10258
10275
  const placeCandidates = Vue.ref([]);
10259
10276
  const geoPositionRef = Vue.ref();
10277
+ const centerPlaceStatusRef = Vue.ref(CenterPlaceStatus.GEO_LOADING);
10260
10278
  const { apiMapDistance } = useMapGeometry();
10261
10279
  const { inChina } = useMapInChina();
10262
10280
  const panToGeoPositionByRecomend = (value) => mapContext.panToGeoPositionByRecomend(value);
@@ -10265,6 +10283,7 @@ const useBusinessRecomendPlaceMap = () => {
10265
10283
  const setCenterPlaceByUserSpecifiedInZone = (value) => mapContext.setCenterPlaceByUserSpecifiedInZone(value);
10266
10284
  const mapContext = {
10267
10285
  geoPositionRef,
10286
+ centerPlaceStatusRef,
10268
10287
  panToGeoPositionByRecomend: () => {
10269
10288
  throw new Error("MyError: panToGeoPositionByRecomend used before assigned");
10270
10289
  },
@@ -10289,6 +10308,7 @@ const useBusinessRecomendPlaceMap = () => {
10289
10308
  centerPlace,
10290
10309
  placeCandidates,
10291
10310
  geoPosition: Vue.readonly(geoPositionRef),
10311
+ centerPlaceStatus: Vue.readonly(centerPlaceStatusRef),
10292
10312
  panToGeoPositionByRecomend,
10293
10313
  setCenterPlaceDisplayNameOnce,
10294
10314
  setCenterPlaceByUserSpecified,
@@ -10316,6 +10336,7 @@ exports.BusinessRecomendPlaceMap = BusinessRecomendPlaceMap;
10316
10336
  exports.BusinessReselectPlaceMap = BusinessReselectPlaceMap;
10317
10337
  exports.BusinessTaxiEndMap = BusinessTaxiEndMap;
10318
10338
  exports.BusinessTaxiServiceMap = BusinessTaxiServiceMap;
10339
+ exports.CenterPlaceStatus = CenterPlaceStatus;
10319
10340
  exports.DrivingLine = DrivingLine;
10320
10341
  exports.DrivingRoute = DrivingRoute;
10321
10342
  exports.HeycarMap = HeycarMap;
package/dist/index.js CHANGED
@@ -161,7 +161,7 @@ const mockWxByUrl = () => {
161
161
  };
162
162
  mockWxByUrl();
163
163
  const name = "@heycar/heycars-map";
164
- const version = "0.9.20-querying";
164
+ const version = "0.9.20-querying2";
165
165
  const type = "module";
166
166
  const bin = {
167
167
  checkVersion: "./bin/checkVersion.js"
@@ -7041,6 +7041,13 @@ const useMapZoom = (props) => {
7041
7041
  const { supplier } = useMapSupplier();
7042
7042
  return supplier === "gmap" ? useGmapZoom(props) : useAmapZoom(props);
7043
7043
  };
7044
+ var CenterPlaceStatus = /* @__PURE__ */ ((CenterPlaceStatus2) => {
7045
+ CenterPlaceStatus2["GEO_LOADING"] = "GEO_LOADING";
7046
+ CenterPlaceStatus2["QUERYING_INFO"] = "QUERYING_INFO";
7047
+ CenterPlaceStatus2["SERVICE_UNAVAILABLE"] = "SERVICE_UNAVAILABLE";
7048
+ CenterPlaceStatus2["OK"] = "OK";
7049
+ return CenterPlaceStatus2;
7050
+ })(CenterPlaceStatus || {});
7044
7051
  const AmapPolygon = defineSetup(function AmapPolygon2(props) {
7045
7052
  const polygonRef = shallowRef();
7046
7053
  const mapRef = useAmap();
@@ -7856,7 +7863,8 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
7856
7863
  placeCandidates,
7857
7864
  zoneRef,
7858
7865
  availableRef,
7859
- isElectedRef
7866
+ isElectedRef,
7867
+ isQueryingRef
7860
7868
  } = useMapRecomendPlace({
7861
7869
  defaultPoint: place2point(centerPlace),
7862
7870
  emptyPlaceName: emptyTitle,
@@ -7910,6 +7918,11 @@ const BusinessRecomendPlaceMap = defineLagecySetup(function BusinessRecomendPlac
7910
7918
  watchEffect(() => {
7911
7919
  mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
7912
7920
  });
7921
+ watchEffect(() => {
7922
+ const centerPlaceStatus = geoLoading.value ? CenterPlaceStatus.GEO_LOADING : isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
7923
+ mapContext.centerPlaceStatusRef.value = centerPlaceStatus;
7924
+ console.log("centerPlaceStatus = ", centerPlaceStatus);
7925
+ });
7913
7926
  return () => {
7914
7927
  var _a2, _b2;
7915
7928
  const {
@@ -8102,7 +8115,8 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8102
8115
  placeCandidates,
8103
8116
  zoneRef,
8104
8117
  availableRef,
8105
- isElectedRef
8118
+ isElectedRef,
8119
+ isQueryingRef
8106
8120
  } = useMapRecomendPlace({
8107
8121
  defaultPoint: place2point(centerPlace),
8108
8122
  emptyPlaceName: emptyTitle,
@@ -8157,6 +8171,9 @@ const BusinessReselectPlaceMap = defineLagecySetup(function BusinessReselectPlac
8157
8171
  watchEffect(() => {
8158
8172
  mapContext.onChangeRecomendPlaces([...placeCandidates.value]);
8159
8173
  });
8174
+ watchEffect(() => {
8175
+ mapContext.centerPlaceStatusRef.value = isQueryingRef.value ? CenterPlaceStatus.QUERYING_INFO : !availableRef.value ? CenterPlaceStatus.SERVICE_UNAVAILABLE : CenterPlaceStatus.OK;
8176
+ });
8160
8177
  return () => {
8161
8178
  var _a, _b;
8162
8179
  const {
@@ -10255,6 +10272,7 @@ const useBusinessRecomendPlaceMap = () => {
10255
10272
  });
10256
10273
  const placeCandidates = ref([]);
10257
10274
  const geoPositionRef = ref();
10275
+ const centerPlaceStatusRef = ref(CenterPlaceStatus.GEO_LOADING);
10258
10276
  const { apiMapDistance } = useMapGeometry();
10259
10277
  const { inChina } = useMapInChina();
10260
10278
  const panToGeoPositionByRecomend = (value) => mapContext.panToGeoPositionByRecomend(value);
@@ -10263,6 +10281,7 @@ const useBusinessRecomendPlaceMap = () => {
10263
10281
  const setCenterPlaceByUserSpecifiedInZone = (value) => mapContext.setCenterPlaceByUserSpecifiedInZone(value);
10264
10282
  const mapContext = {
10265
10283
  geoPositionRef,
10284
+ centerPlaceStatusRef,
10266
10285
  panToGeoPositionByRecomend: () => {
10267
10286
  throw new Error("MyError: panToGeoPositionByRecomend used before assigned");
10268
10287
  },
@@ -10287,6 +10306,7 @@ const useBusinessRecomendPlaceMap = () => {
10287
10306
  centerPlace,
10288
10307
  placeCandidates,
10289
10308
  geoPosition: readonly(geoPositionRef),
10309
+ centerPlaceStatus: readonly(centerPlaceStatusRef),
10290
10310
  panToGeoPositionByRecomend,
10291
10311
  setCenterPlaceDisplayNameOnce,
10292
10312
  setCenterPlaceByUserSpecified,
@@ -10315,6 +10335,7 @@ export {
10315
10335
  BusinessReselectPlaceMap,
10316
10336
  BusinessTaxiEndMap,
10317
10337
  BusinessTaxiServiceMap,
10338
+ CenterPlaceStatus,
10318
10339
  DrivingLine,
10319
10340
  DrivingRoute,
10320
10341
  HeycarMap,
@@ -4,7 +4,7 @@ import { UseGeoLocationProps } from "../../hooks/useGeoLocation";
4
4
  import { UseMapDragProps } from "../../hooks/useMapDrag";
5
5
  import type { UseMapPlaceProps } from "../../hooks/useMapPlace";
6
6
  import { UseMapRecomendPlaceProps } from "../../hooks/useMapRecomendPlace";
7
- import type { Place, Point } from "../../types/interface";
7
+ import { type Place, type Point } from "../../types/interface";
8
8
  import { AbsoluteAddressBoxProps } from "../AbsoluteAddressBox";
9
9
  export declare const RECOMMEND_PLACE_DRAG_LIMIT = 10;
10
10
  export declare const RECOMMEND_PLACE_LARGE_LIMIT = 100;
@@ -1,4 +1,4 @@
1
- import type { Place } from "../../types/interface";
1
+ import { type Place } from "../../types/interface";
2
2
  import { type BusinessRecomendPlaceMapProps } from "../BusinessRecomendPlaceMap";
3
3
  export interface BusinessReselectPlaceMapProps extends Pick<BusinessRecomendPlaceMapProps, "geoErrorOnceNotificationKey" | "geoErrorOnceNotificationInterval" | "loading" | "fallback" | "log" | "getRecomendPlace" | "unavailableTitle" | "emptyTitle" | "queryingTitle" | "recomendDescription" | "disableLocator" | "mapContext" | "onChangePlace" | "onChangeRecomandPlace" | "onGeoError" | "onGeoErrorOnce" | "onClickLocator"> {
4
4
  defaultPlace?: Place;
@@ -1,11 +1,12 @@
1
1
  import { Ref } from "vue-demi";
2
- import type { Place, Point, RecommendZonePlaces } from "../types/interface";
2
+ import { CenterPlaceStatus, Place, Point, RecommendZonePlaces } from "../types/interface";
3
3
  export interface SetCenterPlaceByUserSpecifiedInZoneProps {
4
4
  place: Place;
5
5
  recommends: RecommendZonePlaces;
6
6
  }
7
7
  export interface BusinessRecomendPlaceContext {
8
8
  geoPositionRef: Ref<Point | undefined>;
9
+ centerPlaceStatusRef: Ref<CenterPlaceStatus>;
9
10
  panToGeoPositionByRecomend: (value: Point) => void;
10
11
  setCenterPlaceDisplayNameOnce: (value: string) => void;
11
12
  setCenterPlaceByUserSpecified: (value: Place) => void;
@@ -28,6 +29,7 @@ export declare const useBusinessRecomendPlaceMap: () => {
28
29
  displayName: string;
29
30
  }[]>;
30
31
  geoPosition: Readonly<Ref<readonly [number, number] | undefined>>;
32
+ centerPlaceStatus: Readonly<Ref<CenterPlaceStatus>>;
31
33
  panToGeoPositionByRecomend: (value: Point) => void;
32
34
  setCenterPlaceDisplayNameOnce: (value: string) => void;
33
35
  setCenterPlaceByUserSpecified: (value: Place) => void;
@@ -13,6 +13,7 @@ export declare const useBusinessReselectPlaceMap: () => {
13
13
  displayName: string;
14
14
  }[]>;
15
15
  geoPosition: Readonly<import("vue").Ref<readonly [number, number] | undefined>>;
16
+ centerPlaceStatus: Readonly<import("vue").Ref<import("..").CenterPlaceStatus>>;
16
17
  panToGeoPositionByRecomend: (value: import("..").Point) => void;
17
18
  setCenterPlaceDisplayNameOnce: (value: string) => void;
18
19
  setCenterPlaceByUserSpecified: (value: import("..").Place) => void;
@@ -43,3 +43,9 @@ export interface TrackPoint {
43
43
  timestamp: number;
44
44
  }
45
45
  export type DriverStatus = "dispatching" | "book-dispatching" | "dispatched" | "driverStartService" | "book-driverStartService" | "book-dispatched" | "driverArrived" | "inService" | "canceled" | "endService" | "completed" | "canceling" | "banlanceRefund" | "waitBanlanceRefund" | "rechargePayed" | "waitRechargePay" | "payed" | "waitpay" | "refund" | "confirmed" | "assign";
46
+ export declare enum CenterPlaceStatus {
47
+ GEO_LOADING = "GEO_LOADING",
48
+ QUERYING_INFO = "QUERYING_INFO",
49
+ SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
50
+ OK = "OK"
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.9.20-querying",
3
+ "version": "0.9.20-querying2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js"