cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sgrebnov <...@git.apache.org>
Subject [GitHub] cordova-plugin-geolocation pull request: CB-10278 geolocation watc...
Date Wed, 30 Dec 2015 11:52:57 GMT
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-geolocation/pull/63#discussion_r48600376
  
    --- Diff: www/android/geolocation.js ---
    @@ -38,21 +39,29 @@ module.exports = {
         },
     
         watchPosition: function(success, error, args) {
    +        var pluginWatchId = utils.createUUID();
    +
             var win = function() {
                 var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window,
'navigator.geolocation');
    -            geo.watchPosition(success, error, {
    +            pluginToNativeWatchMap[pluginWatchId] = geo.watchPosition(success, error,
{
                     enableHighAccuracy: args[1]
                 });
             };
             exec(win, error, "Geolocation", "getPermission", []);
    +
    +        return pluginWatchId;
         },
     
    -    clearWatch: function(success, error, args) {
    +    clearWatch: function(pluginWatchId) {
             var win = function() {
    -          var geo = cordova.require('cordova/modulemapper').getOriginalSymbol(window,
'navigator.geolocation');
    -          geo.clearWatch(args[0]);
    +            var nativeWatchId = pluginToNativeWatchMap[pluginWatchId];
    --- End diff --
    
    I tested this case and incorrect value (which does not exist or undefined) was ignored
w/o any error or exception


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message