StreetViewCoverageLayer在文档中进行了描述:
StreetViewCoverageLayer类google.maps.StreetViewCoverageLayer类别
说明街景视图可用位置的图层。
此类扩展了MVCObject。
构造函数StreetViewCoverageLayer | StreetViewCoverageLayer()参数:无创建StreetViewCoverageLayer的新实例。
代码段:
function initialize() {
var fenway = {lat: 42.345573, lng: -71.098326};
var map = new google.maps.Map(document.getElementById('map'), {
center: fenway,
zoom: 14
});
var streetViewLayer = new google.maps.StreetViewCoverageLayer();
streetViewLayer.setMap(map);
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
width: 100%;
}
<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initialize">
</script>