2016-07-26 119 views
1

在下图中,您可以看到我的风格版本和地图的默认版本。米色的功能在上周的某个时候突然出现,似乎标志着某种类型的商业区域。Google Maps API:这是什么功能?

没有任何列出的功能类型in the API reference似乎影响它。

Styled and unstyled version of a map highlighting the unknown feature

这些都是我已经分配给我的版本地图的样式。

googleMapStyle = [ 
     { 
     "featureType": "administrative", 
     "stylers": [ 
      { "visibility": "off" } 
     ] 
     },{ 
     "featureType": "road", 
     "stylers": [ 
      { "visibility": "simple" }, 
      { "color": "#393939" } 
     ] 
     },{ 
     "elementType": "labels", 
     "stylers": [ 
      { "visibility": "off" } 
     ] 
     },{ 
     "featureType": "water", 
     "stylers": [ 
      { "color": "#303030" } 
     ] 
     },{ 
     "featureType": "landscape", 
     "stylers": [ 
      { "color": "#2a2a2a" } 
     ] 
     },{ 
     "featureType": "poi", 
     "stylers": [ 
      { "color": "#393939" }, 
      { "visibility": "off" } 
     ] 
     },{ 
     "featureType": "transit", 
     "elementType": "geometry", 
     "stylers": [ 
      { "visibility": "off" } 
     ] 
     },{ 
     "featureType": "administrative", 
     "elementType": "geometry.stroke", 
     "stylers": [ 
      { "visibility": "on" }, 
      { "color": "#393939" } 
     ] 
     } 
    ]; 

有谁知道这是什么功能类型以及如何摆脱它?

+0

相关的问题:?如何风格在谷歌地图的高尔夫球场(沙丘和绿色)(http://stackoverflow.com/questions/38513342/how-to-style-golf-courses-in -google-mapssand-dunes-and-green) – geocodezip

+0

@geocodezip感谢那个问题也解决了我的问题。 – Seraphithan

回答

0

似乎有无证的功能类型。在你的情况下,我发现使用featureType building影响那些,ahem,建筑物。

googleMapStyle = [ 
     { 
     "featureType": "building", 
     "stylers": [ 
      { "visibility": "off" } 
     ] 
     },{ 
     ... 
     } 
    ]; 
+0

“建筑物”似乎不是“特征类型”。看起来像地图遇到未知的“featureType”时,它被视为“全部”,并且因为您将它作为第一条规则工作,并且当我作为最后一条规则添加时,我的整个地图消失了。 – Seraphithan

相关问题