總覽
代表特定實體地點。
GMSPlace 包含實際位置的相關資訊,包括其名稱、位置,以及任何我們可能找到的其他資訊。這個類別無法變更。
公開成員函式 | |
(GMSPlaceOpenStatus) | - isOpenAtDate: |
無法使用預設 init。 | |
(GMSPlaceOpenStatus) | - isOpen |
可依據 openingHours 、UTCOffsetMinutes ,以及從 [NSDate date] 取得的目前日期和時間,計算某地點是否營業中。 | |
資源 | |
NSString * | name |
地點的名稱。 | |
NSString * | placeID |
這個地點的地點 ID。 | |
CLLocationCoordinate2D | 座標 |
地點的位置。 | |
NSString * | phoneNumber |
這個地點的電話號碼 (國際格式,例如: ) | |
NSString * | formattedAddress |
地點的地址,格式為簡單的字串。 | |
float | 評分 |
根據使用者評論,這個地點的五星評分。 | |
NSArray< GMSPlaceReview * > * | 評論 |
GMSPlaceReview 物件陣列,代表地點的使用者評論。 | |
GMSPlacesPriceLevel | priceLevel |
這個地點的價格等級,以 0 到 4 之間的整數表示。 | |
NSArray< NSString * > * | 類型 |
這個地點的類型。 | |
NSURL * | 網站 |
這個地點的網站。 | |
NSAttributedString * | 作者資訊 |
這個地點的資料供應商歸因字串。 | |
GMSPlaceViewportInfo * | viewportInfo |
這個地點的建議可視區域。 | |
NSArray< GMSAddressComponent * > * | addressComponents |
GMSAddressComponent 物件的陣列,代表地點地址中的元件。 | |
GMSPlusCode * | plusCode |
這個地點的 Plus Code 表示法。 | |
GMSOpeningHours * | openingHours |
這個地點的一般商家營業時間資訊。 | |
GMSOpeningHours * | currentOpeningHours |
傳回這個地點未來七天的營業時間。 | |
NSArray< GMSOpeningHours * > * | secondaryOpeningHours |
傳回這個地點未來七天的次要營業時間陣列。 | |
NSUInteger | userRatingsTotal |
代表某地點的評分所累積的評論數量。 | |
NSArray< GMSPlacePhotoMetadata * > * | 相片 |
GMSPlacePhotoMetadata 物件的陣列,代表地點的相片。 | |
NSNumber * | UTCOffsetMinutes |
地點的時區 (世界標準時間) 偏移量 (以分鐘為單位)。 | |
GMSPlacesBusinessStatus | businessStatus |
地點的 GMSPlaceBusinessStatus 。 | |
NSString * | editorialSummary |
傳回這個地點的編輯摘要。 | |
UIColor * | iconBackgroundColor |
圖示的背景顏色取決於地點類型,在圖示後方的檢視畫面上色。 | |
NSURL * | iconImageURL |
此為地點類型的網址,可用來擷取地點圖示的 NSData。 | |
GMSBooleanPlaceAttribute | 外帶 |
提供外帶服務的地點屬性。 | |
GMSBooleanPlaceAttribute | 外送 |
送貨服務的地點屬性。 | |
GMSBooleanPlaceAttribute | dineIn |
將用餐內容加入體驗中。 | |
GMSBooleanPlaceAttribute | curbsidePickup |
店外取貨服務的地點屬性。 | |
GMSBooleanPlaceAttribute | 可保留 |
「地點屬性」表示地點廣受遊客歡迎。 | |
GMSBooleanPlaceAttribute | servesBreakfast |
代表地點供應早餐的地點屬性。 | |
GMSBooleanPlaceAttribute | servesLunch |
地點屬性:表示地點提供午餐。 | |
GMSBooleanPlaceAttribute | servesDinner |
地點屬性:表示地點提供晚餐。 | |
GMSBooleanPlaceAttribute | servesBeer |
地點屬性:表示地點供應啤酒。 | |
GMSBooleanPlaceAttribute | servesWine |
地點屬性:表示地點提供葡萄酒。 | |
GMSBooleanPlaceAttribute | servesBrunch |
地點屬性:表示地點提供早午餐。 | |
GMSBooleanPlaceAttribute | servesVegetarianFood |
「地點屬性」表示地點供應素食餐點。 | |
GMSBooleanPlaceAttribute | wheelchairAccessibleEntrance |
Place 屬性:指出地點在入口處設有無障礙空間。 |
成員函式說明文件
- (GMSPlaceOpenStatus) isOpenAtDate: | (NSDate *) | <日期> |
無法使用預設 init。
根據 openingHours
、UTCOffsetMinutes
和 date
計算某個地點是否營業中。
- 參數:
-
日期 用於判斷地點是否營業的參考時間點。
- 傳回:
- 如果地點為開啟狀態,GMSPlaceOpenStatusOpen 和 GMSPlaceOpenStatusClosed,則代表地點已停業;如果開放狀態不明,則 GMSPlaceOpenStatusUnknown。
- 注意:
- 已淘汰。此方法已淘汰,並改用
GMSPlacesClient::isOpenAtDate:place:date:callback</ code> and will be removed in a future release.
可依據 openingHours
、UTCOffsetMinutes
,以及從 [NSDate date]
取得的目前日期和時間,計算某地點是否營業中。
- 傳回:
- 如果地點為開啟狀態,GMSPlaceOpenStatusOpen 和 GMSPlaceOpenStatusClosed,則代表地點已停業;如果開放狀態不明,則 GMSPlaceOpenStatusUnknown。
- 注意:
- 已淘汰。這個方法已淘汰,並改用
GMSPlacesClient::isOpen:place:callback
,並將在日後推出的版本中移除。
資源說明文件
- (NSString*) placeID [read, copy] |
這個地點的地點 ID。
- (CLLocationCoordinate2D) 座標 [read, assign] |
地點的位置。
位置不一定是地點的中心點,或是任何特定的進入或離開點,而是「地點」的地理範圍中,可由一些任意選擇的點。
- (NSString*) phoneNumber [read, copy] |
這個地點的電話號碼 (國際格式,例如
包含前置字元「+」的國家/地區代碼。舉例來說,Google 雪梨的電話號碼是「+61 2 9374 4000」。
- (NSString*) formattedAddress [read, copy] |
地點的地址,格式為簡單的字串。
- (浮動) 評分 [read, assign] |
根據使用者評論,這個地點的五星評分。
評分範圍介於 1.0 到 5.0 之間。0.0 表示我們沒有此地點的評分 (例如,評論過的使用者不足)。
- (NSArray<GMSPlaceReview *>*) 評論 [read, copy] |
GMSPlaceReview
物件陣列,代表地點的使用者評論。
- (GMSPlacesPriceLevel) priceLevel [read, assign] |
這個地點的價格等級,以 0 到 4 之間的整數表示。
例如,如果值為 4,表示這個地點為「$$$$」(昂貴)。值為 0 表示免費 (例如可免費入場的博物館)。
- (NSArray<NSString *>*) 類型 [read, copy] |
這個地點的類型。
類型包括 NSString,有效值是指任何列於 <https://developers.google.com/places/ios-sdk/supported_types> 的任何類型。
- (NSURL*) 網站 [read, copy] |
這個地點的網站。
- (NSAttributedString*) 歸因 [read, copy] |
這個地點的資料供應商歸因字串。
這些字串是以 NSAttributedString 形式提供,其中可能包含各供應商網站的超連結。
一般來說,如果這裡顯示的資料GMSPlace,如同《Places SDK 服務條款》所述,您必須向使用者顯示這些資訊。
- (GMSPlaceViewportInfo*) viewportInfo [read, assign] |
- (NSArray<GMSAddressComponent *>*) addressComponents [read, copy] |
GMSAddressComponent
物件的陣列,代表地點地址中的元件。
這些元件的用途是擷取地點地址相關的結構化資訊,例如找出某個地點所在的城市。
這些元件不應用於地址格式。如果需要格式化地址,請使用 formattedAddress
屬性,該屬性會提供本地化格式的地址。
- (GMSPlusCode*) plusCode [read, assign] |
這個地點的 Plus Code 表示法。
- (GMSOpeningHours*) openingHours [read, assign] |
這個地點的一般商家營業時間資訊。
包括營業狀態、時段和平日文字 (如果有的話)。
- (GMSOpeningHours*) currentOpeningHours [read, assign] |
傳回這個地點未來七天的營業時間。
時間範圍是從要求日期的午夜開始,到 6 天後的晚上 11:59 結束。
GMSOpeningHours
上的 GMSPlaceSpecialDay
項目只會顯示 GMSPlace
currentOpeningHours
和 GMSPlace
secondaryOpeningHours
。
- (NSArray<GMSOpeningHours *>*) secondaryOpeningHours [read, copy] |
傳回這個地點未來七天的次要營業時間陣列。
次要營業時間與商家的主要營業時間不同。舉例來說,餐廳可以將自駕營業時間或外送時間指定為次要營業時間。如要瞭解不同類型的次要營業時間,請參閱 GMSPlaceHoursType
。
GMSOpeningHours
上的 GMSPlaceSpecialDay
項目只會顯示 GMSPlace
currentOpeningHours
和 GMSPlace
secondaryOpeningHours
。
- (NSUInteger) userRatingsTotal [read, assign] |
代表某地點的評分所累積的評論數量。
- (NSArray<GMSPlacePhotoMetadata *>*) 相片 [read, copy] |
GMSPlacePhotoMetadata
物件的陣列,代表地點的相片。
- (NSNumber*) UTCOffsetMinutes [read, assign] |
地點的時區 (世界標準時間) 偏移量 (以分鐘為單位)。
- (GMSPlacesBusinessStatus) businessStatus [read, assign] |
地點的 GMSPlaceBusinessStatus
。
- (NSString*) editorialSummary [read, copy] |
傳回這個地點的編輯摘要。
- (UIColor*) iconBackgroundColor [read, assign] |
圖示的背景顏色取決於地點類型,在圖示後方的檢視畫面上色。
- (NSURL*) iconImageURL [read, assign] |
此為地點類型的網址,可用來擷取地點圖示的 NSData。
注意:網址連結不會過期,且圖片大小的長寬比可能會因類型而異。
- (GMSBooleanPlaceAttribute) takeout [read, assign] |
提供外帶服務的地點屬性。
- (GMSBooleanPlaceAttribute) 遞送 [read, assign] |
送貨服務的地點屬性。
- (GMSBooleanPlaceAttribute) dineIn [read, assign] |
將用餐內容加入體驗中。
- (GMSBooleanPlaceAttribute) curbsidePickup [read, assign] |
店外取貨服務的地點屬性。
- (GMSBooleanPlaceAttribute) 可保留 [read, assign] |
「地點屬性」表示地點廣受遊客歡迎。
- (GMSBooleanPlaceAttribute) servesBreakfast [read, assign] |
代表地點供應早餐的地點屬性。
- (GMSBooleanPlaceAttribute) servesLunch [read, assign] |
地點屬性:表示地點提供午餐。
- (GMSBooleanPlaceAttribute) servesDinner [read, assign] |
地點屬性:表示地點提供晚餐。
- (GMSBooleanPlaceAttribute) servesBeer [read, assign] |
地點屬性:表示地點供應啤酒。
- (GMSBooleanPlaceAttribute) servesWine [read, assign] |
地點屬性:表示地點提供葡萄酒。
- (GMSBooleanPlaceAttribute) servesBrunch [read, assign] |
地點屬性:表示地點提供早午餐。
- (GMSBooleanPlaceAttribute) servesVegetarianFood [read, assign] |
「地點屬性」表示地點供應素食餐點。
- (GMSBooleanPlaceAttribute) wheelchairAccessibleEntrance [read, assign] |
Place 屬性:指出地點在入口處設有無障礙空間。