Rmadhuprasanth opened a new issue #233:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/233


   **ISSUE:I have been using  cordova-plugin-geolocation  in my project  but 
some times even if internet & Geolocation enabled the getCurrentposition  
passing lat&long 0 values**
   
   Plugin version: "cordova-plugin-geolocation": "^4.0.1"
   Error code:"Location error code: 3
                     message: Timeout expired"
   **Any quick Possible solution could be helpful
   Thanks in  Advance**
   
   ```
   getCurrentLocation = function getLocation() {
                return new Promise(function (resolve, reject) {
                        $geolocation.get().then(
                                function (position) {
                                        resolve(position)
                                },
                                function (error) {
                                        if (util.isNativeApp()) {
                                                
navigator.geolocation.getCurrentPosition(
                                                        function (position) {
                                                                
console.log('location success');
                                                                
resolve(position);
                                                        },
                                                        function (error) {
                                                resolve();
                                                        }, {
                                                                
enableHighAccuracy: true,
                                                                timeout: 30000, 
 // 0.5 minutes
                                                                maximumAge: 
60000
                                                        });
                                                return;
                                        }
                                        resolve()
   
                                });
   
                });
        }
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to