# MGLUserLocation

    @interface MGLUserLocation : NSObject <MGLAnnotation, NSSecureCoding>

The MGLUserLocation class defines a specific type of annotation that identifies the user’s current location. You do not create instances of this class directly. Instead, you retrieve an existing `MGLUserLocation` object from the `userLocation` property of the map view displayed in your application.

#### Related examples

See the Customize the user location annotation example to learn how to overide the default user location annotation.

### Determining the User’s Position

- `location`

  The current location of the device. (read-only)

  This property returns `nil` if the user’s location has not yet been determined.

  #### Declaration

  Objective-C

      @property (readonly, nonatomic, nullable) CLLocation *location;

  Swift

      var location: CLLocation? { get }

  View Source on GitHub
- `updating`

  A Boolean value indicating whether the user’s location is currently being updated. (read-only)

  #### Declaration

  Objective-C

      @property (readonly, getter=isUpdating, nonatomic) BOOL updating;

  Swift

      var isUpdating: Bool { get }

  View Source on GitHub
- `heading`

  The heading of the user location. (read-only)

  This property is `nil` if the user location tracking mode is not `MGLUserTrackingModeFollowWithHeading` or if `MGLMapView.showsUserHeadingIndicator` is disabled.

  #### Declaration

  Objective-C

      @property (readonly, nonatomic, nullable) CLHeading *heading;

  Swift

      var heading: CLHeading? { get }

  View Source on GitHub

### Accessing the User Annotation Text

- `title`

  The title to display for the user location annotation.

  #### Declaration

  Objective-C

      @property (readwrite, copy, nonatomic) NSString *_Nonnull title;

  Swift

      var title: String { get set }

  View Source on GitHub
- `subtitle`

  The subtitle to display for the user location annotation.

  #### Declaration

  Objective-C

      @property (readwrite, copy, nonatomic, nullable) NSString *subtitle;

  Swift

      var subtitle: String? { get set }

  View Source on GitHub