GMSPlace 類別參考資料

GMSPlace 類別參考資料

總覽

代表特定的實際地點。

GMSPlace 包含實體位置的相關資訊,包括名稱、位置和任何我們可取得的其他資訊。這個類別無法變更。

公開成員函式

(GMSPlaceOpenStatus)- isOpenAtDate:
 無法使用預設 init。
(GMSPlaceOpenStatus)- isOpen
 根據 openingHoursUTCOffsetMinutes,以及從 [NSDate date] 取得的目前日期和時間,計算地點是否營業。

資源

NSString * name
 地點的名稱。
NSString * placeID
 這個地點的地點 ID。
CLLocationCoordinate2D座標
 地點的位置。
NSString * phoneNumber
 此地點的電話號碼 (國際格式,例如
)
NSString * formattedAddress
 地點的地址,以簡單字串表示。
float 評分
 此地點的五顆星評分 (根據使用者評論)。
GMSPlacesPriceLevelpriceLevel
 這個地點的價格等級,以 0 到 4 的整數表示。
NSArray< NSString * > * 類型
 這個地點的類型。
NSURL * 網站
 這個地點的網站。
NSAttributedString * 作者資訊
 這個地點的資料供應商歸因字串。
GMSPlaceViewportInfoviewportInfo
 這個地點的建議可視區域。
NSArray< GMSAddressComponent * > * addressComponents
 GMSAddressComponent 物件陣列,代表地點地址中的元件。
GMSPlusCodeplusCode
 這個地點的 Plus Code 表示位置。
GMSOpeningHoursopeningHours
 這個地點的一般營業時間資訊。
GMSOpeningHourscurrentOpeningHours
 傳回這個地點接下來 7 天的營業時間。
NSArray< GMSOpeningHours * > * secondaryOpeningHours
 傳回這個地點未來七天內的次要服務小時陣列。
NSUIntegeruserRatingsTotal
 代表此地點評分包含的評論數。
NSArray< GMSPlacePhotoMetadata * > * 相片
 GMSPlacePhotoMetadata 物件陣列,代表地點的相片。
NSNumber * UTCOffsetMinutes
 地點的時區 (以分鐘為單位) 的時區偏移。
GMSPlacesBusinessStatusbusinessStatus
 地點的 GMSPlaceBusinessStatus
NSString * editorialSummary
 傳回這個地點的編輯摘要。
UIColor * iconBackgroundColor
 根據地點類型,為圖示的背景顏色套用顏色,為圖示背後的檢視畫面套用顏色。
NSURL * iconImageURL
 根據「地點」類型的網址,可用來擷取「地點」圖示的 NSData。
GMSBooleanPlaceAttribute外帶
 外帶體驗的地點屬性。
GMSBooleanPlaceAttribute外送
 外送服務的地點屬性。
GMSBooleanPlaceAttributedineIn
 提供現場用餐體驗的地點屬性。
GMSBooleanPlaceAttributecurbsidePickup
 店外取貨服務的地點屬性。
GMSBooleanPlaceAttribute可預訂
 地點屬性會指出地點廣受遊客歡迎的地點屬性。
GMSBooleanPlaceAttributeservesBreakfast
 表示地點供應早餐的地點屬性。
GMSBooleanPlaceAttributeservesLunch
 表示地點供應午餐的地點屬性。
GMSBooleanPlaceAttributeservesDinner
 表示地點供應晚餐的地點屬性。
GMSBooleanPlaceAttributeservesBeer
 地點屬性指出地點供應啤酒。
GMSBooleanPlaceAttributeservesWine
 指出地點供應葡萄酒的地點屬性。
GMSBooleanPlaceAttributeservesBrunch
 地點屬性指出地點供應早午餐。
GMSBooleanPlaceAttributeservesVegetarianFood
 指出地點供應素食的地點屬性。
GMSBooleanPlaceAttributewheelchairAccessibleEntrance
 地點屬性,指出地點在入口提供無障礙設施。

成員函式說明文件

