-1

我正在尝试将国际空间站的最新谷歌街景嵌入到我正在创建的新页面中。问题是我得到一个黑屏和“图像可能受版权保护”的消息。我不是编码专家(远非如此),我不确定如何进行。如果有人有想法,欢迎您。谢谢你。

这是我的代码并住在这里: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>
4

1 回答 1

2

我使用您的坐标进行了地理编码 API 搜索,得到了以下地址

4th St, 休斯顿, TX 77058, USA

这是 NASA JSC 7 号楼,它是一个政府研究中心,所以谷歌没有通过它的 Maps API 故意提供全景数据。

此外,如果您要使用您在 jsfiddle 中的位置或地址进行搜索查看图像 API 搜索,您将得不到任何结果。

https://maps.googleapis.com/maps/api/geocode/json?address=4th%20St%2C%20Houston%2C%20TX%2077058%2C%20USA&key=YOUR_KEY
于 2018-02-16T12:44:37.303 回答