【问题标题】:Google Maps API - Accuracy rating. What is a High accuracy rating.Google Maps API - 准确度评级。什么是高精度等级。
【发布时间】:2017-04-26 13:52:03
【问题描述】:

我正在使用 Google Maps V3 从运行 chrome 的 android 设备获取位置。

在大多数情况下它工作正常 - 返回准确的结果。但在极少数情况下——它会记录大约 20 英里外的 GPS。

我想使用position.coords.accuracy 值来确定 gps 位置是否值得信赖,但我找不到任何关于“高”值与“低”值的信息..

function getLocation(position) {
    console.warn(position);
    latitude = position.coords.latitude;
    longitude = position.coords.longitude;
}

控制台输出:

Geoposition {coords: Coordinates, timestamp: 1493214564839}
coords>     :>     Coordinates
accuracy>     :>     984
altitude>     :>     null
altitudeAccuracy>     :>     null
heading>     :>     null
latitude>     :>     12.2222222
longitude>     :>     21.2222222
speed>     :>     null
__proto__>     :>     Coordinates
timestamp>     :>     1493214564839
__proto__>     :>     Geoposition

所以我的问题是: 什么评级将等同于可信赖。 900? 50? 10? 2000 年?

提前感谢您的帮助。

【问题讨论】:

    标签: google-maps google-maps-api-3 gps


    【解决方案1】:

    来自the documentation

    accuracy 属性表示经纬度坐标的精度等级。它以米为单位指定,并且必须得到所有实现的支持。准确度属性的值必须是非负实数。

    数值以米为单位,由你决定好坏;我认为大约 30 米是一个合理的精度。

    【讨论】:

    • 只是为了澄清:所以position.coords.accuracy 中 1 的准确度是“在一英里内”?而我目前得到的 985 在 985 英里之内?
    • 正如我在回答中所说,它以米为单位(不确定您从哪里获得英里)。 1 将是 1 米(这非常好)。
    • 啊,一个愚蠢的误读。对不起。太完美了,非常感谢您的回答。我将允许高达 200 的准确度。因为这是可以接受的:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-06
    • 1970-01-01
    • 2014-05-04
    • 1970-01-01
    • 2021-09-06
    • 1970-01-01
    相关资源
    最近更新 更多