我正在尝试将国际空间站的最新谷歌街景嵌入到我正在创建的新页面中。问题是我得到一个黑屏和“图像可能受版权保护”的消息。我不是编码专家(远非如此),我不确定如何进行。如果有人有想法,欢迎您。谢谢你。
这是我的代码并住在这里:http: //jsbin.com/cipiyofesa/edit ?html,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Street View controls</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initPano() {
// Note: constructed panorama objects have visible: true
// set by default.
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('map'), {
position: {lat: 29.5602853, lng: -95.0853914},
pov: {heading: 165, pitch: 0},
addressControl: false,
visible: true,
linksControl: false,
panControl: false,
enableCloseButton: false,
zoomControl: false,
fullscreenControl: false,
motionTrackingControl: false,
clickToGo: false,
disableDefaultUI: true,
scrollwheel: false,
linkscontrol: false,
pancontrol: true
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=API_KEY&callback=initPano" allowfullscreen
frameborder="0" style="border:0">
</script>
</body>
</html>