You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/08/03 23:43:03 UTC

[GitHub] [cordova-plugin-geolocation] liquidcms opened a new issue #205: Accuracy concerns.

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


   # Bug Report
   Not entirely sure if this is a question(s) or a bug report. I often get coords at least 20m from the true location. Wondering how this is possible as well as why my Google Maps app on the same device is rarely off more than a few feet. 
   
   ## Problem
   Please see the image of a few test runs:
   
   ![map1](https://user-images.githubusercontent.com/355815/89236585-00f8da00-d5bf-11ea-9ee9-738acdc782ac.jpg)
   
   The red markers are created from coords obtained from this plugin. The numbers in the black boxes correspond to the real location when the associated red marker was created. You can see the markers 1 to 5 are all extremely close, even though the accuracy value from the plugin stated anywhere between 10 and 20m. Markers 6 to 8 however are at least 20m off from the correct location. The plugin returned accuracy for these is anywhere from 13m to 20m.
   
   Position 6 to 8 are all on an open city street with significant view of the sky. I have repeated measurements at this location on numerous days and always get values returned close to where shown above (off by over 20m).
   
   enableHighAccuracy is set to TRUE.
   
   As mentioned above, my Google Maps app shows my location to always be within 3m of my actual location.
   
   ### What is expected to happen?
   I think results should always be within 3m of the correct location.
   
   ### What does actually happen?
   At some locations on the same street, results are very close (even though accuracy states 10+m). But, at other locations on the same street, results are off by as much as 20m or more and do not come close to matching Google Maps results on same device.
   
   ## Information
   
   ### Command or Code
   I think the only code of interest would be whether or not i have set High Accuracy correctly. Taken from numerous posts, I use this:
   
   ```
       this.location.getCurrentPosition({enableHighAccuracy: true}).then((resp) => {
         var lat = resp.coords.latitude;
         var lng = resp.coords.longitude;
         var latLng = {lat: lat, lng: lng};
         var accuracy = resp.coords.accuracy;
   
         this.loading.dismiss();
         this.common.log(JSON.stringify(location, null ,2));
   
         // Move the map camera to the location with animation
         this.map.animateCamera({
           target: latLng,
           //zoom: 17,
           tilt: 30
         });
   
         // add a marker
         let marker = this.map.addMarkerSync({
           title: 'Current Location',
           snippet: 'lat: ' + lat + this.LF + 'long: ' + lng + this.LF + "accuracy: " + accuracy,
           position: latLng,
           //animation: GoogleMapsAnimation.BOUNCE
         });
         // show the infoWindow
         marker.showInfoWindow();
   
         // If clicked it, display the alert
         marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
           this.showToast('clicked!');
         });
   
       }
   ```
   
   ### Environment, Platform, Device
   App is build with Ionic 5 (although unlikely that could matter here).
   
   Device used in tests is an LG G6 - but again, Google Maps results on this device are very accurate. Android ver: 9
   
   ### Version information
   Ionic:
      Ionic CLI                     : 6.10.1 (C:\Users\Peter\AppData\Roaming\npm\node_modules\@ionic\cli)
      Ionic Framework               : @ionic/angular 5.1.1
      @angular-devkit/build-angular : 0.901.6
      @angular-devkit/schematics    : 9.1.6
      @angular/cli                  : 9.1.6
      @ionic/angular-toolkit        : 2.2.0
   
   Capacitor:
      Capacitor CLI   : 2.1.0
      @capacitor/core : 2.1.0
   
   Cordova:
   
      Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
      Cordova Platforms : android 8.1.0, browser 6.0.0
      Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 9 other plugins)
   
   Utility:
      cordova-res                          : not installed
      native-run (update available: 1.0.0) : 0.2.8
   
   System:
      Android SDK Tools : 26.1.1 (C:\android-sdk)
      NodeJS            : v12.18.2 (C:\Program Files\nodejs\node.exe)
      npm               : 6.14.5
      OS                : Windows 7
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [X] I searched for existing GitHub issues
   - [X] I updated all Cordova tooling to most recent version
   - [X] I included all the necessary information above
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-geolocation] breautek closed issue #205: Accuracy concerns.

Posted by GitBox <gi...@apache.org>.
breautek closed issue #205:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/205


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-geolocation] breautek commented on issue #205: Accuracy concerns.

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #205:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/205#issuecomment-673766367


   On android, Cordova doesn't provide a geolocation implementation. It uses the browser implementation, because of this I can only really provide a rough guess.
   
   Google Maps using native APIs has much more fine control options available, while the browser implementation is mostly hard-coded, and perhaps configured more to save battery power instead of accuracy. In my experience, most devices will yield between a 5m-10m accuracy reading assuming a healthy satellite connection, with assisted GPS enabled, using the browser-based implementation.
   
   There are third-party plugins [available](https://www.npmjs.com/search?q=cordova-plugin-locationservices) that implements Geolocation using the Google APIs you can try to see if it improves things for your case. I personally use [cordova-plugin-locationservices](https://www.npmjs.com/package/cordova-plugin-locationservices), in one of my apps.
   
   I don't really see this as an issue that Cordova can resolve so I'll be closing this.
   
   > Same here, but worst on IOS. Have seen a similar issue bug in ionic repo : ionic-team/ionic-native#1691.
   
   On iOS, Cordova does provide a geolocation implement, so if there is a problem on on iOS, cordova *may* be able to do something, however, in my experience, most accuracy-related issues are related to environment or device settings. I have a [gist](https://gist.github.com/breautek/d6231fa33d6942c269296546892afb5e) that goes into more detail.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-geolocation] pseudooriginal commented on issue #205: Accuracy concerns.

Posted by GitBox <gi...@apache.org>.
pseudooriginal commented on issue #205:
URL: https://github.com/apache/cordova-plugin-geolocation/issues/205#issuecomment-672731675


   Same here, but worst on IOS. Have seen a similar issue bug in ionic repo : https://github.com/ionic-team/ionic-native/issues/1691.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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