-1

I am trying to embed the latest Google Street View of the International Space Station to a new page that I am creating. The problem is that I get a black screen and the message "Image may be subject to copyright". I am not an expert of coding (far from it) and I am not sure how to proceed. If anyone has an idea, you are welcome. Thank you.

Here is my code and live here: 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>
Dimitris
  • 35
  • 1
  • 8
  • I didn't meant to mean rude. I wrote "Hi guys" at the start but is not showing it. – Dimitris Feb 16 '18 at 10:59
  • 1
    We actually don't like things like "hi guys" and "thanks in advance" and "I'm really new to " here (and frequently edit them out). It is useless fluff that adds nothing to the question. Only the important stuff matters, like making sure your post conforms to what [ask] page asks, and if you have a faulty code snippet, is it a [mcve] (and so on) – Sergio Tulentsev Feb 16 '18 at 11:22
  • Thank you Sergio, good to know. – Dimitris Feb 16 '18 at 11:33

1 Answers1

2

I did an Geocoding API search using your coordinates and I got the following address

4th St, Houston, TX 77058, USA

This the NASA JSC building 7, it's a government research center so google has no panoramic data on it through it's Maps APIs on purpose.

Furthermore if you were to make a Search View Image API search using your location in the jsfiddle or the address you get no results.

https://maps.googleapis.com/maps/api/geocode/json?address=4th%20St%2C%20Houston%2C%20TX%2077058%2C%20USA&key=YOUR_KEY
Franco Vizcarra
  • 428
  • 2
  • 11
  • Thank you for your help Franco. Interesting... I had a second solution where you just embed the google Streetview code. I think this works better but the reason I tried the previous code is because I could disable the clickToGo code so you cannot navigate. Is there a way to disable click on the iframe? Here is my code: http://jsbin.com/faqifoyopi/edit?html,output – Dimitris Feb 16 '18 at 13:06
  • No that wouldn't work, the issue is that there is no Panoramic data to construct the Street View regardless of what API method you use. Furthermore, this is on purpose so there won't be this data in the future. I'm happy my answer was helpful. In Stack Overflow you show your apreciation by clicking the upvote button on my answer. Cheers! – Franco Vizcarra Feb 16 '18 at 13:29
  • I am sure I upvote your answer (dont know if you can see it). So there is no way I can use this exactly place for a projects. Sucks!! Thank you though – Dimitris Feb 16 '18 at 13:40
  • Sorry mate my mistake, you have to accept the answer. – Franco Vizcarra Feb 16 '18 at 13:51
  • 1
    Hi Franco. Google has a panoramic data for this location: https://www.google.com/maps/@29.5602853,-95.0853914,2a,75y,213.12h,90.18t/data=!3m7!1e1!3m5!1szChzPIAn4RIAAAQvxgbyEg!2e0!3e5!7i10000!8i5000 – Dimitris Feb 21 '18 at 11:24