使用Google Map API v3并使用样式化地图类型时,我无法隐藏放大时显示的平面图。有许多“MapTypeStyleFeatureType”选项,其中任何一个都无法隐藏平面图
https://developers.google.com/maps/documentation/javascript/reference#MapTypeStyleFeatureType
API v3文档似乎没有包含有关平面图的任何内容。需要明确的是,这是平面图的一个例子:
任何帮助或指示都将不胜感激。
谢谢, 乔恩。
答案 0 :(得分:3)
好的经过一些实验,这就是我的定居......在第一种风格中将所有颜色设置为灰色(或任何你想要的平面图颜色),然后重新着色你想要的一切以下样式。这导致平面图显示为单个颜色块。
var styles = [
{
featureType: "all",
stylers: [
{ color: "#505050" }
]
},
{
featureType: "road",
elementType: "geometry",
stylers: [
{ visibility: "simplified" },
{ color: '#505050' }
]
},
{
featureType: "all",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
},
{
featureType: "administrative",
stylers: [
{ visibility: "off" }
]
},
{
featureType: "transit",
stylers: [
{ visibility: "off" }
]
},
{
featureType: "poi",
stylers: [
{ visibility: "off" }
]
},
{
featureType: "landscape",
stylers: [
{ color: '#FF0000' }
]
},
{
featureType: "landscape.man_made",
stylers: [
{ color: '#393939' }
]
},
{
featureType: "landscape.natural",
stylers: [
{ color: '#393939' }
]
},
{
featureType: "water",
stylers: [
{ color: '#252525' }
]
}
];
答案 1 :(得分:1)
似乎“全部”选项是唯一可以关闭标签的选项:
虽然poi.attraction似乎关闭了博物馆的名称,但不是平面图