排查问题
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本文档介绍了设置地图样式时可能出现的常见问题及其相应解决方法。
点击提交 bug 或功能请求。
已知问题
有些地图注点会忽略自定义样式设置和可见性设置:在特定缩放级别下,如果地图注点在基本地图上突出显示(加粗文本),则自定义样式无效,并且即使您将可见性设为关闭,它也仍会显示。在有些缩放级别下,地图注点会在基本地图上突出显示,只有在这样的缩放级别才会出现此问题。
文本描边设置有时不生效:如果不在基本地图中使用,文本描边样式有时无法正常显示。目前已知“水域”地图项会出现此问题。
有时无法加载预览地图:此版本的预览地图使用的是矢量地图。如果您的网络浏览器无法加载矢量地图,则编辑器会退回到“无地图”体验:

如果您遇到此问题,请尝试执行以下操作:
与 iOS 相关的已知问题
- iOS 客户端不会对标签的文本描边颜色进行插值处理。
消息
创建或更新样式后,您可能会看到以下消息。
更多的样式更改可能无法在所有浏览器中正确显示。我们建议您避免更改更多样式。
在旧版云端样式设置中,地图样式的可更改次数有限。尝试修改样式的次数达到上限后,您就会收到此消息。您可以选择修改其他样式,也可以考虑改用最新版的云端样式设置,这样就可以解决该问题。
样式问题
创建或更新样式后,您可能会看到以下消息。
有些地图注点在特定缩放级别下,会忽略自定义样式设置和可见性设置
如果地图注点在基本地图上突出显示(加粗文本),则自定义样式设置无效,并且即使您将可见性设为关闭,它们也仍会显示。在有些缩放级别下,地图注点会在基本地图上突出显示,只有在这样的缩放级别才会出现此问题。这是一个已知问题。
我对样式所做的更改未反映在应用或网站中
样式更改可能需要几个小时才会在您的应用和网站中生效,如果设备未连接到互联网,应用可能需要更长时间才能显示更改后的样式。如果几个小时后您仍未看到更改后的样式,请检查以下事项:
预览版地图上没有显示更改后的样式
如果您所做的更改未反映在预览版地图上,不妨试试以下措施。
检查是否存在样式重叠:如需了解详情,请参阅管理重叠的样式。
检查是否存在样式沿用导致的覆盖问题:检查您所设置的样式下层,是否有自定义的子样式会覆盖其父样式。如需详细了解样式沿用,请参阅了解地图样式沿用和层次结构。
更改地图缩放级别:在当前缩放级别下,您要设置样式的地图项可能无法在地图中显示。
文本模糊不清或失焦
如果您针对文本填充和描边选择的颜色对比不够明显,描边(轮廓)和填充区域就会融为一体,导致字体看起来偏粗且模糊不清。请选择对比足够明显的颜色。
样式颜色暗淡或颜色不正确
您要设置样式的地图项可能与一个或多个其他地图项重叠。如需帮助,请参阅管理重叠的样式。
样式套用至错误的地图项
如果您发现有些地图项的样式与您设置的样式相同,可能是因为这些地图项的默认地图样式与您设置的样式刚好一致。这种情况下,您可以尝试下面这些措施:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-26。
[null,null,["最后更新时间 (UTC):2023-12-26。"],[[["\u003cp\u003eThis document outlines troubleshooting steps for common issues encountered when using cloud-based map styling in the Google Maps Platform.\u003c/p\u003e\n"],["\u003cp\u003eIt addresses problems related to style updates, map display, visual appearance of map elements, and unintended styling of features.\u003c/p\u003e\n"],["\u003cp\u003eThe document provides guidance on resolving issues with legacy cloud styling access, style editor loading, style propagation delays, and overlapping or inherited styles.\u003c/p\u003e\n"],["\u003cp\u003eIt also offers suggestions for improving text clarity and color accuracy, and managing the styling of overlapping map features.\u003c/p\u003e\n"],["\u003cp\u003eUsers are encouraged to refer to the release notes for the latest known issues and utilize provided links for bug reporting and feature requests.\u003c/p\u003e\n"]]],[],null,["Select platform: [Android](/maps/documentation/android-sdk/cloud-customization/troubleshoot \"View this page for the Android platform docs.\") [iOS](/maps/documentation/ios-sdk/cloud-customization/troubleshoot \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/cloud-customization/troubleshoot \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/maps-static/cloud-customization/troubleshoot \"View this page for the Web Service platform docs.\")\n\n\u003cbr /\u003e\n\nThis document describes common issues that might occur when setting up your\nmap style, and how to resolve them.\n\nClick to file a\n[Bug](https://issuetracker.google.com/issues/new?component=1415514&template=1863115)\nor [Feature Request](https://issuetracker.google.com/issues/new?component=1415514&template=1863479).\n\nKnown issues\n\nTo see the latest known issues with cloud-based maps styling, see\nthe [release notes](../cbms-release-notes).\n\nMessages\n\nHere are some messages you might see and their solutions:\n\n\u003cbr /\u003e\n\nA map `styles` property cannot be set when a `mapId` is present. You cannot use map IDs and styles at the same time. Instead, edit the style associated with the map ID using the Cloud console. See also [I get an error trying to load my map style](#mapid-w-style).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThe style editor can't be loaded right now The preview map uses a vector map. In cases when vector maps cannot\nbe loaded on your web browser, it falls back to a \"no map\" experience:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nIf you run into this issue, try the following:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n- Check your browser settings to make sure hardware acceleration is enabled.\n- Check if your device is supported by visiting [get.webgl.org](https://get.webgl.org/). If the demo does not run, your browser or device may not be compatible with WebGL. Make sure your device's drivers/browser combination is not subject to the denylist rules defined in the [Khronos WebGL wiki](https://www.khronos.org/webgl/wiki/BlacklistsAndWhitelists).\n- Update your graphics card and make sure that your device has a video graphics card (GPU) that supports WebGL. See [Application and website\n requirements](/maps/documentation/maps-static/cloud-customization/setup#reqs).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nFor additional support, see [GMP WebGL support](/maps/documentation/javascript/webgl/support).\n\n\u003cbr /\u003e\n\nStyle issues\n\nYou might see the following messages displayed after creating or updating\na style.\n\nMy style changes aren't updating in my apps or website\n\nStyle changes can take a few hours to propagate to your apps and websites, and\napps can take longer if the devices aren't connected to the internet. If you're\nstill not seeing your style changes after a few hours, check the following\nthings:\n\n- Make sure you've published your style update.\n\n- If you made your changes in a duplicated style, make sure you've associated\n your map ID with the duplicated style. For details, see\n [Associate or remove map IDs on your style](/maps/documentation/maps-static/cloud-customization/map-styles#associate-style-with-map-id).\n\nI can't see my style changes on the preview map\n\nIf you make a change, and can't see the change on the preview map, here\nare some things to try.\n\n- **Check for style overlaps** : For details, see\n [Manage styles that overlap](/maps/documentation/maps-static/cloud-customization/overlap).\n\n- **Check for style inheritance overrides** : Check to see if there is a\n custom child style underneath the style you're setting that is overriding\n its parent style. For details on style inheritance, see\n [Understand map style inheritance and hierarchy](/maps/documentation/maps-static/cloud-customization/map-hier).\n\n- **Change the map zoom level**: It's possible that the map features you are\n styling are not visible in the map at the current zoom level.\n\n - **Zoom in**: If you are sure the feature is present on the map,\n zoom in to a more detailed view and it may appear.\n\n - **Zoom out**: With some large map features, you may need to zoom out\n until the detailed map features drop out before your styling shows up.\n\nMy text looks blurry or out of focus\n\nIf the colors you've chosen for your fill and stroke for text don't have\nenough contrast, the font looks bold and fuzzy because the stroke (outline)\nand fill merge together. Select colors that have enough contrast.\n\nMy style looks dull or the wrong color\n\nThe map feature you are styling may overlap with one or more other map\nfeatures. For assistance, see [Manage styles that overlap](/maps/documentation/maps-static/cloud-customization/overlap).\n\nThe wrong map features are being styled\n\nIf you are seeing map features that match the style you've set, it may be that\nthe default map style for those map features are the same as the style you're\nsetting. Here are some things to try:\n\n- **Turn off visibility for the map feature that matches**. For example,\n if you are trying to set Winery to a dark red, and notice that Emergency\n POIs are red, which could be confusing for your users. You can choose to\n turn off visibility for Emergency POIs to avoid this confusion.\n\n- **Change the style of the map features that you don't want to match**.\n the example above, you could also choose to style Emergency POIs to orange\n to avoid confusion.\n\nI get an error trying to load my map style\n\nYou cannot use map IDs and styles at the same time. You can do one of the\nfollowing:\n\n- **Recommended** : Remove the map style, and edit the style associated with\n the map ID using the Cloud console. With this method, you can create one\n style that applies to all platforms. For details, see\n [Associate a style with a map ID](/maps/documentation/maps-static/cloud-customization/map-styles#associate-style-with-map-id).\n\n- Remove the map ID, and edit the style for each app platform using\n\n [JSON styling](/maps/documentation/javascript/json-styling-overview).\n\n Since JSON styling is platform-specific, you need to create the style for each\n app platform on which you display the styled maps.\n\nIf you already have a JSON map style that you want to use for cloud-based\nmaps styling, you can import it. For details, see\n[Import a JSON map style](/maps/documentation/maps-static/cloud-customization/map-styles#json-import)."]]