Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1318941

    Hello,

    i want to enable the Mouse in my embedded google maps, that i can zoom in and out with my mousewheel.

    Is there any quick solution for this?

    Greets
    Soehnke

    #1319255

    Hey Soehnke,

    Thank you for the inquiry.

    According to the documentation, you can set the gestureHandling parameter of the map to “greedy” to allow any gestures (e.g touch, pan, pinch, scroll). Unfortunately, the documentation did not specify if this will also include the mousewheel.

    Try to add this script in the functions.php file.

    function ava_custom_script_map_params(){
    ?>
    	<script>
    		window.addEventListener('DOMContentLoaded', () => {
    			window.av_google_map.av_gmap_0.gestureHandling = "greedy";
                            window.av_google_map.av_gmap_0.scrollwheel = true;
    		});
    	</script>
    <?php
    }
    add_action('wp_footer', 'ava_custom_script_map_params', 9999);
    

    Default value of the gestureHandling parameter is “cooperative”.

    UPDATE: There is actually a scrollwheel option. We added it above and set it to true.

    Best regards,
    Ismael

    #1319314

    Perfekt! Works fine. You can close this Thread.

    #1319566

    Hi,

    Alright. But please note that the modification above will only work for the first map in the page. If you have multiple maps in the page, only the first map will be scrollable with the mousewheel. Please feel free to open another thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Enable Mouse(wheel) in Google Maps’ is closed to new replies.