GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSCoordinateBounds
@interface GMSCoordinateBounds : NSObject
GMSCoordinateBounds represents a rectangular bounding box on the Earth’s surface.
GMSCoordinateBounds is immutable and can’t be modified after construction.
-
The North-East corner of these bounds.
Declaration
Swift
var northEast: CLLocationCoordinate2D { get }
Objective-C
@property (nonatomic, readonly) CLLocationCoordinate2D northEast;
-
The South-West corner of these bounds.
Declaration
Swift
var southWest: CLLocationCoordinate2D { get }
Objective-C
@property (nonatomic, readonly) CLLocationCoordinate2D southWest;
-
Returns NO if this bounds does not contain any points. For example, [[GMSCoordinateBounds alloc]
init].valid == NO.
When an invalid bounds is expanded with valid coordinates via includingCoordinate: or
includingBounds:, the resulting bounds will be valid but contain only the new coordinates.
Declaration
Swift
var isValid: Bool { get }
Objective-C
@property (nonatomic, readonly, getter=isValid) BOOL valid;
-
Inits the northEast and southWest bounds corresponding to the rectangular region defined by the
two corners.
It is ambiguous whether the longitude of the box extends from |coord1| to |coord2| or vice-versa;
the box is constructed as the smaller of the two variants, eliminating the ambiguity.
Declaration
Swift
init(coordinate coord1: CLLocationCoordinate2D, coordinate coord2: CLLocationCoordinate2D)
Objective-C
- (nonnull id)initWithCoordinate:(CLLocationCoordinate2D)coord1
coordinate:(CLLocationCoordinate2D)coord2;
-
Returns a GMSCoordinateBounds representing the current bounds extended to include the passed-in
coordinate.
If the current bounds is invalid, the result is a valid bounds containing only |coordinate|.
Declaration
Swift
func includingCoordinate(_ coordinate: CLLocationCoordinate2D) -> GMSCoordinateBounds
Objective-C
- (nonnull GMSCoordinateBounds *)includingCoordinate:
(CLLocationCoordinate2D)coordinate;
-
Returns a GMSCoordinateBounds representing the current bounds extended to include the entire
other bounds.
If the current bounds is invalid, the result is a valid bounds equal to |other|.
Declaration
Swift
func includingBounds(_ other: GMSCoordinateBounds) -> GMSCoordinateBounds
Objective-C
- (nonnull GMSCoordinateBounds *)includingBounds:
(nonnull GMSCoordinateBounds *)other;
-
Returns YES if |coordinate| is contained within this bounds. This includes points that lie
exactly on the edge of the bounds.
Declaration
Swift
func contains(_ coordinate: CLLocationCoordinate2D) -> Bool
Objective-C
- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate;
-
Returns YES if |other| overlaps with this bounds. Two bounds are overlapping if there is at least
one coordinate point contained by both.
Declaration
Swift
func intersects(_ other: GMSCoordinateBounds) -> Bool
Objective-C
- (BOOL)intersectsBounds:(nonnull GMSCoordinateBounds *)other;
-
Inits with bounds that encompass region
.
-
Inits with bounds that encompass path
.
Declaration
Objective-C
- (nonnull id)initWithPath:(nonnull GMSPath *)path;
-
Returns a GMSCoordinateBounds
representing the current bounds extended to include path
.
Declaration
Swift
func includingPath(_ path: GMSPath) -> GMSCoordinateBounds
Objective-C
- (nonnull GMSCoordinateBounds *)includingPath:(nonnull GMSPath *)path;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSCoordinateBounds\u003c/code\u003e represents a rectangular area on the Earth's surface, defined by its northeast and southwest corners.\u003c/p\u003e\n"],["\u003cp\u003eIt's immutable, meaning it cannot be changed after creation, but methods provide ways to create new, expanded bounds.\u003c/p\u003e\n"],["\u003cp\u003eYou can initialize a \u003ccode\u003eGMSCoordinateBounds\u003c/code\u003e using two coordinates, a region, or a path.\u003c/p\u003e\n"],["\u003cp\u003eThis class offers functionalities like checking if a coordinate or another bounds is contained or intersects with the current bounds.\u003c/p\u003e\n"],["\u003cp\u003eIt is considered invalid if it does not contain any points, such as when initialized without coordinates, but can become valid through methods like \u003ccode\u003eincludingCoordinate:\u003c/code\u003e or \u003ccode\u003eincludingBounds:\u003c/code\u003e.\u003c/p\u003e\n"]]],["`GMSCoordinateBounds` defines a rectangular area on Earth's surface, represented by `northEast` and `southWest` corners. Key actions include initializing bounds with two coordinates, a region, or a path. Bounds can be extended to include a coordinate, another bounds, or a path. You can check if bounds are valid or contain a specific coordinate, or if they intersect with another bounds. It is immutable.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSCoordinateBounds\n===================\n\n @interface GMSCoordinateBounds : NSObject\n\nGMSCoordinateBounds represents a rectangular bounding box on the Earth's surface.\nGMSCoordinateBounds is immutable and can't be modified after construction.\n- `\n ``\n ``\n `\n\n ### [northEast](#/c:objc(cs)GMSCoordinateBounds(py)northEast)\n\n `\n ` \n The North-East corner of these bounds. \n\n #### Declaration\n\n Swift \n\n var northEast: CLLocationCoordinate2D { get }\n\n Objective-C \n\n @property (nonatomic, readonly) CLLocationCoordinate2D northEast;\n\n- `\n ``\n ``\n `\n\n ### [southWest](#/c:objc(cs)GMSCoordinateBounds(py)southWest)\n\n `\n ` \n The South-West corner of these bounds. \n\n #### Declaration\n\n Swift \n\n var southWest: CLLocationCoordinate2D { get }\n\n Objective-C \n\n @property (nonatomic, readonly) CLLocationCoordinate2D southWest;\n\n- `\n ``\n ``\n `\n\n ### [valid](#/c:objc(cs)GMSCoordinateBounds(py)valid)\n\n `\n ` \n Returns NO if this bounds does not contain any points. For example, \\[\\[GMSCoordinateBounds alloc\\]\n init\\].valid == NO.\n\n When an invalid bounds is expanded with valid coordinates via includingCoordinate: or\n includingBounds:, the resulting bounds will be valid but contain only the new coordinates. \n\n #### Declaration\n\n Swift \n\n var isValid: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly, getter=isValid) BOOL valid;\n\n- `\n ``\n ``\n `\n\n ### [-initWithCoordinate:coordinate:](#/c:objc(cs)GMSCoordinateBounds(im)initWithCoordinate:coordinate:)\n\n `\n ` \n Inits the northEast and southWest bounds corresponding to the rectangular region defined by the\n two corners.\n\n It is ambiguous whether the longitude of the box extends from \\|coord1\\| to \\|coord2\\| or vice-versa;\n the box is constructed as the smaller of the two variants, eliminating the ambiguity. \n\n #### Declaration\n\n Swift \n\n init(coordinate coord1: CLLocationCoordinate2D, coordinate coord2: CLLocationCoordinate2D)\n\n Objective-C \n\n - (nonnull id)initWithCoordinate:(CLLocationCoordinate2D)coord1\n coordinate:(CLLocationCoordinate2D)coord2;\n\n- `\n ``\n ``\n `\n\n ### [-includingCoordinate:](#/c:objc(cs)GMSCoordinateBounds(im)includingCoordinate:)\n\n `\n ` \n Returns a GMSCoordinateBounds representing the current bounds extended to include the passed-in\n coordinate.\n\n If the current bounds is invalid, the result is a valid bounds containing only \\|coordinate\\|. \n\n #### Declaration\n\n Swift \n\n func includingCoordinate(_ coordinate: CLLocationCoordinate2D) -\u003e GMSCoordinateBounds\n\n Objective-C \n\n - (nonnull GMSCoordinateBounds *)includingCoordinate:\n (CLLocationCoordinate2D)coordinate;\n\n- `\n ``\n ``\n `\n\n ### [-includingBounds:](#/c:objc(cs)GMSCoordinateBounds(im)includingBounds:)\n\n `\n ` \n Returns a GMSCoordinateBounds representing the current bounds extended to include the entire\n other bounds.\n\n If the current bounds is invalid, the result is a valid bounds equal to \\|other\\|. \n\n #### Declaration\n\n Swift \n\n func includingBounds(_ other: GMSCoordinateBounds) -\u003e GMSCoordinateBounds\n\n Objective-C \n\n - (nonnull GMSCoordinateBounds *)includingBounds:\n (nonnull GMSCoordinateBounds *)other;\n\n- `\n ``\n ``\n `\n\n ### [-containsCoordinate:](#/c:objc(cs)GMSCoordinateBounds(im)containsCoordinate:)\n\n `\n ` \n Returns YES if \\|coordinate\\| is contained within this bounds. This includes points that lie\n exactly on the edge of the bounds. \n\n #### Declaration\n\n Swift \n\n func contains(_ coordinate: CLLocationCoordinate2D) -\u003e Bool\n\n Objective-C \n\n - (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate;\n\n- `\n ``\n ``\n `\n\n ### [-intersectsBounds:](#/c:objc(cs)GMSCoordinateBounds(im)intersectsBounds:)\n\n `\n ` \n Returns YES if \\|other\\| overlaps with this bounds. Two bounds are overlapping if there is at least\n one coordinate point contained by both. \n\n #### Declaration\n\n Swift \n\n func intersects(_ other: GMSCoordinateBounds) -\u003e Bool\n\n Objective-C \n\n - (BOOL)intersectsBounds:(nonnull GMSCoordinateBounds *)other;\n\n[GoogleMaps\n----------](#/GoogleMaps)\n\n- `\n ``\n ``\n `\n\n ### [-initWithRegion:](#/c:objc(cs)GMSCoordinateBounds(im)initWithRegion:)\n\n `\n ` \n Inits with bounds that encompass `region`. \n\n #### Declaration\n\n Swift \n\n init(region: ../Structs/GMSVisibleRegion.html)\n\n Objective-C \n\n - (nonnull id)initWithRegion:(../Structs/GMSVisibleRegion.html)region;\n\n- `\n ``\n ``\n `\n\n ### [-initWithPath:](#/c:objc(cs)GMSCoordinateBounds(im)initWithPath:)\n\n `\n ` \n Inits with bounds that encompass `path`. \n\n #### Declaration\n\n Swift \n\n init(path: ../Classes/GMSPath.html)\n\n Objective-C \n\n - (nonnull id)initWithPath:(nonnull ../Classes/GMSPath.html *)path;\n\n- `\n ``\n ``\n `\n\n ### [-includingPath:](#/c:objc(cs)GMSCoordinateBounds(im)includingPath:)\n\n `\n ` \n Returns a `GMSCoordinateBounds` representing the current bounds extended to include `path`. \n\n #### Declaration\n\n Swift \n\n func includingPath(_ path: ../Classes/GMSPath.html) -\u003e GMSCoordinateBounds\n\n Objective-C \n\n - (nonnull GMSCoordinateBounds *)includingPath:(nonnull ../Classes/GMSPath.html *)path;"]]