ravikumarb-cube commented on issue #255:
URL: 
https://github.com/apache/cordova-plugin-geolocation/issues/255#issuecomment-1337714230

   let trackGps;
   public captureCurrentLocation() {
       if (trackGps) {
         (window as any).LocationServices.clearWatch(this.trackGps);
       }
       const options = { // options for capturing the geolocation
         enableHighAccuracy: true,
         timeout: 10000,
         maximumAge: 0,
       };
   
       const success = (position: any) => {
         console.log('Your current position is:');
         console.log(`Latitude & Longitude : ${position}`);
       }
   
       const error = (err: any) => {
         console.log(`ERROR(${err.code}): ${err.message}`);
       }
       trackGps = (window as any).LocationServices.watchPosition(success, 
error, options);
   }


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