summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLCoordinateFormatter.h
blob: 63f0de8f1926ba52a649007e872eb58e2c2a3c29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

#import "MGLFoundation.h"

NS_ASSUME_NONNULL_BEGIN

/**
 The `MGLCoordinateFormatter` class provides properly formatted descriptions of
 geographic coordinate pairs. Use this class to create localized coordinate
 strings when displaying location information to users.
 */
MGL_EXPORT
@interface MGLCoordinateFormatter : NSFormatter

/**
 Determines whether the output may contain minutes of arc when nonzero.

 The default value of this property is `YES`, causing the receiver to include
 minutes of arc in its output. If `allowsSeconds` is `YES`, this property is
 ignored and the output always includes minutes of arc.
 */
@property (nonatomic) BOOL allowsMinutes;

/**
 Determines whether the output may contain seconds of arc when nonzero.

 The default value of this property is `YES`, causing the receiver to include
 seconds of arc in its output.
 */
@property (nonatomic) BOOL allowsSeconds;

/**
 The unit style used by this formatter.

 The default value of this property is `NSFormattingUnitStyleMedium`.
 */
@property (nonatomic) NSFormattingUnitStyle unitStyle;

/**
 Returns a coordinate string for the provided value.

 @param coordinate The coordinate’s value.
 @return The coordinate string appropriately formatted for the formatter’s
    locale.
 */
- (NSString *)stringFromCoordinate:(CLLocationCoordinate2D)coordinate;

/**
 This method is not supported for the `MGLCoordinateFormatter` class.
 */
- (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error;

@end

NS_ASSUME_NONNULL_END