概览
表示将通过 GMSPlacesClient
发送的文本搜索请求定义。
公共成员函数 | |
(instancetype) | - initWithTextQuery:placeProperties: |
使用文本查询和要返回的地点属性实例化 GMSPlaceSearchByTextRequest 。 | |
属性 | |
NSString * | includedType |
默认 init 不可用。 | |
int | maxResultCount |
要返回的结果数上限。 | |
float | minRating |
要包含在结果中的地点的最低平均用户评分。 | |
BOOL | isOpenNow |
过滤出当前正在营业的地点。 | |
NSArray< GMSPlaceProperty > * | placeProperties |
应包含在地点结果中的 GMSPlaceProperty 数组。 | |
NSArray< NSNumber * > * | priceLevels |
GMSPlacesPriceLevel 值的数组,用于过滤结果中包含的地点。 | |
GMSPlaceSearchByTextRankPreference | rankPreference |
GMSPlaceSearchByTextRankPreference ,用于对请求返回的结果进行排序。 | |
NSString * | regionCode |
发出请求的地理位置的 Unicode 国家/地区代码 (CLDR)。 | |
BOOL | isStrictTypeFiltering |
定义是否仅返回 includedType 的结果。 | |
NSString * | textQuery |
搜索的文本查询。 | |
id<GMSPlaceLocationBias > | locationBias |
要搜索的偏向区域。 | |
id<GMSPlaceLocationRestriction > | locationRestriction |
要搜索的受限区域。 |
成员函数文档
- (instancetype) initWithTextQuery: | (NSString *) | textQuery | |
placeProperties: | (NSArray< GMSPlaceProperty > *) | placeProperties | |
使用文本查询和要返回的地点属性实例化 GMSPlaceSearchByTextRequest
。
- 参数:
-
textQuery 搜索请求的字符串查询。 placeProperties 应包含在地点结果中的 GMSPlaceProperty
数组。不得为空。空列表会导致在尝试发送请求时出错。
属性说明
- (NSString*) includedType [read, write, copy] |
默认 init 不可用。
请使用指定的初始化程序。请求的地点类型。
如需查看可用支持类型的最新列表,请参阅 https://developers.google.com/maps/documentation/places/web-service/search-textual#supported-types
-(整数)maxResultCount [read, write, assign] |
返回的结果数上限。
允许值介于 1 到 20 之间。
您可以在 https://developers.google.com/maps/documentation/places/web-service/search-textual#maxresultcount 上找到此字段的允许范围。
默认值为上限。
-(浮点数)minRating [read, write, assign] |
- (BOOL) isOpenNow [read, write, assign] |
过滤出当前正在营业的地点。
默认值为 true。
- (NSArray<GMSPlaceProperty>*) placeProperties [read, assign] |
应包含在地点结果中的 GMSPlaceProperty
数组。
- (NSArray<NSNumber *>*) priceLevels [read, write, assign] |
GMSPlacesPriceLevel
值的数组,用于过滤结果中包含的地点。
可以选择任何价位组合;默认为所有价位。
- (GMSPlaceSearchByTextRankPreference) rankPreference [read, write, assign] |
GMSPlaceSearchByTextRankPreference
,用于对请求返回的结果进行排序。
- (NSString*) regionCode [read, write, copy] |
发出请求的地理位置的 Unicode 国家/地区代码 (CLDR)。
区域可能会影响所返回数据的格式和类型。如果未提供任何代码,则不会偏向于任何国家/地区。
如需查看地区代码,请参阅 https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html。
- (BOOL) isStrictTypeFiltering [read, write, assign] |
定义是否仅返回 includedType
的结果。
默认值为 false。
- (NSString*) textQuery [read, copy] |
搜索的文本查询。
- (id<GMSPlaceLocationBias>) locationBias [read, write, assign] |
要搜索的偏向区域。
此位置是一种偏差,这意味着系统更倾向于指定位置的结果。
在执行搜索请求时,必须设置 locationRestriction 或 locationBias。
如果与 locationRestriction 一起设置,则系统会忽略此属性。
- (id<GMSPlaceLocationRestriction>) locationRestriction [read, write, assign] |
要搜索的受限区域。
此位置具有限制条件,这意味着系统不会返回指定位置以外的结果。
在执行搜索请求时,必须设置 locationRestriction 或 locationBias。
无法与 locationBias 一起使用。
文本搜索的 locationRestriction 仅支持 GMSPlaceRectAngularLocationOption。