Categories

Featured templates

WordPress. How to enable/disable mousewheel scrolling zoom on Google Map

Andre Flores September 22, 2015
Rating: 5.0/5. From 3 votes.
Please wait...

Hello! This video tutorial shows how to enable/disable mousewheel scrolling zoom in Google Map of WordPress templates.

WordPress. How to enable/disable mousewheel scrolling zoom on Google Map

You may have a Google Map at the bottom of the Home page of your WordPress template:

wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_1

Hover over the map and try scrolling with your mouse wheel – you can see the map zooms in/out while scrolling.

You may want to disable this function since it is quite annoying at times, when you want to simply scroll the page up and have the map zooming out instead.

Otherwise, you may want to have zoom enabled so your site visitors could easily navigate to the desired location on the map by using mousewheel scrolling zoom.

Let’s learn how to manage this function.

The tutorial assumes you are already logged into your WordPress dashboard.

  1. Navigate to Appearance -> Editor tab in the dashboard:

    wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_2

  2. Click the static-map.php title on the right hand side to open the file for editing:

    wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_3

  3. Now that the file editing interface is opened, use the CTRL+F/CMND+F key (Windows OS/Mac OS) to find the following piece of code:

var mapOptions

wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_4

You can see the following block of code below:

// How zoomed in you want the map to start at (always required)
zoom: <?php echo of_get_option('zoom'); ?>,
scrollwheel: true,

As you can see the scrollwheel function is set to “true” by default.

Simply replace it with “false” to disable the mousewheel scrolling so the code looks as follows:

// How zoomed in you want the map to start at (always required)
zoom: <?php echo of_get_option('zoom'); ?>,
scrollwheel: false,

Click the Update File” button at the lower part of the screen to apply changes:

wordpress_cherry_3x_how_to_enable_disable_mousewheel_scrolling_zoom_in_google_map_5

Navigate to your site front-end and refresh the page to see changes.

You can see the map mousewheel scrolling zoom is disabled now.

This is the end of the tutorial. You have learnt how to enable/disable mousewheel scrolling zoom in Google Map of your WordPress template.

Feel free to check the detailed video tutorial below:

WordPress. How to enable/disable mousewheel scrolling zoom on Google Map

Modern Wordpress Themes
This entry was posted in WordPress Tutorials and tagged google map, mousewheel, WordPress, Zoom. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket