地理位置获取旧坐标

问题描述 投票:0回答:1

我正在遵循此vlog以获取准确的当前位置(我使用了最终方法)

这是到目前为止我为获得当前位置所做的尝试的一小段:

async getLocationCoordinates() {
  const options = {
    enableHighAccuracy: true,
    timeout: 30000,
    maximumAge: 60000
 };
  return new Promise<LocationResult>((resolve, reject) => {
     this.geolocation.getCurrentPosition(options).then((resp) => {
     this.coordinates.latitude = resp.coords.latitude;
     this.coordinates.longitude = resp.coords.longitude;
     this.coordinates.accuracy = resp.coords.accuracy;
     console.log(resp, 'get locc');
     resolve(this.coordinates);
  }).catch((error) => {
     alert('Error getting location');
     reject(false);
   });
  });

[当我第一次尝试时。我的准确度是100,但是当我在另一个位置尝试时,它给了我以前的坐标(第一次尝试时),准确度下降到了17。

我使用的电话是三星。有什么建议可以提高准确性吗?还是我应该使用其他包装。

我还检查了我的谷歌地图,如果我的GPS有任何问题,但它会向我显示正确的位置。

我正在关注此vlog,以获取准确的当前位置(我使用了最终方法),以下是迄今为止我尝试获取当前位置的内容的摘要:async getLocationCoordinates(){...

angular ionic-framework geolocation ionic4
1个回答
0
投票
我认为是由于您的[[maximumAge
© www.soinside.com 2019 - 2024. All rights reserved.