Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Google Maps: How to disable mouse scroll wheel with Google Maps API ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 687
    Comment on it

    Diable Google Maps scrolling:

    I was facing issue with Google Maps API version 3. On page scroll, google maps scroll should be disabled i.e. I have to disable zooming when you scroll on the map. So this is how I have fixed this issue. Write this code:

    $.fn.showMap = function(options, addr){
      options = $.extend({
        scrollwheel: false,
        navigationControl: false,
        mapTypeControl: false,
        scaleControl: false,
        draggable: false,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }, options);
      var map = new google.maps.Map(document.getElementById($(this).attr('id')), options);
      // code cut from this example as not relevant

    set scrollwheel to false, all done!

    Thanks for reading the blog.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: