Street View service

by hendrikdegraaf

HTML

<div class="filler">
  <p>
  Scroll down with mouse over the map....
  </p>
  <p>
  Scroll down with mouse over the streetview....
  </p>
  <p>
  See the difference... it's some weird API bug
  </p>
</div>
<div id="map"></div>
<div id="pano"></div>
<div class="filler"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script async defer
        src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initialize">
    </script>

CSS

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
#map, #pano {
  display: inline-block;
  height: 100%;
  width: 45%;
}
.filler {
  background-color: #ffe4c4;
  height: 200px;
}

JavaScript

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