D
D
DoubleWish2014-03-06 20:11:35
Google
DoubleWish, 2014-03-06 20:11:35

How to disable scrolling on map inserted via iframe (by google)?

There is an inserted map in the markup via an iframe (created on google maps) and reacts to scrolling.

When you scroll to it, the mouse switches to it and starts scrolling it, instead of moving normally. But at the same time, without superimposing a stupid layer on top, but leaving the opportunity to "drag" the map with the button held down and zoom in through the buttons.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Roman Misyura, 2014-03-07
@ZeroPT

Actually, you can do it in a slightly different way. Using the Google Maps API.
You can look here stackoverflow.com/questions/2330197/how-to-disable...
Or, for example, I did something like this:

google_maps(); // Load google maps onload page

      function google_maps() {
                var latlng = new google.maps.LatLng(55.736812,37.617574);
                var settings = {
                  zoom: 16,
                  center: latlng,
                  mapTypeControl: true,
                  mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
              scrollwheel: false,
              disableDoubleClickZoom: true,
                  navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
                  mapTypeId: google.maps.MapTypeId.ROADMAP
              };
      var map = new google.maps.Map(document.getElementById("map"), settings);
        var myLatlng = new google.maps.LatLng(55.736812,37.617574);
        
        var myOptions = {
          zoom: 16,
          center: myLatlng,
          scrollwheel: false,
          disableDoubleClickZoom: true,
          mapTypeId: google.maps.MapTypeId.ROADMAP
        }

PS I do not pretend to be the most elegant solution. I think it can be done sooner.

W
WEBIVAN, 2014-03-06
@WEBIVAN

You can pervert and put a transparent div on top of the iframe, but then the map cannot be controlled at all. Well, although you can get even more perverted and click on the transparent div to remove it.

D
Dmitry, 2015-02-22
@soledar10

behaviors: ["dblClickZoom", "rightMouseButtonMagnifier", "multiTouch"]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question