Skip to content

Commit

Permalink
Merge pull request #1931 from sptramer/timob-8517
Browse files Browse the repository at this point in the history
[TIMOB-8517] Add Ti.Geolocation.ACCURACY_HIGH / ACCURACY_LOW.
  • Loading branch information
Max Stepanov committed Apr 5, 2012
2 parents 53c2666 + 3fbf00e commit 8c92aee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apidoc/Titanium/Geolocation/Geolocation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ description: |
to one of the following values:
* [ACCURACY_BEST](Titanium.Geolocation.ACCURACY_BEST) (highest accuracy and power consumption)
* [ACCURACY_HIGH](Titanium.Geolocation.ACCURACY_HIGH)
* [ACCURACY_NEAREST_TEN_METERS](Titanium.Geolocation.ACCURACY_NEAREST_TEN_METERS)
* [ACCURACY_HUNDRED_METERS](Titanium.Geolocation.ACCURACY_HUNDRED_METERS)
* [ACCURACY_KILOMETER](Titanium.Geolocation.ACCURACY_KILOMETER)
* [ACCURACY_LOW](Titanium.Geolocation.ACCURACY_LOW)
* [ACCURACY_THREE_KILOMETERS](Titanium.Geolocation.ACCURACY_THREE_KILOMETERS) (lowest
accuracy and power consumption).
(Note that the constants [ACCURACY_HIGH](Titanium.Geolocation.ACCURACY_HIGH) and
[ACCURACY_LOW](Titanium.Geolocation.ACCURACY_LOW) are Android-specific and may not be
used with iOS.)
Based on the accuracy you choose, iOS uses its own logic to select location providers
and filter location updates to provide location updates that meet your accuracy
Expand Down Expand Up @@ -296,7 +294,7 @@ properties:
Using this value on Android enables *simple mode* operation.
type: Number
permission: read-only
platforms: [android]
platforms: [android, iphone, ipad]
since: "2.0.0"

- name: ACCURACY_LOW
Expand All @@ -307,7 +305,7 @@ properties:
Using this value on Android enables *simple mode* operation.
type: Number
permission: read-only
platforms: [android]
platforms: [android, iphone, ipad]
since: "2.0.0"

- name: AUTHORIZATION_AUTHORIZED
Expand Down
2 changes: 2 additions & 0 deletions iphone/Classes/GeolocationModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@
@property(nonatomic,readwrite,assign) NSString *purpose;

@property(nonatomic,readonly) NSNumber *ACCURACY_BEST;
@property(nonatomic,readonly) NSNumber *ACCURACY_HIGH;
@property(nonatomic,readonly) NSNumber *ACCURACY_NEAREST_TEN_METERS;
@property(nonatomic,readonly) NSNumber *ACCURACY_HUNDRED_METERS;
@property(nonatomic,readonly) NSNumber *ACCURACY_KILOMETER;
@property(nonatomic,readonly) NSNumber *ACCURACY_LOW;
@property(nonatomic,readonly) NSNumber *ACCURACY_THREE_KILOMETERS;

// Authorization to use location, 4.2+ only
Expand Down
2 changes: 2 additions & 0 deletions iphone/Classes/GeolocationModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,12 @@ -(void)restart:(id)arg
}

MAKE_SYSTEM_PROP_DBL(ACCURACY_BEST,kCLLocationAccuracyBest);
MAKE_SYSTEM_PROP_DBL(ACCURACY_HIGH,kCLLocationAccuracyBest);
MAKE_SYSTEM_PROP_DBL(ACCURACY_NEAREST_TEN_METERS,kCLLocationAccuracyNearestTenMeters);
MAKE_SYSTEM_PROP_DBL(ACCURACY_HUNDRED_METERS,kCLLocationAccuracyHundredMeters);
MAKE_SYSTEM_PROP_DBL(ACCURACY_KILOMETER,kCLLocationAccuracyKilometer);
MAKE_SYSTEM_PROP_DBL(ACCURACY_THREE_KILOMETERS,kCLLocationAccuracyThreeKilometers);
MAKE_SYSTEM_PROP_DBL(ACCURACY_LOW, kCLLocationAccuracyThreeKilometers);

#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_4_2
MAKE_SYSTEM_PROP(AUTHORIZATION_UNKNOWN, kCLAuthorizationStatusNotDetermined);
Expand Down

0 comments on commit 8c92aee

Please sign in to comment.