公開成員函式 | |
(instancetype) | - initWithLocationRestriction:placeProperties: |
將具有位置限制和要傳回地點屬性的 GMSPlaceSearchNearbyRequest 例項化。 | |
資源 | |
id<GMSPlaceLocationRestriction > | locationRestriction |
無法使用預設 init。 | |
NSArray< GMSPlaceProperty > * | placeProperties |
Place 結果應包含的 GMSPlaceProperty 陣列。 | |
NSArray< NSString * > * | includedTypes |
要包含在搜尋中的地點類型陣列。 | |
NSArray< NSString * > * | excludedTypes |
要從搜尋中排除的地點類型陣列。 | |
NSArray< NSString * > * | includedPrimaryTypes |
要包含在搜尋中的主要地點類型陣列。 | |
NSArray< NSString * > * | excludedPrimaryTypes |
要從搜尋中排除的主要地點類型陣列。 | |
NSInteger | maxResultCount |
要傳回的 GMSPlace 結果數量上限。 | |
NSString * | regionCode |
要求來源地區的萬國碼 (Unicode) 國家/地區代碼 (CLDR)。 | |
GMSPlaceSearchNearbyRankPreference | rankPreference |
用於排序要求傳回結果的 GMSPlaceSearchNearbyRankPreference 。 |
成員函式說明文件
- (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_UNIT 錯誤。地區限制必須以 GMSPlaceCircularLocationOption
指定。使用 GMSPlaceRectangularLocationOption
會導致 INVALID_REQUEST 錯誤。
- (NSArray<GMSPlaceProperty>*) placeProperties [read, write, copy] |
Place 結果應包含的 GMSPlaceProperty
陣列。
欄位不得留空。如果嘗試傳送空白清單,系統將發生錯誤。
- (NSArray<NSString *>*) includedTypes [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 *>*) includedPrimaryTypes [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 (預設) 之間。如違反這項限制,就會傳回錯誤。
- (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
。