總覽
代表透過 GMSPlacesClient 傳送的文字搜尋要求定義
公開成員函式 | |
(instancetype) | - initWithTextQuery:placeProperties: |
使用文字查詢和要傳回的地點屬性,將 GMSPlaceSearchByTextRequest 例項化。 | |
資源 | |
NSString * | includedType |
無法使用預設 init。 | |
要傳回的結果數上限。允許的值介於 1 到 20 之間。 | |
int | maxResultCount |
float | minRating |
地點要包含的地點平均使用者評分下限, | |
BOOL | isOpenNow |
篩選出目前營業中的地點的搜尋結果。 | |
NSArray< GMSPlaceProperty > * | placeProperties |
Place 結果應包含的 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 Place 結果應包含的 GMSPlaceProperty
陣列。
資源說明文件
- (NSString*) includedType [read, write, copy] |
無法使用預設 init。
請使用指定的初始化工具。要求的地點類型。
如需支援類型的最新清單,請參閱 https://developers.google.com/maps/documentation/maps/documentation/places/ios-sdk/data-fields
- (整數) maxResultCount [read, write, assign] |
要傳回的結果數上限。允許的值介於 1 到 20 之間。
如要瞭解這個欄位允許的範圍,請參閱 https://developers.google.com/maps/documentation/places/ios-sdk/text-search。
預設值為上限。
- (浮點值) minRating [read, write, assign] |
- (BOOL) isOpenNow [read, write, assign] |
篩選出目前營業中的地點的搜尋結果。
預設為 true。
- (NSArray<GMSPlaceProperty>*) placeProperties [read, assign] |
Place 結果應包含的 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。