您可以使用“样式”隐藏地图功能。此外,地图样式向导对此非常有用:https://mapstyle.withgoogle.com/
https://developers.google.com/maps/documentation/javascript/styling
造型:
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 17,
center: {lat: 40.707165, lng: -73.947074},
styles: [
{
"featureType": "poi",
"elementType": "labels",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "on"
}
]
}
]
});
您可以使用“TrafficLayer”在JavaScript Map中显示流量:https://developers.google.com/maps/documentation/javascript/examples/layer-traffic
TrafficLayer:
var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(map);
}
这是一个小提琴样本:https://jsfiddle.net/xkcpL85h/