AI-generated Key Takeaways
- 
          GMSPlaceSearchNearbyRequestobjects are used withGMSPlacesClientto fetch nearby places based on specified criteria.
- 
          Requests require a circular location restriction defining the search area and an array of desired place properties. 
- 
          You can further refine searches by including or excluding specific place types, setting a maximum result count, and specifying a region code. 
- 
          Results can be sorted by prominence or distance using the rankPreferenceproperty.
- 
          The default maximum number of results returned is 20, and the default ranking is based on place popularity. 
GMSPlaceSearchNearbyRequest
@interface GMSPlaceSearchNearbyRequest : NSObjectRequest object to use with GMSPlacesClient to fetch nearby places.
- 
                  
                  Instantiates a GMSPlaceSearchNearbyRequestwith a location restriction and place properties to return.DeclarationSwift init(locationRestriction: any GMSPlaceLocationRestriction, placeProperties: [String])Objective-C - (nonnull instancetype) initWithLocationRestriction: (nonnull id<GMSPlaceLocationRestriction>)locationRestriction placeProperties:(nonnull NSArray<NSString *> *)placeProperties;ParameterslocationRestrictionThe region to search specified as a circle, defined by center point and radius in meters. placePropertiesThe array of GMSPlacePropertythat 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. DeclarationObjective-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. UsingGMSPlaceRectangularLocationOptionwill result in an INVALID_REQUEST error.DeclarationSwift @NSCopying var locationRestriction: any GMSPlaceLocationRestriction { get set }Objective-C @property (nonatomic, copy) id<GMSPlaceLocationRestriction> _Nonnull locationRestriction;
- 
                  
                  The array of GMSPlacePropertythat should be included in place results. Must not be empty. An empty list will result in an error when trying to send the request.DeclarationSwift 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. DeclarationSwift 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. DeclarationSwift 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 DeclarationSwift 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 DeclarationSwift var excludedPrimaryTypes: [String]? { get set }Objective-C @property (nonatomic, copy, nullable) NSArray<NSString *> *excludedPrimaryTypes;
- 
                  
                  The maximum number of GMSPlaceresults to return. Must be between 1 and 20 (default) inclusive. Breaking this restriction will result in an error returned.DeclarationSwift 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. DeclarationSwift var regionCode: String? { get set }Objective-C @property (nonatomic, copy, nullable) NSString *regionCode;
- 
                  
                  The GMSPlaceSearchNearbyRankPreferenceused to sort the results returned from the request. The default value isGMSPlaceSearchNearbyRankPopularity.DeclarationSwift var rankPreference: GMSPlaceSearchNearbyRankPreference { get set }Objective-C @property (nonatomic) GMSPlaceSearchNearbyRankPreference rankPreference;