@heycar/heycars-map 0.9.21-alpha → 0.9.21-alpha2

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.cjs CHANGED
@@ -19,7 +19,7 @@ if (typeof GeolocationPositionError === "undefined") {
19
19
  };
20
20
  }
21
21
  const name = "@heycar/heycars-map";
22
- const version = "0.9.21-alpha";
22
+ const version = "0.9.21-alpha2";
23
23
  const type = "module";
24
24
  const bin = {
25
25
  checkVersion: "./bin/checkVersion.js"
@@ -4712,14 +4712,16 @@ function androidWatchPosition(onSuccess, onError, option) {
4712
4712
  continue;
4713
4713
  }
4714
4714
  const geoPosition = await new Promise((resolve) => {
4715
- navigator.geolocation.getCurrentPosition(
4715
+ const watchId = navigator.geolocation.watchPosition(
4716
4716
  function onSuccess2(geoLocationPosition) {
4717
+ navigator.geolocation.clearWatch(watchId);
4717
4718
  geoErrorMessage = void 0;
4718
4719
  resolve(geoLocationPosition);
4719
4720
  },
4720
4721
  function onFail(geoError) {
4722
+ navigator.geolocation.clearWatch(watchId);
4721
4723
  if (geoError.code === 3 && !!prevGeoPosition) {
4722
- console.warn("警告: navigator.geolocation.getCurrentPosition 超时跳过");
4724
+ console.warn("警告: navigator.geolocation.watchPosition 超时跳过");
4723
4725
  resolve(prevGeoPosition);
4724
4726
  return;
4725
4727
  }
@@ -4729,7 +4731,7 @@ function androidWatchPosition(onSuccess, onError, option) {
4729
4731
  resolve(void 0);
4730
4732
  if (prevMessage === message)
4731
4733
  return;
4732
- console.warn("MyWarning: navigator.geolocation.getCurrentPosition failed: ", message);
4734
+ console.warn("MyWarning: navigator.geolocation.watchPosition failed: ", message);
4733
4735
  onError == null ? void 0 : onError(geoError);
4734
4736
  },
4735
4737
  option
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ if (typeof GeolocationPositionError === "undefined") {
17
17
  };
18
18
  }
19
19
  const name = "@heycar/heycars-map";
20
- const version = "0.9.21-alpha";
20
+ const version = "0.9.21-alpha2";
21
21
  const type = "module";
22
22
  const bin = {
23
23
  checkVersion: "./bin/checkVersion.js"
@@ -4710,14 +4710,16 @@ function androidWatchPosition(onSuccess, onError, option) {
4710
4710
  continue;
4711
4711
  }
4712
4712
  const geoPosition = await new Promise((resolve) => {
4713
- navigator.geolocation.getCurrentPosition(
4713
+ const watchId = navigator.geolocation.watchPosition(
4714
4714
  function onSuccess2(geoLocationPosition) {
4715
+ navigator.geolocation.clearWatch(watchId);
4715
4716
  geoErrorMessage = void 0;
4716
4717
  resolve(geoLocationPosition);
4717
4718
  },
4718
4719
  function onFail(geoError) {
4720
+ navigator.geolocation.clearWatch(watchId);
4719
4721
  if (geoError.code === 3 && !!prevGeoPosition) {
4720
- console.warn("警告: navigator.geolocation.getCurrentPosition 超时跳过");
4722
+ console.warn("警告: navigator.geolocation.watchPosition 超时跳过");
4721
4723
  resolve(prevGeoPosition);
4722
4724
  return;
4723
4725
  }
@@ -4727,7 +4729,7 @@ function androidWatchPosition(onSuccess, onError, option) {
4727
4729
  resolve(void 0);
4728
4730
  if (prevMessage === message)
4729
4731
  return;
4730
- console.warn("MyWarning: navigator.geolocation.getCurrentPosition failed: ", message);
4732
+ console.warn("MyWarning: navigator.geolocation.watchPosition failed: ", message);
4731
4733
  onError == null ? void 0 : onError(geoError);
4732
4734
  },
4733
4735
  option
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycar/heycars-map",
3
- "version": "0.9.21-alpha",
3
+ "version": "0.9.21-alpha2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "checkVersion": "./bin/checkVersion.js"