颜色“感兴趣区域”在Google Maps API上? [英] Color "areas of interest" on Google Maps API?

查看:99
本文介绍了颜色“感兴趣区域”在Google Maps API上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google刚刚改变了地图颜色方案,并且在我正在处理的网站上混淆了自定义颜色。这是他们博客的新闻:

使用更新后的Google地图发现您身边的动作

现在,这里没有太多的技术信息。有没有人已经发现在哪里可以改变那些浅褐色/橙色 - 感兴趣区域的颜色? b从测试这里(并且这个链接在他们的开发站点上),唯一对它做任何事的是 all ,更具体的可以使用特征类型:全部元素类型:geometry.fill

解决方案

要真正'隐藏'感兴趣的区域:首先在全部几何图形上设置颜色,并通过指定水,公园,道路等的颜色来覆盖该设置。



代码示例:

  var myStyle = [
{featureType:all,elementType:geometry.fill,stylers:[{color:#CCCCCC}]},
{featureType:water,elementType:geometry,stylers:[{色调:#99CCFF},{亮度:30},{饱和度:50}]},
{featureType:road,elementType:geometry,stylers:[{color:#eeeeee} ,{lightness:30},{visibility:simplified}]},
{featureType:landscape.natural,elementType:geometry,stylers:[{color:#c4d7cd}]},
{featureType:poi.park,elementType:geometry,stylers:[{color:#b4d9c6}]},
];


Google has just changed the maps colors scheme and it has messed up the custom colors on a site I'm working on. This is the news from their blog:

Discover the action around you with the updated Google Maps

Now, not much technical info there. Has anyone already found out where to change that light brown/orange-ish color for "areas of interest"?

From testing here (and this link is on their dev site), the only thing that does anything to it is all, and the more specific you can go is with Feature type: all Element type: geometry.fill

解决方案

To really 'hide' the areas of interest: first set a color on all geometries, and than override that setting by specifying the colors for water, parks, roads et cetera.

Code sample:

var myStyle = [
    {featureType: "all", elementType: "geometry.fill", stylers: [{color: "#CCCCCC"}]},
    {featureType: "water", elementType: "geometry", stylers: [{hue: "#99CCFF"}, {lightness: 30}, {saturation: 50}]},
    {featureType: "road", elementType: "geometry", stylers: [{color: "#eeeeee"},{lightness: 30},{visibility: "simplified"}]},
    {featureType: "landscape.natural", elementType: "geometry", stylers: [{color: "#c4d7cd"}]},
    {featureType: "poi.park", elementType: "geometry", stylers: [{color: "#b4d9c6"}]},
];

这篇关于颜色“感兴趣区域”在Google Maps API上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