You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sergey Grebnov (JIRA)" <ji...@apache.org> on 2015/12/28 16:32:49 UTC

[jira] [Commented] (CB-10204) getCurrentPosition options are currently required on Android

    [ https://issues.apache.org/jira/browse/CB-10204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15072818#comment-15072818 ] 

Sergey Grebnov commented on CB-10204:
-------------------------------------

Actually, android geolocation proxy passes parameters incorrectly - args is an object, not array and should be passed as-is. I'll send PR soon. This will fix this issue as well.

> getCurrentPosition options are currently required on Android
> ------------------------------------------------------------
>
>                 Key: CB-10204
>                 URL: https://issues.apache.org/jira/browse/CB-10204
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Geolocation
>         Environment: Cordova 3.5.0, Plugin Geolocation 2.0.0
>            Reporter: Timo Salola
>              Labels: Android, Triaged
>
> In the latest release there was created separate JS file for android. In getCurrentPosition it does not verify that options are given resulting javascript error when trying to access undefined as an array at www/android/geolocation.js lines 33 and 34:
> {code:javascript}
>     getCurrentPosition: function(success, error, args) {
>         var win = function() {
>           var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');
>           geo.getCurrentPosition(success, error, {
>             enableHighAccuracy: args[0],
>             maximumAge: args[1]
>           });
>         };
>         exec(win, error, "Geolocation", "getPermission", []);
>     }
> {code}
> Workaround this is to give empty array to getCurrentPosition as options:
> {code:javascript}
> navigator.geolocation.getCurrentPosition(onSuccess, onError, []);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org