It's the 15th anniversary of Google Maps Platform - Check out the latest news and announcements

Street View Side-By-Side

This example displays the Street View for a location alongside a map. The map displays the position and point of view shown in the Street View window.

Read the documentation.

JavaScript

function initialize() {
  var fenway = { lat: 42.345573, lng: -71.098326 };
  var map = new google.maps.Map(document.getElementById("map"), {
    center: fenway,
    zoom: 14
  });
  var panorama = new google.maps.StreetViewPanorama(
    document.getElementById("pano"),
    {
      position: fenway,
      pov: {
        heading: 34,
        pitch: 10
      }
    }
  );
  map.setStreetView(panorama);
}

CSS

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#map,
#pano {
  float: left;
  height: 100%;
  width: 50%;
}

HTML

<!DOCTYPE html>
<html>
  <head>
    <title>Street View split-map-panes</title>
    <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
    <script
      src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initialize&libraries=&v=weekly"
      defer
    ></script>
    <link rel="stylesheet" type="text/css" href="./style.css" />
    <script src="./app.js"></script>
  </head>
  <body>
    <div id="map"></div>
    <div id="pano"></div>
  </body>
</html>

All

<!DOCTYPE html>
<html>
  <head>
    <title>Street View split-map-panes</title>
    <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
    <script
      src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initialize&libraries=&v=weekly"
      defer
    ></script>
    <style type="text/css">
      html,
      body {
        height: 100%;
        margin: 0;
        padding: 0;
      }

      #map,
      #pano {
        float: left;
        height: 100%;
        width: 50%;
      }
    </style>
    <script>
      (function(exports) {
        "use strict";

        function initialize() {
          var fenway = {
            lat: 42.345573,
            lng: -71.098326
          };
          var map = new google.maps.Map(document.getElementById("map"), {
            center: fenway,
            zoom: 14
          });
          var panorama = new google.maps.StreetViewPanorama(
            document.getElementById("pano"),
            {
              position: fenway,
              pov: {
                heading: 34,
                pitch: 10
              }
            }
          );
          map.setStreetView(panorama);
        }

        exports.initialize = initialize;
      })((this.window = this.window || {}));
    </script>
  </head>
  <body>
    <div id="map"></div>
    <div id="pano"></div>
  </body>
</html>
(function(exports) { "use strict"; function initialize() { var fenway = { lat: 42.345573, lng: -71.098326 }; var map = new google.maps.Map(document.getElementById("map"), { center: fenway, zoom: 14 }); var panorama = new google.maps.StreetViewPanorama( document.getElementById("pano"), { position: fenway, pov: { heading: 34, pitch: 10 } } ); map.setStreetView(panorama); } exports.initialize = initialize; })((this.window = this.window || {}));
html, body { height: 100%; margin: 0; padding: 0; } #map, #pano { float: left; height: 100%; width: 50%; }
<!DOCTYPE html> <html> <head> <title>Street View split-map-panes</title> <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script> <script src="https://maps.googleapis.com/maps/api/js?key=&callback=initialize&libraries=&v=weekly" defer ></script> <!-- jsFiddle will insert css and js --> </head> <body> <div id="map"></div> <div id="pano"></div> </body> </html>