GMSPlaceSearchNearbyRequest
@interface GMSPlaceSearchNearbyRequest : NSObject
Request object to use with GMSPlacesClient
to fetch nearby places.
-
Instantiates a
GMSPlaceSearchNearbyRequest
with a location restriction and place properties to return.Declaration
Swift
init(locationRestriction: any GMSPlaceLocationRestriction, placeProperties: [String])
Objective-C
- (nonnull instancetype) initWithLocationRestriction: (nonnull id<GMSPlaceLocationRestriction>)locationRestriction placeProperties:(nonnull NSArray<NSString *> *)placeProperties;
Parameters
locationRestriction
The region to search specified as a circle, defined by center point and radius in meters.
placeProperties
The array of
GMSPlaceProperty
that should be included in place results. Must not be empty. An empty list will result in an error when trying to send the request. -
Unavailable
Default init is not available. Please use the designated initializer.
Declaration
Objective-C
- (nonnull instancetype)init;
-
The region to search specified as a circle, defined by center point and radius in meters. The radius must be between 0.0 and 50000.0, inclusive. Breaking this restriction will result in an INVALID_ARGUMENT error. The locationRestriction must be specified with
GMSPlaceCircularLocationOption
. UsingGMSPlaceRectangularLocationOption
will result in an INVALID_REQUEST error.Declaration
Swift
@NSCopying var locationRestriction: any GMSPlaceLocationRestriction { get set }
Objective-C
@property (nonatomic, copy) id<GMSPlaceLocationRestriction> _Nonnull locationRestriction;
-
The array of
GMSPlaceProperty
that should be included in place results. Must not be empty. An empty list will result in an error when trying to send the request.Declaration
Swift
var placeProperties: [String] { get set }
Objective-C
@property (nonatomic, copy) NSArray<NSString *> *_Nonnull placeProperties;
-
The array of place types to include in a search. Up to 50 types can be specified. If a request is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. If the array is empty, then all places of all types are returned. See Table A for a list of supported types https://developers.google.com/maps/documentation/places/web-service/place-types#table-a.
Declaration
Swift
var includedTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *includedTypes;
-
The array of place types to exclude from a search. Up to 50 types can be specified. If a request is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. If conflicting types are specified (e.g., types appearing in includedTypes and excludedTypes), an INVALID_REQUEST error is returned. See Table A for a list of supported types https://developers.google.com/maps/documentation/places/web-service/place-types#table-a.
Declaration
Swift
var excludedTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *excludedTypes;
-
The array of primary place types to include in a search. Up to 50 types can be specified. If a request is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. For more information about primary types see: https://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes
Declaration
Swift
var includedPrimaryTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *includedPrimaryTypes;
-
The array of primary places types to exclude from a search. If conflicting types are specified (e.g., types appearing in includedTypes and excludedTypes), an INVALID_REQUEST error is returned. Up to 50 types can be specified. If a request is specified with multiple type restrictions, only places that satisfy all of the restrictions are returned. For more information about primary types see: https://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes
Declaration
Swift
var excludedPrimaryTypes: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *excludedPrimaryTypes;
-
The maximum number of
GMSPlace
results to return. Must be between 1 and 20 (default) inclusive. Breaking this restriction will result in an error returned.Declaration
Swift
var maxResultCount: Int { get set }
Objective-C
@property (nonatomic) NSInteger maxResultCount;
-
The unicode country/region code (CLDR) of the location where the request is coming from. See https://www.unicode.org/cldr/charts/44/supplemental/territory_language_information.html for region codes.
Declaration
Swift
var regionCode: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *regionCode;
-
The
GMSPlaceSearchNearbyRankPreference
used to sort the results returned from the request. The default value isGMSPlaceSearchNearbyRankPopularity
.Declaration
Swift
var rankPreference: GMSPlaceSearchNearbyRankPreference { get set }
Objective-C
@property (nonatomic) GMSPlaceSearchNearbyRankPreference rankPreference;