根据上下文设置地图样式
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。

您现在可以使用上下文来更改应用中的地图样式。创建浅色、深色和单色地图样式,以便在应用中自动切换样式,而无需更改地图 ID。创建地图样式时,您可以从多种基本样式中进行选择:浅色、深色、浅色单色或深色单色。选择最接近目标样式的基本样式,然后根据需要进行自定义。
自定义浅色和深色地图样式后,您可以将这两种样式与一个地图 ID 相关联。在应用中使用地图 ID 时,地图在进入浅色或深色模式时,地图样式会自动在不同样式之间切换。
如需开始使用浅色和深色地图样式以及地图 ID,请参阅创建新样式和将样式与地图 ID 相关联。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[],[],null,["Select 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/maps-static/cloud-customization/map-styles#create-new-style) and\n[Associate your style to a map ID](/maps/documentation/maps-static/cloud-customization/map-styles#associate-style-with-map-id)."]]