样式示例
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
下面是一些复杂元素样式的示例。
有绿色轮廓的黄色道路
自定义所有道路,采用浅黄色填充和深绿色轮廓作为这些道路的基本样式。
在地图项下,选择道路网。
在道路网窗格中的多段线下,选择填充颜色下的复选框。
选择浅黄色(例如,您可以输入十六进制代码 #eeeec8)。
选择描边颜色下的复选框,然后选择深绿色(例如,您可以输入十六进制代码 #155304)。
在描边宽度下,将其设为 3 像素。
放大和缩小时,不同的道路在出现和消失时都会显示此样式。如果道路变得太小而无法显示轮廓,则只会显示黄色。
不同颜色的水域(按缩放级别划分)
某些类型的元素样式可能仅在特定缩放级别显示,例如 3D 建筑或地图注点 (POI)。添加一种样式,使水域在缩小至最低级别 (z0) 时呈现深蓝色,在放大到州/省级别(在笔记本电脑上为缩放级别 6)时呈现中蓝色,在放大到 z19 级别时呈现浅蓝色并带有深蓝色边框。

在地图项下,选择水域。
在水域窗格中的多段线下,选择填充颜色下的复选框,然后选择深蓝色。
选择填充颜色右侧的缩放菱形,打开缩放级别样式设置窗格。
选择缩放级别 6,然后选择中蓝色。
选择缩放级别 19,将水域颜色更改为浅蓝色。
请注意,如果您设置描边颜色,即使一直放大,小溪和溪流以及诸多较小的河流也只会显示主体颜色。对于大型池塘、湖泊和较大的水体,则可以看到描边与填充之间的差异。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[],[],null,["# Style examples\n\nSelect 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--------------------------------\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---------------------------------------\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."]]