You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2016/01/04 09:05:13 UTC

[1/4] cordova-plugin-geolocation git commit: CB-2845 PositionError constants not attached to prototype as specified in W3C document

Repository: cordova-plugin-geolocation
Updated Branches:
  refs/heads/master 1af21d083 -> 4f9dcf02f


CB-2845 PositionError constants not attached to prototype as specified in W3C document

https://issues.apache.org/jira/browse/CB-2845

github close #58


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/1095cc87
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/1095cc87
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/1095cc87

Branch: refs/heads/master
Commit: 1095cc871da8d6a722f15818bfa967a7b83ae6c2
Parents: 1af21d0
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Dec 28 14:31:44 2015 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Jan 4 11:01:29 2016 +0300

----------------------------------------------------------------------
 www/PositionError.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/1095cc87/www/PositionError.js
----------------------------------------------------------------------
diff --git a/www/PositionError.js b/www/PositionError.js
index 9403f11..9456240 100644
--- a/www/PositionError.js
+++ b/www/PositionError.js
@@ -31,8 +31,8 @@ var PositionError = function(code, message) {
     this.message = message || '';
 };
 
-PositionError.PERMISSION_DENIED = 1;
-PositionError.POSITION_UNAVAILABLE = 2;
-PositionError.TIMEOUT = 3;
+PositionError.prototype.PERMISSION_DENIED = PositionError.PERMISSION_DENIED = 1;
+PositionError.prototype.POSITION_UNAVAILABLE = PositionError.POSITION_UNAVAILABLE = 2;
+PositionError.prototype.TIMEOUT = PositionError.TIMEOUT = 3;
 
 module.exports = PositionError;


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


[2/4] cordova-plugin-geolocation git commit: CB-7146 Remove built-in WebView navigator.geolocation manual tests

Posted by sg...@apache.org.
CB-7146 Remove built-in WebView navigator.geolocation manual tests

github close #59


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/fe054593
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/fe054593
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/fe054593

Branch: refs/heads/master
Commit: fe054593f307f174bf3b880725f89936e924caf6
Parents: 1095cc8
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Dec 28 21:42:32 2015 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Jan 4 11:03:12 2016 +0300

