How can I use an URL inside Google Street View javascript code?

Discussion in 'JavaScript' started by matheusgrafix, Jun 22, 2012.

  1. #1
    I have this code:
    
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Street View Layer</title>
    <link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
    <script type="text/javascript">
    
      function initialize() {
        var fenway = new google.maps.LatLng(42.345573,-71.098326);
        var mapOptions = {
          center: fenway,
          zoom: 14,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(
            document.getElementById("map_canvas"), mapOptions);
        var panoramaOptions = {
          position: fenway,
          pov: {
            heading: 34,
            pitch: 10,
            zoom: 1
          }
        };
        var panorama = new  google.maps.StreetViewPanorama(document.getElementById("pano"),panoramaOptions);
        map.setStreetView(panorama);
      }
    </script>
    </head>
    <body onload="initialize()">
      <div id="map_canvas" style="width: 400px; height: 300px"></div>
      <div id="pano" style="position:absolute; left:410px; top: 8px; width: 400px; height: 300px;"></div>
    </body>
    </html>
    
    Code (markup):

    I think it has something to do with this line:

    var fenway = new google.maps.LatLng(42.345573,-71.098326);
    Code (markup):
    But I dont seem to find anything in the web that can help me out here.
    Want to be able to use this URL inside the code: https://maps.google.com/?ll=28.921631,-75.585937&spn=48.811746,67.763672&t=m&z=4&layer=c&cbll=42.666186,-103.466193&panoid=qrOXOx-slQb3nO5G37kxcg&cbp=12,196.68,,0,3.67


    That's for a web site that will mix php with js.
     
    matheusgrafix, Jun 22, 2012 IP
  2. design006

    design006 Member

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Try taking out all of the other styling and sizing and see if you can just get it to load. Work your way backwards and you'll find what it is. That's my suggestion.
     
    design006, Jun 24, 2012 IP