Can ScrollWheel be disabled on normal street view?

I create a site, and I have a page that takes an address and uses it to create a google map of a 2D roadmap, and then next to it, street view for that address.

My problem is that these two maps cover almost the entire width of the site, and the user will most likely scroll it, scrolling the page and getting confused because of the inability to scroll down (when zooming the map).

Turning this off for the 2D map was pretty solid.

//works to disable scroll wheel in 2D map var mapOptions = { zoom: 12, center: latlng, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions ); //not working to disable scroll wheel in panorama var panoramaOptions = { position: results[0].geometry.location, scrollwheel: false }; panorama = new google.maps.StreetViewPanorama(document.getElementById("map_canvas2"), panoramaOptions ); 

but street view does not allow me to disable the scroll wheel using these options, and I can not find this problem, indicated in google docs. Does anyone know if this can be implemented or suggestions on how to approach it?

+6
javascript google-maps google-street-view panoramas
source share
4 answers

I have the same problem when the user scrolls with the mouse wheel, the cursor goes to Google Street and starts scaling instead of scrolling the page.

On Google Maps, they provide a scrollwheel property that can disable this, but unfortunately, this does not look like a street view implementation.

The only workaround I have found so far is that @bennedich said in the previous answer, I placed the empty / transparent div exactly in the street div div.

I turn on the controls when the user clicks anywhere on the street viewport using jQuery to hide this empty div (using the css visibility property) on the mousedown event, and when the user moves your mouse, I put that empty div back over. Which basically means that every time the user wants to interact with street control, he has to click it once. This is not the best solution, but it is better than making your mouse catch up while scrolling

+3
source share

A function request was discovered with Gmaps API v3 problems to add scrollwheel: false to streetview http://code.google.com/p/gmaps-api-issues/issues/detail?id=2557 . This is now fixed, just use scrollwheel: false in the settings of StreetViewPanorama .

+10
source share

I do not know about the javascript method, but with html and css you can put an invisible div with a higher z-index on the map / streetview.

0
source share

Google has a fix to resolve this issue.

The fix that works now is to set the version number explicitly to 3.25 for scrollwheel: false .

Example: https://maps.googleapis.com/maps/api/js?key=XXX&v=3.25

0
source share

All Articles