列舉類型說明文件
函式說明文件
- (instancetype) initWithLocationRestriction: | (id< GMSPlaceLocationRestriction >) | locationRestriction | |
placeProperties: | (NSArray< GMSPlaceProperty > *) | placeProperties | |
將包含位置限制的 GMSPlaceSearchNearbyRequest
例項化,並放置要傳回的屬性。
- 參數:
-
locationRestriction 指定為圓形的區域,以中心點和半徑 (單位為公尺) 定義。 placeProperties 要包含在 Place 結果中的 GMSPlaceProperty
陣列。不得留空。如果清單空白,系統就會嘗試傳送要求時發生錯誤。
屬性
- (id<GMSPlaceLocationRestriction>) locationRestriction [read, write, copy] |
無法使用預設 init。
請使用指定的初始化器。指定為圓形的區域,以中心點和半徑 (單位為公尺) 定義。半徑必須介於 0.0 至 50000.0 (含) 之間。違反這項限制會產生 INVALID_src 錯誤。位置限制必須以 GMSPlaceCircularLocationOption
指定。使用 GMSPlaceRectangularLocationOption
會產生 INVALID_REQUEST 錯誤。
- (NSArray<GMSPlaceProperty>*) placeProperties [read, write, copy] |
要包含在 Place 結果中的 GMSPlaceProperty
陣列。
不得留空。如果清單空白,系統就會嘗試傳送要求時發生錯誤。
- (NSArray<NSString *>*) includeTypes [read, write, copy] |
要納入搜尋的地點類型陣列。
最多可以指定 50 種類型。如果要求同時指定多個類型限制,系統只會傳回符合所有限制的地點。如果陣列空白,會傳回所有型別的所有地點。如需支援類型的清單,請參閱表 A:https://developers.google.com/maps/documentation/places/web-service/place-types#table-a。
- (NSArray<NSString *>*) excludedTypes [read, write, copy] |
要從搜尋中排除的地點類型陣列。
最多可以指定 50 種類型。如果要求同時指定多個類型限制,系統只會傳回符合所有限制的地點。如果您指定衝突類型 (例如類型出現在 includeTypes 和 excludedTypes 中),系統會傳回 INVALID_REQUEST 錯誤。如需支援類型的清單,請參閱表 A:https://developers.google.com/maps/documentation/places/web-service/place-types#table-a。
- (NSArray<NSString *>*) includePrimaryTypes [read, write, copy] |
要納入搜尋的主要地點類型陣列。
最多可以指定 50 種類型。如果要求同時指定多個類型限制,系統只會傳回符合所有限制的地點。如要進一步瞭解主要類型,請參閱:https://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes
- (NSArray<NSString *>*) excludedPrimaryTypes [read, write, copy] |
要從搜尋中排除的主要地點類型陣列。
如果您指定衝突類型 (例如類型出現在 includeTypes 和 excludedTypes 中),系統會傳回 INVALID_REQUEST 錯誤。最多可以指定 50 種類型。如果要求同時指定多個類型限制,系統只會傳回符合所有限制的地點。如要進一步瞭解主要類型,請參閱:https://developers.google.com/maps/documentation/places/web-service/nearby-search#includedtypesexcludedtypes,-includedprimarytypesexcludedprimarytypes
- (NSInteger) maxResultCount [read, write, assign] |
要傳回的 GMSPlace
項結果數量上限。
必須介於 1 至 20 (預設) 之間 (含 1 和 20)。違反這項限制會產生錯誤。
- (NSString*) regionCode [read, write, copy] |
要求來源的 Unicode 國家/地區代碼 (CLDR)。
如需區碼,請參閱 https://www.unicode.org/cldr/charts/44/supplemental/territory_language_information.html。
- (GMSPlaceSearchNearbyRankPreference) rankPreference [read, write, assign] |
GMSPlaceSearchNearbyRankPreference
可用來排序要求傳回的結果。
預設值為 GMSPlaceSearchNearbyRankPopularity
。