google-maps-api – Scroll pages on google panoramas

Question:

Hello! When scrolling pages, when the mouse cursor enters the google panorama area in the iframe, the page scrolling stops. If you remove the mouse cursor from the panorama, the scroll works. How to make the page scrolling always work? Panorama settings:

function initialize() {

var streetViewService = new google.maps.StreetViewService();
var STREETVIEW_MAX_DISTANCE = 50;
var latLng = new google.maps.LatLng(<?php echo $row_kv["geo_coords"]; ?>);
streetViewService.getPanoramaByLocation(latLng, STREETVIEW_MAX_DISTANCE,         function (streetViewPanoramaData, status) {
if (status === google.maps.StreetViewStatus.OK) {

   var panorama = new      google.maps.StreetViewPanorama(document.getElementById("pano"), {
   position: new google.maps.LatLng(<?php echo $row_kv["geo_coords"]; ?>),
   visible: true,
   scrollwheel: false,
   disableDefaultUI: true,
   panControl:true,
   zoomControl:true,
   linksControl:true,
   fullscreenControl:true,
   zoom: 1
    });

    } else {

 document.getElementById("panorama").style.display = "none";

    }
});
  }
initialize();

Answer:

You need to add scrollwheel: false to ignore the scroll

Scroll to Top