谷歌地图API v3隐藏“滑雪道”

时间:2013-10-01 06:33:23

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

无论如何都要隐藏Google默认和地形图中的滑雪道吗?

我们可以使用“featureType”道路隐藏道路并关闭设置可见性。但似乎没有相当于滑雪道或小径。

http://techcrunch.com/2013/03/25/google-adds-trail-maps-for-100-additional-ski-resorts-to-google-maps/

1 个答案:

答案 0 :(得分:2)

这是我隐藏滑雪场的黑客行为:

   map.setOptions({styles: [
  {
     "featureType": "all", // non valid, hide all
     "stylers": [{ "visibility": "off" }]
  },
  {
      "featureType": "administrative",
      "elementType": "geometry",
      "stylers": [{ "visibility": "on" }]
    },{
      "featureType": "landscape",
      "stylers": [{ "visibility": "on" }]
    },{
      "featureType": "road",
      "stylers": [{ "visibility": "on" }]
    },{
      "featureType": "transit",
      "stylers": [{ "visibility": "on" }]
    },{
      "featureType": "water",
      "stylers": [{ "visibility": "on" }]
    }
]});

您可以在此处查看结果:http://jsfiddle.net/69yG3/2/embedded/result/