總覽
代表特定實體地點。
GMSPlace 會封裝實體據點的相關資訊,包括其名稱、所在位置,以及我們可能會有的所有相關資訊。此類別無法變更。
公開成員函式 | |
(GMSPlaceOpenStatus) | - isOpenAtDate: |
預設 init 無法使用。 | |
(GMSPlaceOpenStatus) | - isOpen |
根據 openingHours 、UTCOffsetMinutes ,以及從 [NSDate date] 取得的日期和時間,計算地點是否營業。 | |
屬性 | |
NSString * | name |
地點名稱。 | |
NSString * | PlaceID |
這個地點的地點 ID。 | |
CLLocationCoordinate2D | 座標 |
地點的位置。 | |
NSString * | 電話號碼 |
此地點的電話號碼 (國際格式),例如: | |
NSString * | formattedAddress |
地點的地址,以簡單字串表示。 | |
浮動值 | 評分 |
這個地點的評分 (滿分為 5 星級), | |
GMSPlacesPriceLevel | priceLevel |
這個地點的價格級別,以 0 到 4 之間的整數表示。 | |
NSArray< NSString * > * | 類型 |
這個地點的類型。 | |
NSURL * | 網站 |
這個地點的網站。 | |
NSAttributedString * | 歸因 |
這個地點的資料供應商歸因字串。 | |
GMSPlaceViewportInfo * | viewportInfo |
這個地點的推薦可視區域。 | |
NSArray< GMSAddressComponent * > * | addressComponents |
GMSAddressComponent 物件陣列,表示地點地址中的元件。 | |
GMSPlusCode * | plusCode |
這個地點的地點加號。 | |
GMSOpeningHours * | openingHours |
這個地點的正常營業時間。 | |
GMSOpeningHours * | currentOpeningHours |
傳回這個地點未來七天內的營業時間。 | |
NSArray< GMSOpeningHours * > * | secondaryOpeningHours |
傳回此地點過去七天內的次要營業時間。 | |
NSUInteger | userRatingsTotal |
代表這個地點獲得的評分數量。 | |
NSArray< GMSPlacePhotoMetadata * > * | 相片 |
代表地點相片的 GMSPlacePhotoMetadata 物件陣列。 | |
NSNumber * | UTCOffsetMinutes |
地點的時區 UTC,以分鐘為單位。 | |
GMSPlacesBusinessStatus | businessStatus |
地點的 GMSPlaceBusinessStatus 。 | |
NSString * | editorialSummary |
傳回這個地點的編輯摘要。 | |
UIColor * | 圖示背景顏色 |
根據地點類型顯示的圖示背景顏色,為圖示背後的檢視畫面上色。 | |
NSURL * | 圖示圖片網址 |
以地點類型為依據的網址,可用來擷取地點圖示的 NSData。 | |
GMSBooleanPlaceAttribute | 匯出 |
放置屬性屬性,提供外帶服務。 | |
GMSBooleanPlaceAttribute | 廣告放送 |
交付服務的屬性。 | |
GMSBooleanPlaceAttribute | dineIn |
為用餐活動安排地點屬性。 | |
GMSBooleanPlaceAttribute | 店外取貨 |
設定店外取貨服務的屬性。 | |
GMSBooleanPlaceAttribute | 可預訂 |
「地點屬性」指出某個地點受旅客歡迎。 | |
GMSBooleanPlaceAttribute | servesBreakfast |
「地點屬性」指出早餐的位置。 | |
GMSBooleanPlaceAttribute | 亦即放送午餐 |
「地點屬性」表示服務供應午餐。 | |
GMSBooleanPlaceAttribute | servesDinner |
「地點屬性」代表晚餐供應。 | |
GMSBooleanPlaceAttribute | |
「地點屬性」表示提供啤酒。 | |
GMSBooleanPlaceAttribute | servesWine |
「地點屬性」代表供應葡萄酒的地點。 | |
GMSBooleanPlaceAttribute | |
「地點屬性」表示提供早午餐。 | |
GMSBooleanPlaceAttribute | servesVegetarianFood |
「地點屬性」代表供應素食餐點的地點。 | |
GMSBooleanPlaceAttribute | 輪椅無障礙 |
「地點屬性」代表入口處有輪椅。 |
成員函式說明文件
- (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*) 名稱 [read, copy] |
地點名稱。
- (NSString*) placeID [read, copy] |
這個地點的地點 ID。
- (CLLocationCoordinate2D) 座標 [read, assign] |
地點的位置。
地點不一定是「地點」中心或特定特定進入點或終點,不過有些地點會優先於「地點」的地理範圍內。
- (NSString*) phoneNumber [read, copy] |
此地點的電話號碼 (國際格式),例如
包括前置字串為「+」的國家/地區代碼。舉例來說,Google 雪梨 的電話號碼為「+61 2 9374 4000」。
- (NSString*) formattedAddress [read, copy] |
地點的地址,以簡單字串表示。
- (浮動) 評分 [read, assign] |
這個地點的評分 (滿分為 5 星級),
評分範圍:1.0 到 5.0。0.0 表示這個地點沒有評分 (例如使用者人數不足,因此無法評論這個地點)。
- (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] |
這個地點的資料供應商歸因字串。
這些 ID 會以 NSAttributedString 的形式提供,其中可能包含每個供應商網站的超連結。
一般來說,如果顯示這個 GMSPlace 的資料,必須向使用者顯示這些資料,如《Places SDK 服務條款》所述。
- (GMSPlaceViewportInfo*) viewportInfo [read, assign] |
- (NSArray<GMSAddressComponent *>*) addressComponents [read, copy] |
GMSAddressComponent
物件陣列,表示地點地址中的元件。
提供這些元件的目的是擷取地點地址的結構化資訊,例如找出某個地點的城市。
這些元件不應用於地址格式。如果格式化地址是必填資訊,請使用 formattedAddress
屬性,提供本地化格式的地址。
- (GMSPlusCode*) plusCode [read, assign] |
這個地點的地點加號。
- (GMSOpeningHours*) openingHours [read, assign] |
這個地點的正常營業時間。
包含營業中狀態、經期和平日文字 (如果有的話)。
- (GMSOpeningHours*) currentOpeningHours [read, assign] |
傳回這個地點未來七天內的營業時間。
時間範圍是從要求當天午夜的午夜開始,並於晚上 11 點 59 分結束。
GMSPlaceSpecialDay
GMSOpeningHours
的項目只會出現在 GMSPlace
currentOpeningHours
和 GMSPlace
secondaryOpeningHours
中。
- (NSArray<GMSOpeningHours *>*) secondaryOpeningHours [read, copy] |
傳回此地點過去七天內的次要營業時間。
次要營業時間與商家的主要營業時間不同。舉例來說,餐廳可選擇將營業時間或營業時間設為次要營業時間。如需不同類型的次要營業時間,請參閱 GMSPlaceHoursType
。
GMSPlaceSpecialDay
GMSOpeningHours
的項目只會出現在 GMSPlace
currentOpeningHours
和 GMSPlace
secondaryOpeningHours
中。
- (NSUInteger) userRatingsTotal [read, assign] |
代表這個地點獲得的評分數量。
- (NSArray<GMSPlacePhotoMetadata *>*) 相片 [read, copy] |
代表地點相片的 GMSPlacePhotoMetadata
物件陣列。
- (NSNumber*) UTCOffsetMinutes [read, assign] |
地點的時區 UTC,以分鐘為單位。
- (GMSPlacesBusinessStatus) businessStatus [read, assign] |
地點的 GMSPlaceBusinessStatus
。
- (NSString*) editorialSummary [read, copy] |
傳回這個地點的編輯摘要。
- (UIColor*) iconBackgroundColor [read, assign] |
根據地點類型顯示的圖示背景顏色,為圖示背後的檢視畫面上色。
- (NSURL*) iconImageURL [read, assign] |
以地點類型為依據的網址,可用來擷取地點圖示的 NSData。
注意:網址連結不會失效,且圖片大小的長寬比可能會因類型而異。
- (GMSBooleanPlaceAttribute) 匯出 [read, assign] |
放置屬性屬性,提供外帶服務。
- (GMSBooleanPlaceAttribute) delivery [read, assign] |
交付服務的屬性。
- (GMSBooleanPlaceAttribute) dineIn [read, assign] |
為用餐活動安排地點屬性。
- (GMSBooleanPlaceAttribute) curbsidePickup [read, assign] |
設定店外取貨服務的屬性。
- (GMSBooleanPlaceAttribute) reservable [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) wheelaccessAccessibleEntrance [read, assign] |
「地點屬性」代表入口處有輪椅。