You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Abhishek Kumar (JIRA)" <ji...@apache.org> on 2016/12/28 09:57:58 UTC

[jira] [Created] (CB-12301) Cordova geolocation plugin issue

Abhishek Kumar created CB-12301:
-----------------------------------

             Summary: Cordova geolocation plugin issue
                 Key: CB-12301
                 URL: https://issues.apache.org/jira/browse/CB-12301
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 6.4.0
         Environment: Android
            Reporter: Abhishek Kumar


Cordova geolocation plugin works only with phone's GPS location. If phone GPS is not locked (e.g. being inside the building), then it should take the COARSE_LOCATION i.e. WIFI or Cellular tower.  I checked it by providing it only the permission of only ACCESS_COARSE_LOCATION and commenting out the code for ACCESS_FINE_LOCATION. We get error code: 3 (timeout) in this case.


 $scope.showpopup=function(status){
                 console.log("show pop up function called");
                 var cont;
                 switch (status) {
                    case 1:
                        cont = "User denied the request for Geolocation."
                        break;
                    case 2:
                        cont = "Location information is unavailable."

                        break;
                    case 3:
                        cont = "The request to get user location timed out."
                        break;
                    default:
                        cont = "An unknown error occurred."
                        break;
                }
                $ionicPopup.alert({
                    title: 'Gps error',
                    content: cont
                });
        };


 navigator.geolocation.getCurrentPosition(
    function(position){
        //Variables to use for showing latitude and longitude by position.coords .
    },function(error){
        $scope.showpopup(error.code);
          },{timeout:10000,maximumAge:60000,enableHighAccuracy:true});



--
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