谷歌地图道路标签/图标文字难以辨认

时间:2017-03-03 10:24:19

标签: json google-maps google-maps-api-3

我使用SnazzyMaps定制了Google地图。我使用这个主题作为基础,然后调整它以满足我的需求:https://snazzymaps.com/style/8097/wy

当我缩小地图时,我注意到的一件事是道路标志是灰色的块,你无法阅读文字。这很奇怪,因为如果放大它们会很好。我猜他们必须是略有不同类型的道路。

您无法在默认位置(纽约)看到问题,但如果您放置"伦敦"在搜索框中更改位置,您会看到很多道路标志已被消除 - 您可能需要缩小。

这是我的主题(json),它有同样的问题,我无法纠正它:

[  
   {  
      "featureType":"all",
      "elementType":"geometry.fill",
      "stylers":[  
         {  
            "weight":"2.00"
         }
      ]
   },
   {  
      "featureType":"all",
      "elementType":"geometry.stroke",
      "stylers":[  
         {  
            "color":"#9c9c9c"
         }
      ]
   },
   {  
      "featureType":"all",
      "elementType":"labels.text",
      "stylers":[  
         {  
            "visibility":"on"
         },
         {  
            "color":"#404546"
         },
         {  
            "weight":".25"
         }
      ]
   },
   {  
      "featureType":"all",
      "elementType":"labels.text.stroke",
      "stylers":[  
         {  
            "color":"#ffffff"
         },
         {  
            "weight":"2"
         }
      ]
   },
   {  
      "featureType":"landscape",
      "elementType":"all",
      "stylers":[  
         {  
            "color":"#f2f2f2"
         }
      ]
   },
   {  
      "featureType":"landscape",
      "elementType":"geometry.fill",
      "stylers":[  
         {  
            "color":"#ffffff"
         }
      ]
   },
   {  
      "featureType":"landscape.man_made",
      "elementType":"geometry.fill",
      "stylers":[  
         {  
            "color":"#ffffff"
         }
      ]
   },
   {  
      "featureType":"poi",
      "elementType":"all",
      "stylers":[  
         {  
            "visibility":"off"
         }
      ]
   },
   {  
      "featureType":"road",
      "elementType":"all",
      "stylers":[  
         {  
            "saturation":-100
         },
         {  
            "lightness":45
         }
      ]
   },
   {  
      "featureType":"road",
      "elementType":"geometry.fill",
      "stylers":[  
         {  
            "color":"#eeeeee"
         }
      ]
   },
   {  
      "featureType":"road",
      "elementType":"labels.text.fill",
      "stylers":[  
         {  
            "color":"#7b7b7b"
         }
      ]
   },
   {  
      "featureType":"road",
      "elementType":"labels.text.stroke",
      "stylers":[  
         {  
            "color":"#ffffff"
         },
         {  
            "weight":"3"
         },
         {  
            "visibility":"on"
         }
      ]
   },
   {  
      "featureType":"road.highway",
      "elementType":"all",
      "stylers":[  
         {  
            "visibility":"simplified"
         }
      ]
   },
   {  
      "featureType":"road.arterial",
      "elementType":"labels.icon",
      "stylers":[  
         {  
            "visibility":"off"
         }
      ]
   },
   {  
      "featureType":"transit",
      "elementType":"all",
      "stylers":[  
         {  
            "visibility":"off"
         }
      ]
   },
   {  
      "featureType":"transit.line",
      "elementType":"all",
      "stylers":[  
         {  
            "visibility":"on"
         },
         {  
            "weight":".75"
         },
         {  
            "color":"#b1b6b7"
         }
      ]
   },
   {  
      "featureType":"transit.station",
      "elementType":"labels.text",
      "stylers":[  
         {  
            "visibility":"simplified"
         },
         {  
            "color":"#404546"
         }
      ]
   },
   {  
      "featureType":"transit.station",
      "elementType":"labels.icon",
      "stylers":[  
         {  
            "visibility":"on"
         },
         {  
            "hue":"#b7ff00"
         },
         {  
            "gamma":"0.80"
         },
         {  
            "saturation":"-20"
         },
         {  
            "lightness":"0"
         },
         {  
            "weight":"1"
         }
      ]
   },
   {  
      "featureType":"water",
      "elementType":"all",
      "stylers":[  
         {  
            "color":"#46bcec"
         },
         {  
            "visibility":"on"
         }
      ]
   },
   {  
      "featureType":"water",
      "elementType":"geometry.fill",
      "stylers":[  
         {  
            "color":"#c8d7d4"
         }
      ]
   },
   {  
      "featureType":"water",
      "elementType":"labels.text.fill",
      "stylers":[  
         {  
            "color":"#070707"
         }
      ]
   },
   {  
      "featureType":"water",
      "elementType":"labels.text.stroke",
      "stylers":[  
         {  
            "color":"#ffffff"
         }
      ]
   }
]

我认为这是我已经完成的事情,但它也是基础主题。我找到了我认为指定的道路标签样式,我能够改变它的颜色/色调,但我不能改变文本。我甚至尝试调整饱和度/亮度/伽玛,看它是对比但没有运气。

我错过了什么?希望有人可以帮忙解决这个问题,但我想这可能是一个利基问题。

提前致谢! :)

1 个答案:

答案 0 :(得分:2)

我认为您在5年前登录过的Google地图中遇到this bug并且尚未解决。

欧洲的大多数道路标签都很好,但道路标签是个例外。这是因为标签是绿色背景上的黄色文字,这对改变饱和度实际上并不起作用。

你能做的最好的事情就是完全隐藏标签(这并不是很好),或者用一点颜色贴上标签,然后稍微调低一下标签。

在您提供的样式中,您可以在Roads > All > Color Options上调整这些标签的颜色。或者从父项中删除样式并直接设置Highway > Labels样式。我创建了一个示例样式here

最后,这些都是上述问题的解决方法,可能很快就会解决。希望这可以帮助你!