@@ -54,7 +54,7 @@ export class LocationManager {
5454
5555 public static isEnabled ( ) : boolean {
5656 var criteria = new android . location . Criteria ( ) ;
57- criteria . setAccuracy ( 1 ) ; // low ? fine ? who knows what 1 means (bug in android docs?)
57+ criteria . setAccuracy ( android . location . Criteria . ACCURACY_COARSE ) ;
5858 var lm = appModule . android . context . getSystemService ( android . content . Context . LOCATION_SERVICE ) ;
5959 return ( lm . getBestProvider ( criteria , true ) != null ) ? true : false ;
6060 }
@@ -71,7 +71,7 @@ export class LocationManager {
7171
7272 constructor ( ) {
7373 // put some defaults
74- this . desiredAccuracy = types . Accuracy . HIGH ;
74+ this . desiredAccuracy = types . Accuracy . ANY ;
7575 this . updateDistance = 0 ;
7676 this . minimumUpdateTime = 200 ;
7777 this . isStarted = false ;
@@ -86,7 +86,7 @@ export class LocationManager {
8686 public startLocationMonitoring ( onLocation : ( location : types . Location ) => any , onError ?: ( error : Error ) => any , options ?: types . Options ) {
8787 if ( ! this . isStarted ) {
8888 var criteria = new android . location . Criteria ( ) ;
89- criteria . setAccuracy ( ( this . desiredAccuracy === types . Accuracy . HIGH ) ? 1 : 2 ) ;
89+ criteria . setAccuracy ( ( this . desiredAccuracy === types . Accuracy . HIGH ) ? android . location . Criteria . ACCURACY_FINE : android . location . Criteria . ACCURACY_COARSE ) ;
9090 this . locationListener = < any > new android . location . LocationListener ( {
9191 onLocationChanged : function ( location1 : android . location . Location ) {
9292 if ( this . _onLocation ) {
@@ -153,7 +153,7 @@ export class LocationManager {
153153
154154 get lastKnownLocation ( ) : types . Location {
155155 var criteria = new android . location . Criteria ( ) ;
156- criteria . setAccuracy ( ( this . desiredAccuracy === types . Accuracy . HIGH ) ? 1 : 2 ) ;
156+ criteria . setAccuracy ( ( this . desiredAccuracy === types . Accuracy . HIGH ) ? android . location . Criteria . ACCURACY_FINE : android . location . Criteria . ACCURACY_COARSE ) ;
157157 try {
158158 var providers = this . androidLocationManager . getProviders ( criteria , false ) ;
159159 var it = providers . iterator ( ) ;
0 commit comments