超时约地理位置总能达到时,位置模式设置为QUOT;设备只" [英] Timeout about geolocation always reached when position mode is set to "Device only"

查看:182
本文介绍了超时约地理位置总能达到时,位置模式设置为QUOT;设备只"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我自己的离子应用程序(科尔多瓦)。

I own a Ionic application (Cordova).

我有这个JS code旨在获得Android的设备的位置:

I have this JS code aiming to get the position of the Android's device:

$cordovaGeolocation.getCurrentPosition({
                    enableHighAccuracy: true,
                    timeout: 15000
                }) 

$ cordovaGeolocation 来自 NG-科尔多瓦 LIB。
我成功地检查了插件 org.apache.cordova.geolocation 与过去的当前版本更新。

$cordovaGeolocation comes from ng-cordova lib.
I successfully checked that the plugin org.apache.cordova.geolocation is updated with the last current version.

有些用户抱怨多15秒,第一个查询!
注意,超时设置为15000毫秒=> 15秒。
这意味着该设备没有成功建立的位置。

Some users complain about more 15 seconds for the first query!
Note that the timeout is set to 15000 ms => 15 seconds.
Meaning that the device did not succeed to establish the position.

调查之后,我想通了这个问题:
这些用户已经建立自己的立场模式设置为仅设备或者也称为GPS只能在他们的设备的设置。

After investigating, I figured out the issue:
those users had set their position mode to "Device Only" or also called "GPS only" in their device's setting.

当用户切换到高精度模式,在整个工作在不到一秒的时间。

When the user switches to "High Accuracy mode", the whole works in less than a second.

如何在不通知用户切换到高精度模式解决这个问题? 是不是一个错误?

How to fix this issue without advising user to switch to "High accuracy mode" ? Is it a bug?

请注意,我还测试了 enableHighAccuracy:假,但同样的结果。

Note that I also tested with enableHighAccuracy: false, but same result.

我没有这个大的问题只有一个:
的PhoneGap - 地理位置具有省电和GPS Only模式
但没有答案。

I'm not the only one having this "big" issue:
Phonegap - Geolocation with PowerSaving and GPS Only Mode
but unanswered..

推荐答案

我奋斗这个问题了三天,并没有解决方案。它只是不工作,从来没有。所以我会尝试用另一种工具,因为科尔多瓦只是不适合用于地理定位的目的。现在我专注于Java和我想正确做到这一点(IOS是奖金,当我选择科尔多瓦)。

I struggle that issue for three days, and there is no solution. It just not working and never been. So I will try use another tool, because cordova just don't fit for geolocation purposes. Now I'm focus on java and I want do this properly (ios was a bonus, when I choose cordova).

这篇关于超时约地理位置总能达到时,位置模式设置为QUOT;设备只"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