地點圖示會指出不同類型的地點 (例如咖啡店、圖書館和博物館)。您可以使用 Current Place 和 Place Details 要求,要求 PNG 格式圖示的網址和對應的圖示背景顏色。
如要為地點要求圖示圖示和背景顏色,請在要求中加入下列欄位:
Place.Field.ICON_URL
Place.Field.ICON_BACKGROUND_COLOR
以下範例說明如何使用「目前地點」或「地點詳細資料」要求中的圖示圖片和背景顏色:
Java
// Set the image view's background color to match the place's icon background color imageView.setBackgroundColor(place.getIconBackgroundColor()); // Fetch the icon using Glide and set the result in the image view Glide.with(this) .load(place.getIconUrl()) .into(imageView);
Kotlin
// Set the image view's background color to match the place's icon background color imageView.setBackgroundColor(place.iconBackgroundColor) // Fetch the icon using Glide and set the result in the image view Glide.with(this) .load(place.iconUrl) .into(imageView)
欄位
每個地點圖示都包含以下欄位:
iconURL
會傳回非彩色 PNG 圖示的基準網址。iconBackgroundColor
會傳回地點類別的預設顏色代碼。
地點圖示和背景顏色要求
下表列出各個類別的所有地點圖示。根據預設,這些螢幕會以黑色字符顯示。icon_background_color
取決於地點和類別。
地點類別:餐飲 (圖示背景顏色 #FF9E67) |
|||
---|---|---|---|
酒吧, 夜店 |
咖啡廳 |
餐廳、烘焙坊 |
|
地點類別:零售 (圖示背景顏色 #4B96F3) |
|||
書籍、服飾、電子產品、珠寶、鞋子、 購物中心/購物中心 |
![]() 便利商店 |
雜貨店、超市 |
藥局 |
地點類別:服務 (圖示背景顏色 #909CE1) |
|||
ATM |
銀行 |
天然氣 |
住宿 |
郵局 |
|||
地點類別:娛樂 (圖示背景顏色 #13B5C7) |
|||
水族館、旅遊 |
高爾夫 |
歷來 |
電影 |
博物館 |
劇院 |
||
地點類別:交通業 (圖示背景顏色 #10BDFF) |
|||
機場 |
公車、共乘、計程車 |
火車/鐵路 |
|
地點類別:市政/一般/宗教 (圖示背景顏色 #7B9EB0) |
|||
墓園 |
市政建築 |
程式庫 |
紀念碑 |
停車 |
學校 (小學、中學、大專院校) |
敬拜 (佛教徒) |
敬拜 (基督教徒) |
敬拜 (印度教徒) |
敬拜 (伊斯蘭教) |
敬拜 (耆那教徒) |
敬拜 (猶太文) |
敬拜 (錫克教徒) |
一般業務 |
||
地點類別:戶外活動 (圖示背景顏色 #4DB546) |
|||
划船 |
露營 |
公園 |
體育場 |
動物園 |
|||
地點類別:緊急救援 (圖示背景顏色 #F88181) |
|||
醫院 |
警方 |