当每个人都在尝试向Google map 添加更好的植被图像时,我需要一个干净的地理环境,上面没有任何植被和地形信息,这是由API V2完成的
目前,我有javascript:
var styles = [
{
featureType: "all",
stylers: [
{ saturation: -80 }
]
},{
featureType: "road.arterial",
elementType: "geometry",
stylers: [
{ hue: "#00ffee" },
{ saturation: 50 }
]
},{
featureType: "poi.business",
elementType: "labels",
stylers: [
{ visibility: "off" }
]
}
];
var mapOptions = {
center: new google.maps.LatLng(37.774546, -122.4335235),
zoom: 3,
styles: styles
};
这可以给我返回灰色图像,但是上面仍然有植被和地形。我找不到样式类型或与我的问题有关的其他任何内容。谁能帮我吗?
最佳答案
码
JSON(将其放入styles
数组中):
{
"featureType": "landscape.natural.terrain",
"stylers": [
{ "visibility": "off" }
]
},{
"featureType": "landscape.natural.landcover",
"stylers": [
{ "visibility": "off" }
]
},{
"featureType": "poi.park",
"stylers": [
{ "visibility": "off" }
]
},{
"featureType": "water",
"stylers": [
{ "visibility": "off" }
]
}
它能做什么
完全删除:
预习
之前(默认样式):
之后(自定义样式):