You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2013/04/12 20:36:17 UTC
[jira] [Updated] (CB-3027) getCurrentPosition timeout does not work
and it blocks application execution
[ https://issues.apache.org/jira/browse/CB-3027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shazron Abdullah updated CB-3027:
---------------------------------
Description:
I have experienced this problem with cordova 2.5 & 2.6 in iOS 6.1.3, iPhone 4.
Timeout param is not working, so I decided to implement the same behavior with timing-function, however _getCurrentPosition_ seems to be executed synchronously instead of asynchronously, and because _timeout_ does not work, neither locationTimeout function or error callback are executed and the application is blocked waiting for getCurrentPosition response.
{code}
var positionError = function() {
/// do something on error
};
var locationTimeout = window.setTimeout(function() {
// work-around to solve timeout error
positionError();
}, 1000);
navigator.geolocation.getCurrentPosition( function(response) {
clearTimeout(locationTimeout);
positionNext(response);
}, function(error) {
clearTimeout(locationTimeout);
positionError();
}, { maximumAge: 3000, timeout: 1000 });
{code}
Could I misunderstand any internal functionality?
was:
The description of the issue was reported:
https://github.com/shazron/phonegap-questions/issues/10
> getCurrentPosition timeout does not work and it blocks application execution
> ----------------------------------------------------------------------------
>
> Key: CB-3027
> URL: https://issues.apache.org/jira/browse/CB-3027
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 2.5.0, 2.6.0
> Environment:
> Reporter: Pepe Cano
> Assignee: Shazron Abdullah
> Priority: Critical
>
> I have experienced this problem with cordova 2.5 & 2.6 in iOS 6.1.3, iPhone 4.
> Timeout param is not working, so I decided to implement the same behavior with timing-function, however _getCurrentPosition_ seems to be executed synchronously instead of asynchronously, and because _timeout_ does not work, neither locationTimeout function or error callback are executed and the application is blocked waiting for getCurrentPosition response.
> {code}
> var positionError = function() {
> /// do something on error
> };
> var locationTimeout = window.setTimeout(function() {
> // work-around to solve timeout error
> positionError();
> }, 1000);
> navigator.geolocation.getCurrentPosition( function(response) {
> clearTimeout(locationTimeout);
> positionNext(response);
> }, function(error) {
> clearTimeout(locationTimeout);
> positionError();
> }, { maximumAge: 3000, timeout: 1000 });
> {code}
> Could I misunderstand any internal functionality?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira