GMSPlaceSearchByTextRequest 類別參考

GMSPlaceSearchByTextRequest 類別參考

總覽

代表要透過 GMSPlacesClient 傳送的文字搜尋要求定義。

公開成員函式

(instancetype)- initWithTextQuery:placeProperties:
 GMSPlaceSearchByTextRequest 例項化,且包含文字查詢及要傳回的地點屬性。

房源

NSString *includedType
 無法使用預設 init。
攔截maxResultCount
 要傳回的結果數上限。
浮點值minRating
 要納入結果中的地點使用者最低平均評分。
BOOLisOpenNow
 篩選目前營業中的地點。
NSArray<GMSPlaceProperty >。placeProperties
 要包含在 Place 結果中的 GMSPlaceProperty 陣列。
NSArray<NSNumber * >。priceLevels
 GMSPlacesPriceLevel 值陣列,應篩選結果中包含的地點。
GMSPlaceSearchByTextRankPreferencerankPreference
 GMSPlaceSearchByTextRankPreference 可用來排序要求傳回的結果。
NSString *regionCode
 要求來源的 Unicode 國家/地區代碼 (CLDR)。
BOOLisStrictTypeFiltering
 定義是否只應傳回 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/places/web-service/search-textual#supported-types

- (int) maxResultCount [read, write, assign]

要傳回的結果數上限。

允許介於 1 到 20 之間的值。

如要瞭解這個欄位的允許範圍,請前往 https://developers.google.com/maps/documentation/places/web-service/search-textual#maxresultcount

預設為上限。

- (浮點值) minRating [read, write, assign]

要納入結果中的地點使用者最低平均評分。

評分的範圍介於 0.0 至 5.0 之間。

指定的評分會四捨五入至最接近的 0.5。請參閱 GMSPlace 評分屬性。

預設值為 0.0。

- (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 的結果。

預設值為否。

- (NSString*) textQuery [read, copy]

搜尋的文字查詢。

- (id<GMSPlaceLocationBias>) locationBias [read, write, assign]

要搜尋的自訂區域。

這個位置屬於自訂範圍,表示該位置已偏好特定位置的結果。

執行搜尋要求時,必須設定 locationRestriction 或 locationBias。

如果同時設定 locationRestriction,系統會忽略這項設定。

- (id<GMSPlaceLocationRestriction>) locationRestriction [read, write, assign]

只能搜尋的區域。

這個地點屬於限制,因此不會傳回指定位置以外的結果。

執行搜尋要求時,必須設定 locationRestriction 或 locationBias。

無法與 locationBias 搭配使用。

文字搜尋的 locationRestriction 僅支援 GMSPlaceRectangularLocationOption。