Freeze a map

There are different ways to go about this. You can choose to have this code appear for all areas of your website, or simply set it up on a single page. Here’s how you would go about doing both.

Enable the code site-side

  1. navigate to your site-wide header code injection - SETTINGS > ADVANCED > CODE INJECTION > HEADER CODE INJECTION.

  2. Paste the code below in the websites header code injection area.

  3. Click SAVE.

To enable the code on a single page

  1. Navigate to your desired page settings - PAGES > HOVER OVER PAGE > CLICK SETTINGS ICON > ADVANCED

  2. Paste the code below in the code injection section

  3. Click SAVE.

CODE:

 <script>
   var disable_map_scroll = function() {
     Y.all(".page-map").each(function(el) {
       if(el._node.__map) {
         el._node.__map.setOptions({'scrollwheel': false});
       }
     });
   };
 
   Y.on("domready", function() {
     // Try a few times to account for Google Maps initialization delay.
     setTimeout(disable_map_scroll, 50);
     setTimeout(disable_map_scroll, 500);
     setTimeout(disable_map_scroll, 1000);
   });
 </script>