- (GMSPlaceOpenStatus) isOpenAtDate: (NSDate *) 日期

無法使用預設 init。

根據 openingHoursUTCOffsetMinutesdate 計算地點是否營業中。

參數:
日期用來判斷地點是否營業的參考點。
傳回:
如果地點營業中,GMSPlaceOpenStatusOpen 和 GMSPlaceOpenStatusClosed (如果地點已歇業) 和 GMSPlaceOpenStatusUnknown (如果開放狀態不明)。
注意:
已淘汰。此方法已淘汰,並改用 GMSPlacesClient::isOpenAtDate:place:date:callback</ code> and will be removed in a future release.

根據 openingHoursUTCOffsetMinutes,以及從 [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]

地點的地址,以簡單字串表示。

- (浮點值) rating [read, assign]

此地點的五顆星評分 (根據使用者評論)。

評分範圍介於 1.0 至 5.0 之間。0.0 表示我們沒有為這個地點評分 (例如,評論這個地點的使用者不足)。

- (GMSPlacesPriceLevel) priceLevel [read, assign]

這個地點的價格等級,以 0 到 4 的整數表示。

例如,如果值為 4,表示這個地點是「$$$$」(昂貴)。如果值為 0,則表示免費 (例如提供免費入場的博物館)。

- (NSArray<NSString *>*) types [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]

這個地點的建議可視區域。

如果地點大小不明,則可能是 nil。

這樣做會傳回適合顯示這個地點的大小的可視區域。舉例來說,代表商店的 GMSPlace 物件可能的可視區域相對較小,而代表國家/地區的 GMSPlace 物件則可能具有非常大的可視區域。

- (NSArray<GMSAddressComponent *>*) addressComponents [read, copy]

GMSAddressComponent 物件陣列,代表地點地址中的元件。

這些元件是用於擷取地點地址的結構化資訊,例如尋找地點所在的城市。

請勿將這些元件用於地址格式設定。如果需要格式化地址,請使用 formattedAddress 屬性,可提供本地化格式的地址。

- (GMSPlusCode*) plusCode [read, assign]

這個地點的 Plus Code 表示位置。

- (GMSOpeningHours*) openingHours [read, assign]

這個地點的一般營業時間資訊。

包括營業狀態、經期和平日文字 (如有)。

- (GMSOpeningHours*) currentOpeningHours [read, assign]

傳回這個地點接下來 7 天的營業時間。

時間範圍是從要求日期的午夜開始,並於 6 天後的晚上 11:59 結束。

只有 GMSPlace currentOpeningHoursGMSPlace secondaryOpeningHours 會出現「GMSOpeningHours」中的「GMSPlaceSpecialDay」項目。

- (NSArray<GMSOpeningHours *>*) secondaryOpeningHours [read, copy]

傳回這個地點未來七天內的次要服務小時陣列。

次要營業時間與商家的主要營業時間不同。舉例來說,餐廳可將免下車時間或外送時間指定為次要營業時間。如要瞭解各種次要營業時間,請參閱 GMSPlaceHoursType

只有 GMSPlace currentOpeningHoursGMSPlace secondaryOpeningHours 會出現「GMSOpeningHours」中的「GMSPlaceSpecialDay」項目。

- (NSUInteger) userRatingsTotal [read, assign]

代表此地點評分包含的評論數。

- (NSArray<GMSPlacePhotoMetadata *>*) 相片 [read, copy]

GMSPlacePhotoMetadata 物件陣列,代表地點的相片。

- (NSNumber*) UTCOffsetMinutes [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]

提供現場用餐體驗的地點屬性。

店外取貨服務的地點屬性。

地點屬性會指出地點廣受遊客歡迎的地點屬性。

表示地點供應早餐的地點屬性。

表示地點供應午餐的地點屬性。

表示地點供應晚餐的地點屬性。

地點屬性指出地點供應啤酒。

指出地點供應葡萄酒的地點屬性。

地點屬性指出地點供應早午餐。

指出地點供應素食的地點屬性。

地點屬性,指出地點在入口提供無障礙設施。