MBMCoordinateBounds


@interface MBMCoordinateBounds : NSObject

A rectangular area as measured on a two-dimensional map projection.

  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (nonnull instancetype)init NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    + (nonnull instancetype)new NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSouthwest:(CLLocationCoordinate2D)southwest
                                    northeast:(CLLocationCoordinate2D)northeast;

    Swift

    init(southwest: CLLocationCoordinate2D, northeast: CLLocationCoordinate2D)
  • Undocumented

    Declaration

    Objective-C

    - (nonnull instancetype)initWithSouthwest:(CLLocationCoordinate2D)southwest
                                    northeast:(CLLocationCoordinate2D)northeast
                               infiniteBounds:(BOOL)infiniteBounds;

    Swift

    init(southwest: CLLocationCoordinate2D, northeast: CLLocationCoordinate2D, infiniteBounds: Bool)
  • Returns a bounds covering the entire (unwrapped) world.

    Declaration

    Objective-C

    + (nonnull MBMCoordinateBounds *)world;

    Return Value

    The newly constructed record.

  • Returns the bounds consisting of the single point.

    Declaration

    Objective-C

    + (nonnull MBMCoordinateBounds *)singletonForPoint:
        (CLLocationCoordinate2D)point;

    Parameters

    point

    The coordinate of all corners of the bounds.

    Return Value

    The newly constructed singleton bounds record.

  • Returns the convex hull of two points; the smallest bounds that contains both.

    Declaration

    Objective-C

    + (nonnull MBMCoordinateBounds *)hullForA:(CLLocationCoordinate2D)a
                                            b:(CLLocationCoordinate2D)b;

    Parameters

    a

    The first of the two coordinates to fit.

    b

    The second of the two coordinates to fit.

    Return Value

    The newly constructed record.

  • Returns whether the bounds are valid or not.

    Declaration

    Objective-C

    - (BOOL)isValid;

    Return Value

    true if southwest is the same or south-west of northeast, false otherwise.

  • Returns the southern latitude of the bounds.

    Declaration

    Objective-C

    - (double)south;

    Return Value

    The southern latitude of the bounds.

  • Returns the western longitude of the bounds.

    Declaration

    Objective-C

    - (double)west;

    Return Value

    The western longitude of the bounds.

  • Returns the northern latitude of the bounds.

    Declaration

    Objective-C

    - (double)north;

    Return Value

    The northern latitude of the bounds.

  • Returns the eastern longitude of the bounds.

    Declaration

    Objective-C

    - (double)east;

    Return Value

    The eastern longitude of the bounds.

  • Returns the southeast coordinate of the bounds.

    Declaration

    Objective-C

    - (CLLocationCoordinate2D)southeast;

    Return Value

    The southeast coordinate of the bounds.

  • Returns the northwest coordinate of the bounds.

    Declaration

    Objective-C

    - (CLLocationCoordinate2D)northwest;

    Return Value

    The northwest coordinate of the bounds.

  • Returns the center coordinate of the bounds.

    Declaration

    Objective-C

    - (CLLocationCoordinate2D)center;

    Return Value

    The center coordinate of the bounds.

  • Constrains point against the bounds.

    Declaration

    Objective-C

    - (CLLocationCoordinate2D)constrainForPoint:(CLLocationCoordinate2D)point;

    Swift

    func constrain(forPoint point: CLLocationCoordinate2D) -> CLLocationCoordinate2D

    Parameters

    point

    The coordinate to be constrained.

  • Returns whether the bounds are empty or not.

    Declaration

    Objective-C

    - (BOOL)isEmpty;

    Return Value

    true if the bounds are empty, false otherwise.

  • Returns whether the bounds are infinite or bounded.

    Declaration

    Objective-C

    - (BOOL)isBounded;

    Return Value

    true if the bounds are not infinite, false otherwise.

  • Returns whether the bounds cross the date line or not.

    Declaration

    Objective-C

    - (BOOL)crossesAntimeridian;

    Return Value

    true if the bounds cross the antimeridian, false otherwise.

  • Returns whether the bounds contains point or not.

    Declaration

    Objective-C

    - (BOOL)containsForPoint:(CLLocationCoordinate2D)point
          wrappedCoordinates:(BOOL)wrappedCoordinates;

    Swift

    func contains(forPoint point: CLLocationCoordinate2D, wrappedCoordinates: Bool) -> Bool

    Parameters

    point

    The coordinate to be checked against the bounds.

    wrappedCoordinates

    Whether to wrap the coordinate or not.

    Return Value

    true if the bounds contains point, false otherwise.

  • Returns whether the bounds contains area or not.

    Declaration

    Objective-C

    - (BOOL)containsForArea:(nonnull MBMCoordinateBounds *)area
         wrappedCoordinates:(BOOL)wrappedCoordinates;

    Swift

    func contains(forArea area: CoordinateBounds, wrappedCoordinates: Bool) -> Bool

    Parameters

    area

    The area to be checked against the bounds.

    wrappedCoordinates

    Whether to wrap the coordinate or not.

    Return Value

    true if the bounds contains area, false otherwise.

  • Returns whether the bounds contains latitude or not.

    Declaration

    Objective-C

    - (BOOL)containsLatitudeForLatitude:(double)latitude;

    Swift

    func containsLatitude(forLatitude latitude: Double) -> Bool

    Parameters

    latitude

    The latitude to be checked against the bounds.

    Return Value

    true if the bounds contains latitude, false otherwise.

  • Returns whether the bounds contains longitude or not.

    Declaration

    Objective-C

    - (BOOL)containsLongitudeForLongitude:(double)longitude;

    Swift

    func containsLongitude(forLongitude longitude: Double) -> Bool

    Parameters

    longitude

    The longitude to be checked against the bounds.

    Return Value

    true if the bounds contains longitude, false otherwise.

  • Returns the absolute distance, in degrees, between the north and south boundaries of these bounds.

    Declaration

    Objective-C

    - (double)latitudeSpan;

    Return Value

    Span distance

  • Returns the absolute distance, in degrees, between the west and east boundaries of these bounds.

    Declaration

    Objective-C

    - (double)longitudeSpan;

    Return Value

    Span distance

  • Returns whether the bounds intersects area or not.

    Declaration

    Objective-C

    - (BOOL)intersectsForArea:(nonnull MBMCoordinateBounds *)area
           wrappedCoordinates:(BOOL)wrappedCoordinates;

    Swift

    func intersects(forArea area: CoordinateBounds, wrappedCoordinates: Bool) -> Bool

    Parameters

    area

    The area to be checked against the bounds.

    wrappedCoordinates

    Whether to wrap the coordinate or not.

    Return Value

    true if the bounds intersects area, false otherwise.

  • Extends these bounds to include point.

    Declaration

    Objective-C

    - (nonnull MBMCoordinateBounds *)extendForPoint:(CLLocationCoordinate2D)point;

    Swift

    func extend(forPoint point: CLLocationCoordinate2D) -> CoordinateBounds

    Parameters

    point

    The coordinate to be included.

    Return Value

    The extended bounds.

  • Extends these bounds to include area.

    Declaration

    Objective-C

    - (nonnull MBMCoordinateBounds *)extendForArea:
        (nonnull MBMCoordinateBounds *)area;

    Swift

    func extend(forArea area: CoordinateBounds) -> CoordinateBounds

    Parameters

    area

    The bounds to be included.

    Return Value

    The extended bounds.

  • Coordinate at the southwest corner. Note: setting this field with invalid values (infinite, NaN) will crash the application.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CLLocationCoordinate2D southwest;

    Swift

    var southwest: CLLocationCoordinate2D { get }
  • Coordinate at the northeast corner. Note: setting this field with invalid values (infinite, NaN) will crash the application.

    Declaration

    Objective-C

    @property (nonatomic, readonly) CLLocationCoordinate2D northeast;

    Swift

    var northeast: CLLocationCoordinate2D { get }
  • If set to true, an infinite (unconstrained) bounds covering the world coordinates would be used. Coordinates provided in southwest and northeast fields would be omitted and have no effect.

    Declaration

    Objective-C

    @property (nonatomic, readonly, getter=isInfiniteBounds) BOOL infiniteBounds;

    Swift

    var isInfiniteBounds: Bool { get }