Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10204

Fix getCurrentPosition options on Android

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Cordova 3.5.0, Plugin Geolocation 2.0.0

    Description

      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:

          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", []);
          }
      

      Workaround this is to give empty array to getCurrentPosition as options:

      navigator.geolocation.getCurrentPosition(onSuccess, onError, []);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            cultti Timo Salola
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: