Stay organized with collections
Save and categorize content based on your preferences.
GMSCoordinateBounds
@interfaceGMSCoordinateBounds:NSObject
GMSCoordinateBounds represents a rectangular bounding box on the Earth’s surface.
GMSCoordinateBounds is immutable and can’t be modified after construction.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-15 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSCoordinateBounds\u003c/code\u003e represents a rectangular area on the Earth's surface, defined by its north-east and south-west corners.\u003c/p\u003e\n"],["\u003cp\u003eIt's immutable, meaning it cannot be changed after creation but methods provide ways to create new, extended bounds.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine if a coordinate or another \u003ccode\u003eGMSCoordinateBounds\u003c/code\u003e is contained within or intersects with the bounds.\u003c/p\u003e\n"],["\u003cp\u003eInitializing bounds can be done using two coordinates, a region, or by encompassing a path.\u003c/p\u003e\n"],["\u003cp\u003eInvalid bounds are possible, for instance when initialized without coordinates, and specific behaviors are defined for operations involving them.\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,["GMSCoordinateBounds \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 The North-East corner of these bounds. \n\n Declaration \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 The South-West corner of these bounds. \n\n Declaration \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 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 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 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 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 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 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 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 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 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 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 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 Swift \n\n func intersects(_ other: GMSCoordinateBounds) -\u003e Bool\n\n Objective-C \n\n - (BOOL)intersectsBounds:(nonnull GMSCoordinateBounds *)other;\n\n[GoogleMaps](#/GoogleMaps)\n\n- `\n ``\n ``\n `\n\n [-initWithRegion:](#/c:objc(cs)GMSCoordinateBounds(im)initWithRegion:)`\n ` \n Inits with bounds that encompass `region`. \n\n Declaration \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 Inits with bounds that encompass `path`. \n\n Declaration \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 Returns a `GMSCoordinateBounds` representing the current bounds extended to include `path`. \n\n Declaration \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;"]]