javascript - Google Maps API 上的颜色 "areas of interest"?

标签 javascript google-maps google-maps-api-3

Google 刚刚更改了 map 配色方案,它弄乱了我正在使用的网站上的自定义颜色。这是来自他们博客的消息:

Discover the action around you with the updated Google Maps

现在,那里没有太多技术信息。有没有人已经找到在哪里更改“感兴趣区域”的浅棕色/橙色颜色?

来自测试here (这个链接在他们的开发网站上),唯一能对它做任何事情的是 all,你可以使用的更具体的是 Feature type: all Element type: geometry。填充

最佳答案

我大胆地为 "featureType":"areaOfInterest" 设置了修饰符,令人惊讶的是它起作用了!!您可以使用 areaOfInterest 作为要素类型来为其定位样式,就像您使用任何其他要素类型一样。

我设置了这个样式,得到了如下结果:

{
  "featureType":"areaOfInterest",
  "stylers":[
    {"saturation" : -100},
    {"lightness"  : 25},
    {"visibility" : "simplified"}
  ]
}

请记住,此样式适用于 gmaps4rails gem 插件,语法可能因您的应用程序而异。

之前: enter image description here

之后: enter image description here

关于javascript - Google Maps API 上的颜色 "areas of interest"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38599809/

相关文章:

php - 嵌入式 Google map 错误 - 阻止了具有来源的框架

iphone - 通过在iphone sdk中解析获取城市名称

javascript - 如何在谷歌地图上显示多个标记?

javascript - 使用命名函数在循环中添加 google.maps.event.addListener

javascript - 从 Google Maps API for Javascript 获取 TravelTime

javascript - Mongoose 将聚合函数转换为 Sequelize

Javascript match()、正则表达式

javascript - 我如何知道何时在输入字段中输入了一个字符?

javascript - 无法安装 jspdf 1.5.3

javascript - 如何删除谷歌地图 Api v3 中的道路标签?