summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2018-06-25 12:01:37 -0700
committerFabian Guerra <fabian.guerra@mapbox.com>2018-07-20 09:46:38 -0700
commit6beaf6402b2c19693f7257c48919d8af69bbba16 (patch)
tree678d03b7ff148c7497bb4801a301f0a510fea73e
parent667abe170696d9acbab4d67ae89f8598ca0c0fbc (diff)
downloadqtlocation-mapboxgl-6beaf6402b2c19693f7257c48919d8af69bbba16.tar.gz
[ios] Improve custom location manager documentation.
-rw-r--r--platform/darwin/src/MGLLocationManager.h51
-rw-r--r--platform/ios/src/MGLMapView.h7
2 files changed, 57 insertions, 1 deletions
diff --git a/platform/darwin/src/MGLLocationManager.h b/platform/darwin/src/MGLLocationManager.h
index a2b237942c..cb15f151fd 100644
--- a/platform/darwin/src/MGLLocationManager.h
+++ b/platform/darwin/src/MGLLocationManager.h
@@ -13,19 +13,55 @@ NS_ASSUME_NONNULL_BEGIN
@required
+/**
+ The delegate to recive updates.
+ */
@property (nonatomic, weak) id<MGLLocationManagerDelegate> delegate;
+
+/**
+ Specifies a physical device orientation.
+ */
@property (nonatomic) CLDeviceOrientation headingOrientation;
+
+/**
+ Returns the current localization authorization status.
+ */
@property (nonatomic, readonly) CLAuthorizationStatus authorizationStatus;
+/**
+ Starts the generation of location updates that reports the user's current location.
+ */
- (void)startUpdatingLocation;
-- (void)startUpdatingHeading;
+/**
+ Stops the generation of location updates.
+ */
- (void)stopUpdatingLocation;
+
+/**
+ Starts the generation of heading updates that reports the user's current hading.
+ */
+- (void)startUpdatingHeading;
+
+/**
+ Stops the generation of heading updates.
+ */
- (void)stopUpdatingHeading;
+/**
+ Requests permission to use the location services whenever the app is running.
+ */
- (void)requestAlwaysAuthorization;
+
+/**
+ Requests permission to use the location services while the app is in
+ the foreground.
+ */
- (void)requestWhenInUseAuthorization;
+/**
+ Dissmisses immediately the heading calibration view from screen.
+ */
- (void)dismissHeadingCalibrationDisplay;
@end
@@ -36,14 +72,27 @@ NS_ASSUME_NONNULL_BEGIN
*/
@protocol MGLLocationManagerDelegate <NSObject>
+/**
+ Notifies the delegate with the new location data.
+ */
- (void)locationManager:(id<MGLLocationManager>)manager
didUpdateLocations:(NSArray<CLLocation *> *)locations;
+/**
+ Notifies the delegate with the new heading data.
+ */
- (void)locationManager:(id<MGLLocationManager>)manager
didUpdateHeading:(CLHeading *)newHeading;
+/**
+ Asks the delegate if the calibration alert should be displayed.
+ */
- (BOOL)locationManagerShouldDisplayHeadingCalibration:(id<MGLLocationManager>)manager;
+/**
+ Notifies the delegate that the location manager was unable to retrieve
+ location updates.
+ */
- (void)locationManager:(id<MGLLocationManager>)manager
didFailWithError:(nonnull NSError *)error;
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index e43d219485..22f76fdf75 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -296,6 +296,13 @@ MGL_EXPORT IB_DESIGNABLE
#pragma mark Displaying the User’s Location
+/**
+ The object that this map view uses to start and stop the delivery of location-related
+ events.
+
+ If no custom manager is provided or setting this property to `nil` it will default
+ to the internal `CLLocationManager` based implementation.
+ */
@property (nonatomic, nullable) id<MGLLocationManager> locationManager;
/**