Geometry

  • The MGLClockDirectionFormatter class provides properly formatted descriptions of headings relative to the user, known as clock positions. For example, a value of 90 may be formatted as “3 o’clock”, depending on the locale.

    Use this class to create localized heading strings when displaying directions relative to the user’s current location and heading. To format a direction irrespective of the user’s orientation, use MGLCompassDirectionFormatter instead.

    See more

    Declaration

    Objective-C

    @interface MGLClockDirectionFormatter : NSFormatter

    Swift

    class MGLClockDirectionFormatter : NSFormatter
  • The MGLCompassDirectionFormatter class provides properly formatted descriptions of absolute headings. For example, a value of 90 may be formatted as “east”, depending on the locale.

    Use this class to create localized heading strings when displaying directions irrespective of the user’s current location. To format a direction relative to the user’s current location, use MGLCompassDirectionFormatter instead.

    See more

    Declaration

    Objective-C

    @interface MGLCompassDirectionFormatter : NSFormatter

    Swift

    class MGLCompassDirectionFormatter : NSFormatter
  • A rectangular area as measured on a two-dimensional map projection.

    See more

    Declaration

    Objective-C

    struct MGLCoordinateBounds {}

    Swift

    struct MGLCoordinateBounds
  • Returns YES if the two coordinate bounds are equal to each other.

    Declaration

    Objective-C

    static inline BOOL
    MGLCoordinateBoundsEqualToCoordinateBounds(MGLCoordinateBounds bounds1,
                                               MGLCoordinateBounds bounds2)

    Swift

    func MGLCoordinateBoundsEqualToCoordinateBounds(bounds1: MGLCoordinateBounds, _ bounds2: MGLCoordinateBounds) -> Bool
  • Returns the area spanned by the coordinate bounds.

    Declaration

    Objective-C

    static inline MGLCoordinateSpan
    MGLCoordinateBoundsGetCoordinateSpan(MGLCoordinateBounds bounds)

    Swift

    func MGLCoordinateBoundsGetCoordinateSpan(bounds: MGLCoordinateBounds) -> MGLCoordinateSpan
  • Returns YES if the coordinate bounds covers no area.

    Note

    A bounds may be empty but have a non-zero coordinate span (e.g., when its northeast point lies due north of its southwest point).

    Declaration

    Objective-C

    static inline BOOL MGLCoordinateBoundsIsEmpty(MGLCoordinateBounds bounds)

    Swift

    func MGLCoordinateBoundsIsEmpty(bounds: MGLCoordinateBounds) -> Bool
  • Creates a new MGLCoordinateBounds structure from the given southwest and northeast coordinates.

    Declaration

    Objective-C

    static inline MGLCoordinateBounds
    MGLCoordinateBoundsMake(CLLocationCoordinate2D sw, CLLocationCoordinate2D ne)

    Swift

    func MGLCoordinateBoundsMake(sw: CLLocationCoordinate2D, _ ne: CLLocationCoordinate2D) -> MGLCoordinateBounds
  • Returns a coordinate bounds with southwest and northeast coordinates that are offset from those of the source bounds.

    Declaration

    Objective-C

    static inline MGLCoordinateBounds
    MGLCoordinateBoundsOffset(MGLCoordinateBounds bounds, MGLCoordinateSpan offset)

    Swift

    func MGLCoordinateBoundsOffset(bounds: MGLCoordinateBounds, _ offset: MGLCoordinateSpan) -> MGLCoordinateBounds
  • Defines the area spanned by an MGLCoordinateBounds.

    See more

    Declaration

    Objective-C

    struct MGLCoordinateSpan {}

    Swift

    struct MGLCoordinateSpan
  • Returns YES if the two coordinate spans represent the same latitudinal change and the same longitudinal change.

    Declaration

    Objective-C

    static inline BOOL
    MGLCoordinateSpanEqualToCoordinateSpan(MGLCoordinateSpan span1,
                                           MGLCoordinateSpan span2)

    Swift

    func MGLCoordinateSpanEqualToCoordinateSpan(span1: MGLCoordinateSpan, _ span2: MGLCoordinateSpan) -> Bool
  • Creates a new MGLCoordinateSpan from the given latitudinal and longitudinal deltas.

    Declaration

    Objective-C

    static inline MGLCoordinateSpan
    MGLCoordinateSpanMake(CLLocationDegrees latitudeDelta,
                          CLLocationDegrees longitudeDelta)

    Swift

    func MGLCoordinateSpanMake(latitudeDelta: CLLocationDegrees, _ longitudeDelta: CLLocationDegrees) -> MGLCoordinateSpan
  • An area of zero width and zero height.

    Declaration

    Objective-C

    extern const MGLCoordinateSpan MGLCoordinateSpanZero

    Swift

    let MGLCoordinateSpanZero: MGLCoordinateSpan
  • Returns degrees, converted from radians.

    Declaration

    Objective-C

    static inline CLLocationDegrees MGLDegreesFromRadians(CGFloat radians)

    Swift

    func MGLDegreesFromRadians(radians: CGFloat) -> CLLocationDegrees
  • Returns radians, converted from degrees.

    Declaration

    Objective-C

    static inline CGFloat MGLRadiansFromDegrees(CLLocationDegrees degrees)

    Swift

    func MGLRadiansFromDegrees(degrees: CLLocationDegrees) -> CGFloat
  • Returns a formatted string for the given coordinate bounds.

    Declaration

    Objective-C

    static inline NSString *_Nonnull MGLStringFromCoordinateBounds(
        MGLCoordinateBounds bounds)

    Swift

    func MGLStringFromCoordinateBounds(bounds: MGLCoordinateBounds) -> String
  • 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.

    See more

    Declaration

    Objective-C

    @interface MGLCoordinateFormatter : NSFormatter

    Swift

    class MGLCoordinateFormatter : NSFormatter