Stay organized with collections
Save and categorize content based on your preferences.
GMSAutocompleteFilter
@interfaceGMSAutocompleteFilter:NSObject
This class represents a set of restrictions that may be applied to autocomplete requests. This
allows customization of autocomplete suggestions to only those places that are of interest.
DEPRECATED. The type filter applied to an autocomplete request to restrict results to different
types. Default value is kGMSPlacesAutocompleteTypeFilterNoFilter.
The filter applied to an autocomplete request to restrict results using up to 5 different place
types.
NOTE: This API can take an array of up to 5 entries.
If you are using GMSAutocompleteRequest, this API can take types from table_A.
Otherwise, take data from table_1
or table_2,
but only a single entry in table_3.
Default value is null, which means no filters specified. Overrides the deprecated “type” property
if this is set.
country property is deprecated in favor of countries.
DEPRECATED. The country to restrict results to. This should be a ISO 3166-1 Alpha-2 country code
(case insensitive). If nil, no country filtering will take place.
The countries to restrict results to. This should be a ISO 3166-1 Alpha-2 country code (case
insensitive). Supports up to 5 countries to filter. If nil, no country filtering will take place.
NOTE: Overrides the deprecated “country” property if that is set.
Whether pure service area businesses should be included in the results.
A pure service area business is a business that visits or delivers to customers
directly but does not serve customers at their business address. For
example, businesses like cleaning services or plumbers. Those businesses
do not have a physical address or location on Google Maps. Places will not
return fields including location, plusCode, and other location related
fields for these businesses.
[[["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 2025-07-14 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSAutocompleteFilter\u003c/code\u003e customizes autocomplete suggestions by restricting results based on criteria like place types, countries, and location.\u003c/p\u003e\n"],["\u003cp\u003eIt provides properties to filter by place types (using \u003ccode\u003etypes\u003c/code\u003e), countries (using \u003ccode\u003ecountries\u003c/code\u003e), origin location (\u003ccode\u003eorigin\u003c/code\u003e), and location bias (\u003ccode\u003elocationBias\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDeprecated properties \u003ccode\u003etype\u003c/code\u003e and \u003ccode\u003ecountry\u003c/code\u003e are replaced by \u003ccode\u003etypes\u003c/code\u003e and \u003ccode\u003ecountries\u003c/code\u003e respectively, allowing for multiple selections.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can further refine results using \u003ccode\u003elocationRestriction\u003c/code\u003e, \u003ccode\u003eregionCode\u003c/code\u003e, and \u003ccode\u003einputOffset\u003c/code\u003e to control the scope and format of suggestions.\u003c/p\u003e\n"],["\u003cp\u003eThis class is essential for tailoring autocomplete results to specific user needs and geographic contexts within map-based applications.\u003c/p\u003e\n"]]],["The `GMSAutocompleteFilter` class customizes autocomplete suggestions. It can filter results by place types using the `types` property (up to five). It can restrict results to specific countries using `countries` (up to five), which overrides the deprecated `country`. The `origin` property sets a reference location for distance calculations. `locationBias` and `locationRestriction` refine results geographically. The `regionCode` impacts result formatting and ranking. Finally, `inputOffset` defines where completions may begin in the input text.\n"],null,["GMSAutocompleteFilter \n\n @interface GMSAutocompleteFilter : NSObject\n\nThis class represents a set of restrictions that may be applied to autocomplete requests. This\nallows customization of autocomplete suggestions to only those places that are of interest.\n- `\n ``\n ``\n `\n\n [type](#/c:objc(cs)GMSAutocompleteFilter(py)type)`\n ` \n Deprecated\n\n `type` property is deprecated in favor of [types](../Classes/GMSAutocompleteFilter.html#/c:objc(cs)GMSAutocompleteFilter(py)types). \n DEPRECATED. The type filter applied to an autocomplete request to restrict results to different\n types. Default value is kGMSPlacesAutocompleteTypeFilterNoFilter.\n\n NOTE: Ignored if the \"types\" property is set. \n\n Declaration \n Swift \n\n var type: ../Enums/GMSPlacesAutocompleteTypeFilter.html { get set }\n\n Objective-C \n\n @property (nonatomic) ../Enums/GMSPlacesAutocompleteTypeFilter.html type;\n\n- `\n ``\n ``\n `\n\n [types](#/c:objc(cs)GMSAutocompleteFilter(py)types)`\n ` \n The filter applied to an autocomplete request to restrict results using up to 5 different place\n types.\n\n NOTE: This API can take an array of up to 5 entries.\n If you are using [GMSAutocompleteRequest](../Classes/GMSAutocompleteRequest.html), this API can take types from [table_A](https://developers.google.com/maps/documentation/places/ios-sdk/place-types).\n Otherwise, take data from [table_1](https://developers.google.com/maps/documentation/places/ios-sdk/supported_types#table1)\n or [table_2](https://developers.google.com/maps/documentation/places/ios-sdk/supported_types#table2),\n but only a single entry in [table_3](https://developers.google.com/maps/documentation/places/ios-sdk/supported_types#table3).\n Default value is null, which means no filters specified. Overrides the deprecated \"type\" property\n if this is set. \n\n Declaration \n Swift \n\n var types: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) NSArray\u003cNSString *\u003e *types;\n\n- `\n ``\n ``\n `\n\n [country](#/c:objc(cs)GMSAutocompleteFilter(py)country)`\n ` \n Deprecated\n\n `country` property is deprecated in favor of [countries](../Classes/GMSAutocompleteFilter.html#/c:objc(cs)GMSAutocompleteFilter(py)countries). \n DEPRECATED. The country to restrict results to. This should be a ISO 3166-1 Alpha-2 country code\n (case insensitive). If nil, no country filtering will take place.\n\n NOTE: Ignored if the \"countries\" property is set. \n\n Declaration \n Swift \n\n var country: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *country;\n\n- `\n ``\n ``\n `\n\n [countries](#/c:objc(cs)GMSAutocompleteFilter(py)countries)`\n ` \n The countries to restrict results to. This should be a ISO 3166-1 Alpha-2 country code (case\n insensitive). Supports up to 5 countries to filter. If nil, no country filtering will take place.\n\n NOTE: Overrides the deprecated \"country\" property if that is set. \n\n Declaration \n Swift \n\n var countries: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *countries;\n\n- `\n ``\n ``\n `\n\n [origin](#/c:objc(cs)GMSAutocompleteFilter(py)origin)`\n ` \n The straight line distance origin location for measuring the straight line distance between the\n origin location and autocomplete predictions. \n\n Declaration \n Swift \n\n var origin: CLLocation? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) CLLocation *origin;\n\n- `\n ``\n ``\n `\n\n [locationBias](#/c:objc(cs)GMSAutocompleteFilter(py)locationBias)`\n ` \n The optional location bias to prefer place results near the location. \n\n Declaration \n Swift \n\n var locationBias: (any ../Protocols/GMSPlaceLocationBias.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) id\u003c../Protocols/GMSPlaceLocationBias.html\u003e locationBias;\n\n- `\n ``\n ``\n `\n\n [locationRestriction](#/c:objc(cs)GMSAutocompleteFilter(py)locationRestriction)`\n ` \n The optional location restriction to limit place results. \n\n Declaration \n Swift \n\n var locationRestriction: (any ../Protocols/GMSPlaceLocationRestriction.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) id\u003c../Protocols/GMSPlaceLocationRestriction.html\u003e locationRestriction;\n\n- `\n ``\n ``\n `\n\n [regionCode](#/c:objc(cs)GMSAutocompleteFilter(py)regionCode)`\n ` \n regionCode affects address formatting, result ranking, and potentially hiding or showing certain\n results. \n\n Declaration \n Swift \n\n var regionCode: String? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) NSString *regionCode;\n\n- `\n ``\n ``\n `\n\n [inputOffset](#/c:objc(cs)GMSAutocompleteFilter(py)inputOffset)`\n ` \n inputOffset is the character offset of the input that indicates where the\n - completions may start from. \n\n Declaration \n Swift \n\n var inputOffset: Int32 { get set }\n\n Objective-C \n\n @property (nonatomic) int32_t inputOffset;\n\n- `\n ``\n ``\n `\n\n [shouldIncludePureServiceAreaBusinesses](#/c:objc(cs)GMSAutocompleteFilter(py)shouldIncludePureServiceAreaBusinesses)`\n ` \n Whether pure service area businesses should be included in the results.\n\n \u003cbr /\u003e\n\n A pure service area business is a business that visits or delivers to customers\n directly but does not serve customers at their business address. For\n example, businesses like cleaning services or plumbers. Those businesses\n do not have a physical address or location on Google Maps. Places will not\n return fields including `location`, `plusCode`, and other location related\n fields for these businesses.\n\n \u003cbr /\u003e\n\n Default value is false. \n\n Declaration \n Swift \n\n var shouldIncludePureServiceAreaBusinesses: Bool { get set }\n\n Objective-C \n\n @property (nonatomic) BOOL shouldIncludePureServiceAreaBusinesses;"]]