----------------------------------------------------------------------
 tests/tests.js | 66 ++++++++++++-----------------------------------------
 1 file changed, 15 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/fe054593/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index ddd5c18..b32607b 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -222,23 +222,15 @@ exports.defineAutoTests = function () {
 /******************************************************************************/
 
 exports.defineManualTests = function (contentEl, createActionButton) {
-    var newGeolocation = navigator.geolocation;
-    var origGeolocation = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');
-    if (!origGeolocation) {
-        origGeolocation = newGeolocation;
-        newGeolocation = null;
-    }
-
     var watchLocationId = null;
 
     /**
      * Start watching location
      */
-    var watchLocation = function (usePlugin) {
-        console.log("watchLocation()");
-        var geo = usePlugin ? newGeolocation : origGeolocation;
+    var watchLocation = function () {
+        var geo = navigator.geolocation;
         if (!geo) {
-            alert('geolocation object is missing. usePlugin = ' + usePlugin);
+            alert('navigator.geolocation object is missing.');
             return;
         }
 
@@ -261,11 +253,10 @@ exports.defineManualTests = function (contentEl, createActionButton) {
     /**
      * Stop watching the location
      */
-    var stopLocation = function (usePlugin) {
-        console.log("stopLocation()");
-        var geo = usePlugin ? newGeolocation : origGeolocation;
+    var stopLocation = function () {
+        var geo = navigator.geolocation;
         if (!geo) {
-            alert('geolocation object is missing. usePlugin = ' + usePlugin);
+            alert('navigator.geolocation object is missing.');
             return;
         }
         setLocationStatus("Stopped");
@@ -278,11 +269,10 @@ exports.defineManualTests = function (contentEl, createActionButton) {
     /**
      * Get current location
      */
-    var getLocation = function (usePlugin, opts) {
-        console.log("getLocation()");
-        var geo = usePlugin ? newGeolocation : origGeolocation;
+    var getLocation = function (opts) {
+        var geo = navigator.geolocation;
         if (!geo) {
-            alert('geolocation object is missing. usePlugin = ' + usePlugin);
+            alert('navigator.geolocation object is missing.');
             return;
         }
 
@@ -378,16 +368,6 @@ exports.defineManualTests = function (contentEl, createActionButton) {
             '</table>' +
             '</div>',
         actions =
-            '<h2>Use Built-in WebView navigator.geolocation</h2>' +
-            '<div id="built-in-getLocation"></div>' +
-            'Expected result: Will update all applicable values in status box for current location. Status will read Retrieving Location (may not see this if location is retrieved immediately) then Done.' +
-            '<p/> <div id="built-in-watchLocation"></div>' +
-            'Expected result: Will update all applicable values in status box for current location and update as location changes. Status will read Running.' +
-            '<p/> <div id="built-in-stopLocation"></div>' +
-            'Expected result: Will stop watching the location so values will not be updated. Status will read Stopped.' +
-            '<p/> <div id="built-in-getOld"></div>' +
-            'Expected result: Will update location values with a cached position that is up to 30 seconds old. Verify with time value. Status will read Done.' +
-            '<h2>Use Cordova Geolocation Plugin</h2>' +
             '<div id="cordova-getLocation"></div>' +
             'Expected result: Will update all applicable values in status box for current location. Status will read Retrieving Location (may not see this if location is retrieved immediately) then Done.' +
             '<p/> <div id="cordova-watchLocation"></div>' +
@@ -401,38 +381,22 @@ exports.defineManualTests = function (contentEl, createActionButton) {
         note = 
             '<h3>Allow use of current location, if prompted</h3>';
 
-    contentEl.innerHTML = values_info + location_div + latitude + longitude + altitude + 
-        accuracy + heading + speed + altitude_accuracy + time + note + actions;
-
-    createActionButton('Get Location', function () {
-        getLocation(false);
-    }, 'built-in-getLocation');
-
-    createActionButton('Start Watching Location', function () {
-        watchLocation(false);
-    }, 'built-in-watchLocation');
-
-    createActionButton('Stop Watching Location', function () {
-        stopLocation(false);
-    }, 'built-in-stopLocation');
-
-    createActionButton('Get Location Up to 30 Sec Old', function () {
-        getLocation(false, { maximumAge: 30000 });
-    }, 'built-in-getOld');
+    contentEl.innerHTML = values_info + location_div + latitude + longitude + altitude + accuracy + heading + speed
+        + altitude_accuracy + time + note + actions;
 
     createActionButton('Get Location', function () {
-        getLocation(true);
+        getLocation();
     }, 'cordova-getLocation');
 
     createActionButton('Start Watching Location', function () {
-        watchLocation(true);
+        watchLocation();
     }, 'cordova-watchLocation');
 
     createActionButton('Stop Watching Location', function () {
-        stopLocation(true);
+        stopLocation();
     }, 'cordova-stopLocation');
 
     createActionButton('Get Location Up to 30 Sec Old', function () {
-        getLocation(true, { maximumAge: 30000 });
+        getLocation({ maximumAge: 30000 });
     }, 'cordova-getOld');
 };


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


[3/4] cordova-plugin-geolocation git commit: CB-10204 Fix getCurrentPosition options on Android

Posted by sg...@apache.org.
CB-10204 Fix getCurrentPosition options on Android

github close #60


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/8cf37567
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/8cf37567
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/8cf37567

Branch: refs/heads/master
Commit: 8cf37567c4c144303c59128664db71abe196bc23
Parents: fe05459
Author: sgrebnov <v-...@microsoft.com>
Authored: Mon Dec 28 22:18:29 2015 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Jan 4 11:04:14 2016 +0300

----------------------------------------------------------------------
 www/android/geolocation.js | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/8cf37567/www/android/geolocation.js
----------------------------------------------------------------------
diff --git a/www/android/geolocation.js b/www/android/geolocation.js
index 82e3582..df08071 100644
--- a/www/android/geolocation.js
+++ b/www/android/geolocation.js
@@ -29,10 +29,7 @@ module.exports = {
     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]
-          });
+          geo.getCurrentPosition(success, error, args);
         };
         exec(win, error, "Geolocation", "getPermission", []);
     },
@@ -40,9 +37,7 @@ module.exports = {
     watchPosition: function(success, error, args) {
         var win = function() {
             var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window, 'navigator.geolocation');
-            geo.watchPosition(success, error, {
-                enableHighAccuracy: args[1]
-            });
+            geo.watchPosition(success, error, args);
         };
         exec(win, error, "Geolocation", "getPermission", []);
     },


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


[4/4] cordova-plugin-geolocation git commit: CB-8443 Android: nothing happens if GPS is turned off

Posted by sg...@apache.org.
CB-8443 Android: nothing happens if GPS is turned off

github close #61


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/commit/4f9dcf02
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/tree/4f9dcf02
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/diff/4f9dcf02

Branch: refs/heads/master
Commit: 4f9dcf02f7c4bfc979abbf10a0676ece6459740f
Parents: 8cf3756
Author: sgrebnov <v-...@microsoft.com>
Authored: Tue Dec 29 10:06:42 2015 +0300
Committer: sgrebnov <v-...@microsoft.com>
Committed: Mon Jan 4 11:05:01 2016 +0300

----------------------------------------------------------------------
 README.md | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation/blob/4f9dcf02/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index c213a5b..74695ea 100644
--- a/README.md
+++ b/README.md
@@ -140,6 +140,11 @@ error, the `geolocationError` callback is passed a
 
     navigator.geolocation.getCurrentPosition(onSuccess, onError);
 
+### Android Quirks
+
+If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified).
+If `timeout` parameter is not specified then no callback is called.
+
 ## navigator.geolocation.watchPosition
 
 Returns the device's current position when a change in position is detected.
@@ -206,7 +211,8 @@ Optional parameters to customize the retrieval of the geolocation
 
 ### Android Quirks
 
-Android 2.x emulators do not return a geolocation result unless the `enableHighAccuracy` option is set to `true`.
+If Geolocation service is turned off the `onError` callback is invoked after `timeout` interval (if specified).
+If `timeout` parameter is not specified then no callback is called.
 
 ## navigator.geolocation.clearWatch
 


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