@heycar/heycars-map 2.0.0-switchMap6 → 2.0.0-switchMap8

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/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./v2"
1
+ export * from "./v3"
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./v2"
1
+ export * from "./v3"
@@ -13,9 +13,14 @@ function assertLatitudeLongitudeLiteral(value) {
13
13
  throw Error(`MyError: expect type LatitudeLongitudeLiteral, actual is: ${JSON.stringify(value)}`);
14
14
  }
15
15
  function assertSnappedPoint(value) {
16
- if (value)
16
+ const error = Error(`MyError: expect type SnappedPoint, actual is: ${JSON.stringify(value)}`);
17
+ if (!value)
18
+ throw error;
19
+ try {
17
20
  assertLatitudeLongitudeLiteral(value.location);
18
- throw Error(`MyError: expect type SnappedPoint, actual is: ${JSON.stringify(value)}`);
21
+ } catch {
22
+ throw error;
23
+ }
19
24
  }
20
25
  function assertSnapToRoadsResponse(value) {
21
26
  const error = Error(
@@ -602,6 +602,14 @@ const useAmapLoader = (props) => {
602
602
  );
603
603
  });
604
604
  const keepRetry = createOneConcurrent(async () => {
605
+ if (!(disableRef == null ? void 0 : disableRef.value) && statusRef.value === "SUCCESS") {
606
+ pingStatusRef.value = "pending";
607
+ while (!(disableRef == null ? void 0 : disableRef.value) && pingStatusRef.value !== "connected") {
608
+ if (pingStatusRef.value === "unconnected")
609
+ await sleep(MIN_MAP_RELOAD_INTERVAL);
610
+ pingStatusRef.value = await apiPingAmap();
611
+ }
612
+ }
605
613
  const options = optionsRef.value;
606
614
  while (!(disableRef == null ? void 0 : disableRef.value) && statusRef.value !== "SUCCESS") {
607
615
  if (statusRef.value === "LOADING") {
@@ -662,9 +670,9 @@ const useGmapLoader = (props) => {
662
670
  return Promise.race([abortPromise, loadPromise]);
663
671
  });
664
672
  const keepRetry = createOneConcurrent(async () => {
665
- if (statusRef.value === "SUCCESS") {
673
+ if (!(disableRef == null ? void 0 : disableRef.value) && statusRef.value === "SUCCESS") {
666
674
  pingStatusRef.value = "pending";
667
- while (pingStatusRef.value !== "connected") {
675
+ while (!(disableRef == null ? void 0 : disableRef.value) && pingStatusRef.value !== "connected") {
668
676
  if (pingStatusRef.value === "unconnected")
669
677
  await sleep(MIN_MAP_RELOAD_INTERVAL);
670
678
  pingStatusRef.value = await apiPingGmap();
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.0.0-switchMap6";
3
+ const pkgVersion = "2.0.0-switchMap8";
4
4
  const isEnableLog = (name) => {
5
5
  const searchParam = new URLSearchParams(location.search);
6
6
  return searchParam.has(`log-${name}`);
@@ -13,9 +13,14 @@ function assertLatitudeLongitudeLiteral(value) {
13
13
  throw Error(`MyError: expect type LatitudeLongitudeLiteral, actual is: ${JSON.stringify(value)}`);
14
14
  }
15
15
  function assertSnappedPoint(value) {
16
- if (value)
16
+ const error = Error(`MyError: expect type SnappedPoint, actual is: ${JSON.stringify(value)}`);
17
+ if (!value)
18
+ throw error;
19
+ try {
17
20
  assertLatitudeLongitudeLiteral(value.location);
18
- throw Error(`MyError: expect type SnappedPoint, actual is: ${JSON.stringify(value)}`);
21
+ } catch {
22
+ throw error;
23
+ }
19
24
  }
20
25
  function assertSnapToRoadsResponse(value) {
21
26
  const error = Error(
@@ -602,6 +602,14 @@ const useAmapLoader = (props) => {
602
602
  );
603
603
  });
604
604
  const keepRetry = createOneConcurrent(async () => {
605
+ if (!(disableRef == null ? void 0 : disableRef.value) && statusRef.value === "SUCCESS") {
606
+ pingStatusRef.value = "pending";
607
+ while (!(disableRef == null ? void 0 : disableRef.value) && pingStatusRef.value !== "connected") {
608
+ if (pingStatusRef.value === "unconnected")
609
+ await sleep(MIN_MAP_RELOAD_INTERVAL);
610
+ pingStatusRef.value = await apiPingAmap();
611
+ }
612
+ }
605
613
  const options = optionsRef.value;
606
614
  while (!(disableRef == null ? void 0 : disableRef.value) && statusRef.value !== "SUCCESS") {
607
615
  if (statusRef.value === "LOADING") {
@@ -662,9 +670,9 @@ const useGmapLoader = (props) => {
662
670
  return Promise.race([abortPromise, loadPromise]);
663
671
  });
664
672
  const keepRetry = createOneConcurrent(async () => {
665
- if (statusRef.value === "SUCCESS") {
673
+ if (!(disableRef == null ? void 0 : disableRef.value) && statusRef.value === "SUCCESS") {
666
674
  pingStatusRef.value = "pending";
667
- while (pingStatusRef.value !== "connected") {
675
+ while (!(disableRef == null ? void 0 : disableRef.value) && pingStatusRef.value !== "connected") {
668
676
  if (pingStatusRef.value === "unconnected")
669
677
  await sleep(MIN_MAP_RELOAD_INTERVAL);
670
678
  pingStatusRef.value = await apiPingGmap();
@@ -1,6 +1,6 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.0.0-switchMap6";
3
+ const pkgVersion = "2.0.0-switchMap8";
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.0.0-switchMap6",
3
+ "version": "2.0.0-switchMap8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js",