樣式範例
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
以下提供幾個複雜的元素樣式設定範例。
有綠色外框的黃色道路
自訂所有道路的基本樣式,填滿淡黃色且外框為深綠色。
在「地圖項目」下方,選取「路網」。
在「路網」窗格的「折線」底下,選取「填滿顏色」下方的方塊。
選取淺黃色,例如 16 進位色碼 #eeeec8。
選取「筆劃顏色」下方的方塊,然後選取深綠色,例如 16 進位色碼 #155304。
在「筆劃寬度」下方,將寬度設為 3 像素。
在縮放畫面的過程中,不同道路出現及消失時都會顯示這個樣式。如果道路太小而無法顯示外框,會只呈現黃色。
不同縮放等級的水域顏色
某些類型的元素樣式可能只會在特定縮放等級顯示,例如 3D 建築物或搜尋點。新增以下樣式:地圖縮到最小 (z0) 時,水域為深藍色;放大到州或省 (筆電呈現縮放等級 6) 時,水域為中等藍色;放大到極限 (z19) 時,水域為淺藍色且有深藍色邊框。

選取「地圖項目」下方的「水域」。
在「水域」窗格的「多邊形」底下,選取「填滿顏色」下方的方塊,然後點選深藍色。
選取「填滿顏色」右側的縮放鑽石圖示,開啟縮放等級樣式設定窗格。
選取縮放等級 6,然後選取中等藍色。
選取縮放等級 19,然後將水域變更為淺藍色。
注意,如果您設定了筆劃顏色,則即使溪流、小河和許多較小的河川放到最大,也只會顯示主體顏色。大型池塘、湖泊及更大的水體才能顯示筆劃與填色的差異。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-27 (世界標準時間)。
[null,null,["上次更新時間:2025-08-27 (世界標準時間)。"],[],[],null,["Select platform: [Android](/maps/documentation/android-sdk/cloud-customization/style-examples \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/cloud-customization/style-examples \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/cloud-customization/style-examples \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/maps-static/cloud-customization/style-examples \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\nHere are some examples of complex element styling.\n\nYellow roads with green outlines\n\nCustomize all roads to have a pale yellow fill and a dark green outline as the\nbase style.\n\n1. Under **Map Features** , select **Road Network**.\n\n2. On the **Road Network** pane, under **Polyline** , select the box\n under **Fill color**.\n\n3. Select a light yellow color, such as hex code #eeeec8.\n\n4. Select the box under **Stroke color** and select a dark green color, such\n as hex code #155304.\n\n5. Under **Stroke width**, set it to 3px.\n\nAs you zoom in and out, different roads show this style as they appear and\ndisappear. Once roads get too small to show the outline, they display only the\nyellow color.\n\nDifferent colors of water by zoom level\n\nSome types of element styling might only be visible at certain zoom levels, like\n3D buildings or points of interest (POIs). Add a style such that the\nwater appears dark blue zoomed out to maximum (z0),\nmedium blue when zoomed in to the level of a state or province (zoom level 6\non a laptop), and pale blue with a dark blue border when zoomed in tightly\n(z19).\n\n1. Under **Map Features** , select **Water**.\n\n2. On the **Water** pane, under **Polyline** , select the box\n under **Fill color**, and select a dark blue color.\n\n3. Select the zoom diamond to the right of **Fill color** to open the\n zoom-level styling pane.\n\n4. Select zoom level 6, and select a medium blue color.\n\n5. Select zoom level 19, and change the water to light blue.\n\nNote, if you set a stroke color, creeks and streams and many smaller rivers\nonly show the body color, even zoomed all the way in. The difference between\nstroke and fill is visible on large ponds, lakes, and larger bodies of water."]]