我有这个html页面:
<!DOCTYPE html>
<html>
<head>
<title>Geolocation test</title>
</head>
<body>
<script type="text/javascript">
navigator.geolocation.getCurrentPosition(function (position) {
alert(position.coords.latitude + ',' + position.coords.longitude);
}, function (error) {
alert(error.code);
}, {enableHighAccuracy: true, maximumAge: 0});
</script>
</body>
致力于:
不适用于:
我已经阅读了很多关于这个问题的问题,但是他们都说,有时候这个位置是不可用的,或者可能需要很长时间才能检索到,但是当我打开android地图应用程序时,它会立即显示出一个完美的位置(即使我暂时不使用它)。
我知道我可以使用超时值选项来处理错误回调,但这不是我的解决方案。
谢谢!
发布于 2014-07-31 22:10:25
这可能是由于应用程序权限问题造成的。
https://stackoverflow.com/questions/18980037
复制相似问题