GooglePlacesSwift Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
RectangularCoordinateRegion
RectangularCoordinateRegion represents a rectangular bounding box on the Earth’s surface.
RectangularCoordinateRegion is immutable and can’t be modified after construction.
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values a
and b
,
a == b
implies that a != b
is false
.
Declaration
Swift
static func == (lhs: RectangularCoordinateRegion, rhs: RectangularCoordinateRegion) -> Bool
Parameters
lhs
|
|
rhs
|
Another value to compare.
|
-
Returns the region bias as URLQueryItem
.
Declaration
Swift
func bias() -> URLQueryItem
-
Hashes the essential components of this value by feeding them into the
given hasher.
Implement this method to conform to the Hashable
protocol. The
components used for hashing must be the same as the components compared
in your type’s ==
operator implementation. Call hasher.combine(_:)
with each of these components.
Important
In your implementation of hash(into:)
,
don’t call finalize()
on the hasher
instance provided,
or replace it with a different instance.
Doing so may become a compile-time error in the future.
Declaration
Swift
func hash(into hasher: inout Hasher)
-
The hash value.
Hash values are not guaranteed to be equal across different executions of
your program. Do not save hash values to use during a future execution.
Important
hashValue
is deprecated as a
Hashable
requirement. To
conform to
Hashable
, implement the
hash(into:)
requirement instead.
The compiler provides an implementation for
hashValue
for you.
Declaration
Swift
var hashValue: Int { get }
-
Inits the northEast and southWest coordinates corresponding to the rectangular region defined
by the two corners.
Declaration
Swift
init?(northEast: CLLocationCoordinate2D, southWest: CLLocationCoordinate2D)
-
Returns false if there are no points contained in this region.
Declaration
Swift
var isValid: Bool { get }
-
The North-East corner of this region.
Declaration
Swift
var northEast: CLLocationCoordinate2D { get }
-
Returns the region restriction as URLQueryItem
.
Declaration
Swift
func restriction() -> URLQueryItem
-
The South-West corner of this region.
Declaration
Swift
var southWest: CLLocationCoordinate2D { get }
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\u003eRectangularCoordinateRegion\u003c/code\u003e represents a rectangular bounding box on the Earth's surface, defined by its north-east and south-west corners.\u003c/p\u003e\n"],["\u003cp\u003eThis struct is immutable and provides functionalities for comparison, hashing, and validation.\u003c/p\u003e\n"],["\u003cp\u003eIt can be used to define a region bias or restriction for place searches, represented as \u003ccode\u003eURLQueryItem\u003c/code\u003es.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRectangularCoordinateRegion\u003c/code\u003e conforms to protocols including \u003ccode\u003eCoordinateRegion\u003c/code\u003e, \u003ccode\u003eCoordinateRegionBias\u003c/code\u003e, \u003ccode\u003eCoordinateRegionRestriction\u003c/code\u003e, \u003ccode\u003eEquatable\u003c/code\u003e, and \u003ccode\u003eHashable\u003c/code\u003e.\u003c/p\u003e\n"]]],["`RectangularCoordinateRegion` defines an immutable rectangular area on Earth. Key actions include: checking `isValid` to ensure the region contains points; retrieving `northEast` and `southWest` corners; generating `bias()` and `restriction()` as `URLQueryItem`; and implementing `hash(into:)` for `Hashable` conformance, which replaces the deprecated `hashValue`. The class can check equality using `==` and is initialized with `init(northEast:southWest:)`.\n"],null,["# GooglePlacesSwift Framework Reference\n\nRectangularCoordinateRegion\n===========================\n\n struct RectangularCoordinateRegion\n\n extension RectangularCoordinateRegion : ../Protocols.html#/s:17GooglePlacesSwift16CoordinateRegionP, ../Protocols/CoordinateRegionBias.html, ../Protocols/CoordinateRegionRestriction.html, Copyable, Equatable, Escapable, Hashable, Sendable\n\nRectangularCoordinateRegion represents a rectangular bounding box on the Earth's surface.\nRectangularCoordinateRegion is immutable and can't be modified after construction.\n- `\n ``\n ``\n `\n\n ### [==(_:_:)](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV2eeoiySbAC_ACtFZ)\n\n `\n ` \n Returns a Boolean value indicating whether two values are equal.\n\n Equality is the inverse of inequality. For any values `a` and `b`,\n `a == b` implies that `a != b` is `false`. \n\n #### Declaration\n\n Swift \n\n static func == (lhs: RectangularCoordinateRegion, rhs: RectangularCoordinateRegion) -\u003e Bool\n\n #### Parameters\n\n |-------------|---------------------------|\n | ` `*lhs*` ` | A value to compare. |\n | ` `*rhs*` ` | Another value to compare. |\n\n- `\n ``\n ``\n `\n\n ### [bias()](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV4bias10Foundation12URLQueryItemVyF)\n\n `\n ` \n Returns the region bias as `URLQueryItem`. \n\n #### Declaration\n\n Swift \n\n func bias() -\u003e URLQueryItem\n\n- `\n ``\n ``\n `\n\n ### [hash(into:)](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV4hash4intoys6HasherVz_tF)\n\n `\n ` \n Hashes the essential components of this value by feeding them into the\n given hasher.\n\n Implement this method to conform to the `Hashable` protocol. The\n components used for hashing must be the same as the components compared\n in your type's `==` operator implementation. Call `hasher.combine(_:)`\n with each of these components. \n Important\n\n In your implementation of `hash(into:)`,\n don't call `finalize()` on the `hasher` instance provided,\n or replace it with a different instance.\n Doing so may become a compile-time error in the future. \n\n #### Declaration\n\n Swift \n\n func hash(into hasher: inout Hasher)\n\n- `\n ``\n ``\n `\n\n ### [hashValue](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV9hashValueSivp)\n\n `\n ` \n The hash value.\n\n Hash values are not guaranteed to be equal across different executions of\n your program. Do not save hash values to use during a future execution. \n Important\n `hashValue` is deprecated as a `Hashable` requirement. To conform to `Hashable`, implement the [hash(into:)](../Structs/RectangularCoordinateRegion.html#/s:17GooglePlacesSwift27RectangularCoordinateRegionV4hash4intoys6HasherVz_tF) requirement instead. The compiler provides an implementation for `hashValue` for you. \n\n #### Declaration\n\n Swift \n\n var hashValue: Int { get }\n\n- `\n ``\n ``\n `\n\n ### [init(northEast:southWest:)](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV9northEast9southWestACSgSo22CLLocationCoordinate2DV_AHtcfc)\n\n `\n ` \n Inits the northEast and southWest coordinates corresponding to the rectangular region defined\n by the two corners. \n\n #### Declaration\n\n Swift \n\n init?(northEast: CLLocationCoordinate2D, southWest: CLLocationCoordinate2D)\n\n- `\n ``\n ``\n `\n\n ### [isValid](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV7isValidSbvp)\n\n `\n ` \n Returns false if there are no points contained in this region. \n\n #### Declaration\n\n Swift \n\n var isValid: Bool { get }\n\n- `\n ``\n ``\n `\n\n ### [northEast](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV9northEastSo22CLLocationCoordinate2DVvp)\n\n `\n ` \n The North-East corner of this region. \n\n #### Declaration\n\n Swift \n\n var northEast: CLLocationCoordinate2D { get }\n\n- `\n ``\n ``\n `\n\n ### [restriction()](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV11restriction10Foundation12URLQueryItemVyF)\n\n `\n ` \n Returns the region restriction as `URLQueryItem`. \n\n #### Declaration\n\n Swift \n\n func restriction() -\u003e URLQueryItem\n\n- `\n ``\n ``\n `\n\n ### [southWest](#/s:17GooglePlacesSwift27RectangularCoordinateRegionV9southWestSo22CLLocationCoordinate2DVvp)\n\n `\n ` \n The South-West corner of this region. \n\n #### Declaration\n\n Swift \n\n var southWest: CLLocationCoordinate2D { get }"]]