根據情境設定地圖樣式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。

您現在可以在應用程式中使用內容變更地圖樣式。建立淺色、深色和單色地圖樣式,即可在應用程式中自動切換樣式,不必變更地圖 ID。建立地圖樣式時,您可以從幾種基本樣式中選取:淺色、深色、淺色單色或深色單色。選擇最接近目標樣式的基本樣式,然後根據需求自訂。
自訂淺色和深色地圖樣式後,即可將兩者與一個地圖 ID 建立關聯。在應用程式中使用地圖 ID 時,地圖進入淺色或深色模式後,地圖樣式會自動切換。
如要開始使用地圖 ID 搭配淺色和深色地圖樣式,請前往「建立新樣式」和「將樣式與地圖 ID 建立關聯」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[],[],null,["# Style maps based on context\n\nSelect platform: [Android](/maps/documentation/android-sdk/cloud-customization/contextual-styling \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/cloud-customization/contextual-styling \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/cloud-customization/contextual-styling \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/maps-static/cloud-customization/contextual-styling \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\n| Dark styles are [Experimental](/maps/launch-stages#experimental).\n\nYou can now use context to change a map style in your app. Create light, dark,\nand monochrome map styles to automatically switch styles in\nyour apps without changing the map ID. When you create a map style, you can\nselect from several base styles: light, dark, monochrome light, or monochrome\ndark. Choose the base style closest to your target style and then customize for\nyour needs.\n\nWith a light and dark map style customized, you can then associate both with\none map ID. When you use the map ID in your applications, the map style\nautomatically switches between map styles when the map goes into light or dark\nmode.\n\nTo get started using light and dark map styles with map IDs, go to\n[Create a new style](/maps/documentation/ios-sdk/cloud-customization/map-styles#create-new-style) and\n[Associate your style to a map ID](/maps/documentation/ios-sdk/cloud-customization/map-styles#associate-style-with-map-id)."]]