title: Google Maps Street View Panorama scrollwheel false still catches scrollwheel
body: <p>jsfiddle of Google Street View Problem here:  <a href="https://jsfiddle.net/d8qgfcvf/4/" rel="noreferrer">https://jsfiddle.net/d8qgfcvf/4/</a></p>
  
  <p>jsfiddle of my sad attempt to simulate how the Regular Google Map does this, by implementing a z-index element on top of it to be able to scroll the page when over the StreetViewPanorama, but this example is not able to drag the StreetView like you can drag the regular map: <a href="https://jsfiddle.net/Ltjz44gg/3/" rel="noreferrer">https://jsfiddle.net/Ltjz44gg/3/</a></p>
  
  <p>Ok, have been battling with this scrollwheel problem in StreetViewPanorama Google Maps view.  As I am using both the basic map, and the StreetViewPanorama.  Here is the basics of my code:</p>
  
  <pre><code>var theMapOptions =
  {
      backgroundColor     : "#B0C0C6",
      zoom                : 16,
      maxZoom             : 20,
      minZoom             : 2,
      disableDefaultUI    : true,
      center              : new google.maps.LatLng(Property.map['lat'], Property.map['lng']),
      mapTypeId           : google.maps.MapTypeId.ROADMAP,
      mapTypeControl      : false,
      zoomControl         : true,
      panControl          : true, 
      streetViewControl   : true,
  
      panControlOptions: {
          position: google.maps.ControlPosition.TOP_LEFT
      },
  
      zoomControlOptions: {
          style   : google.maps.ZoomControlStyle.LARGE,
          position: google.maps.ControlPosition.TOP_LEFT
      }
  };
  
  var theStreetMapOptions = 
  {
      position    : new google.maps.LatLng(Property.map['lat'], Property.map['lng']),
      pov: {
          heading: 135,
          pitch: -10
      },
      scrollwheel: false, // If I remove this scrolling occurs in map, if I keep it the page is still not able to be scrolled, why?
      motionTrackingControlOptions: {
          position: google.maps.ControlPosition.LEFT_BOTTOM
      }
  };
  
  var theMap = new google.maps.Map(document.getElementById('mapID'), theMapOptions);
  // A custom styles json array (not included, since it's irrelevant)
  theMap.setOptions({styles: styles});
  
  
  var theMapMarkerOptions = 
  {
      map         : theMap,
      position    : new google.maps.LatLng(Property.map['lat'], Property.map['lng']),
      draggable   : false,
      visible     : true
  }
  
  var theMapMarker = new google.maps.Marker(theMapMarkerOptions);
  theMapMarker.Map = theMap;
  
  theMapMarker.setMap(theMap);
  
  var theStreetMap = new google.maps.StreetViewPanorama(document.getElementById('map-street'), theStreetMapOptions);
  theMap.setStreetView(theStreetMap);
  </code></pre>
  
  <p>However, when outputting this, the scrollwheel is still being caught and am not able to scroll the webpage anymore if my mouse is inside of the StreetViewPanorama Map.  So I have went down another path here to try and set an overlay div on the map to act in the same way as the basic Google Map does when scrolling over it, and have done this:</p>
  
  <p>id of <code>map-street</code> is the container which holds the StreetViewPanorama Map btw.</p>
  
  <p>html:</p>
  
  <pre><code>&lt;div id="mapID" class="col-xs-24 col-md-12"&gt;&lt;/div&gt;
  &lt;div id="map-street" class="col-xs-24 col-md-12"&gt;&lt;div class="block-scrolling fade"&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>less:</p>
  
  <pre><code>.transition (@transition) {
      -webkit-transition: @transition;
      -moz-transition:    @transition;
      -ms-transition:     @transition;
      -o-transition:      @transition;
  }
  
  .block-scrolling {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,.3);
      z-index: 2;
      .transition(all .25s linear);
      p {
          position: relative;
          text-align: center;
          top: 50%;
          transform: translateY(-50%);
          color: white;
          font-size: 26px;
      }
  }
  </code></pre>
  
  <p>jquery:</p>
  
  <pre><code>// Need to simulate scroll over google map for StreetViewPanorama, so this code is needed!
  $(document).on('keydown keyup', function(e) {
      var io = e.type == 'keydown' ? 0 : 1;
  
      if ((e.ctrlKey || e.metaKey) &amp;&amp; $('.block-scrolling').data('mouseover')) {
          e.preventDefault();
  
          console.log($('.block-scrolling').data('mouseover'));
  
          if (io === 0)
              $('.block-scrolling').css({zIndex: -1});
          else
              $('.block-scrolling').removeClass('in').css({zIndex: 2});
  
          return false;
      }
      else
          $('.block-scrolling').css({zIndex: 2});
  
      return true;
  });
  
  
  $(".block-scrolling").mouseenter(function() {
      clearTimeout($(this).data('timeoutId'));
      $(this).data('mouseover', true);
  }).mouseleave(function(){
      var scrollingElement = $(this),
          timeoutId = setTimeout(function(){
              scrollingElement.data('mouseover', false);
          }, 50);
      //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
      scrollingElement.data('timeoutId', timeoutId); 
  });
  
  $(".block-scrolling").on('scroll wheel DOMMouseScroll mousewheel touchstart', function(e) {
  
      var $this = $(this),
          $text = e.type == 'touchstart' ? 'Use two fingers to move the map' : (e.type == 'wheel' ? 'Use &amp;#8984; + scroll to zoom the map' : 'Use Ctrl + scroll to zoom the map');
  
      clearTimeout($.data(this, 'scrollTimer'));
      $this.find('p').html($text);
      $this.addClass('in');
  
      var scrollingElement = $(this);
  
      if (e.type == 'touchstart')
      {
          if (e.hasOwnProperty('touches') &amp;&amp; e.touches.length &amp;&amp; e.touches.length &gt; 1)
              $this.css({zIndex: -1});
      }
  
      $.data(this, 'scrollTimer', setTimeout(function() {
          scrollingElement.removeClass('in');
      }, 2000));
  });
  </code></pre>
  
  <p>The jquery code is very close to what google maps provides for the basic map when scrolling over it, however, seems that the basic google map is allowing you to drag (on the map) even when the overlay is visible.  This part I can not, for the life of me, figure out, because if I disable css pointer-events than the other jquery mouse events don't work.</p>
  
  <p>What would be preferable here, would be if the scrollwheel: false actually worked and allowed the webpage to still be scrolled if the mouse is over that StreetViewPanorama Map element (<code>map-street</code>) when scrolling.  It would be nice if it worked the same way the Google Maps actually worked, when displaying a normal map actually, where there is no need for <code>scrollwheel: false</code> at all on this.  But without scrollwheel: false, the Panorama View catches the mouse into a scroll on that view.</p>
  
  <p>How to either disable the scrollwheel on StreetViewPanorama and not catch the mouse on scroll (while still allowing the StreetView map to be managed)?</p>
  
  <p>Or </p>
  
  <p>How to keep the scrolling on the streetview but do like Google Maps does and have an overlay (while still allowing the page to be scrolled), but still allow the map to be dragged (like the exact way the basic google map does)?</p>
  
  <p>Would prefer an answer to the 2nd question, but either will do.  If there was a way to drag the StreetViewPanorama though the <code>block-scrolling</code> div element that would probably fix it also (if there is no way to do this via StreetViewPanorama options).</p>