5

I'm looking to set the "color" of the water to transparent in a way, that the div behind the map is displayed in these areas.

Is there a method of achieving this? I already tried the following, which doesn't work:

"stylers": [
  { "visibility": "off" }
]

it only sets the areas to some kind of nothing-color, but there's no transparency.

4

1 回答 1

4

问题是,在水下仍然是另一个特征,landscape.natural.

以下适用于我到 zoomLevel 5:

          [{   //hide all fills
              "elementType": "geometry.fill",
                  "stylers": [{
                  "visibility": "off"
              }]
          }, {//and show the landcover
              "featureType": "landscape.natural.landcover",
                  "elementType": "geometry.fill",
                  "stylers": [{
                  "visibility": "on"
              }]
          }]

它可能不是解决方案,但它表明它绝非不可能。也许您还可以找到一些更高缩放级别的设置。

演示:http: //jsfiddle.net/doktormolle/ME35L/


一种特别适用于 InternetExplorer 的方法(适用于所有缩放级别)。

为水景定义一个特定的颜色(比如说#123456),并对地图中的所有图像使用色度过滤器:

#map_canvas img {
    filter:Chroma(color=#123456)
}

演示:http: //jsfiddle.net/doktormolle/4V5U8/

于 2013-09-21T23:49:52.663 回答