New home › Forums › Pro Add-on › General queries › map and scrolling page by mouse – stop scroll
Tagged: map, mouse scroll, scroll
- This topic has 3 replies, 2 voices, and was last updated 9 months, 1 week ago by Matthew.
-
AuthorPosts
-
December 16, 2022 at 2:22 pm #75731kndParticipant
Hi,
How can i prevent interact with scrolling page by mouse where i have map installed? I would like to have possibility to zoom and zoom out by mouse scroll + ctrl on map but after click on It or smth like that. Now when i scroll over map using mouse scroll page stops over map and its annoying.
Please let me know how change some JS code to
December 19, 2022 at 9:00 am #75765MatthewModeratorHi there,
Thank you for getting in touch with us, we do appreciate your time.
If I understand correctly, it sounds like you may have greedy gesture handling enabled as the map zooms when you simply scroll over the map.
With that said, please may you ensure that your “Greedy Gesture Handling” setting is disabled (Maps -> Settings -> General Settings)?
Once this has been done, please may you confirm if this helps?
I look forward to hearing back from you.
Kindest Regards,
MatthewDecember 19, 2022 at 1:54 pm #75787kndParticipantHi,
Yes it works good 🙂
is possible to enable this option only for mobile?
best regards
M.December 21, 2022 at 8:24 am #75801MatthewModeratorHi there,
Thank you for getting in touch with us, we do appreciate your time.
I am happy to hear that it is working well. With regards enabling the option on mobile only, you may be able to use custom JS code to achieve this:
jQuery(function($){ WPGMZA.Map.prototype.loadSettings = function(options){ var settings = new WPGMZA.MapSettings(this.element); var other_settings = settings.other_settings; delete settings.other_settings; if(options){ for(var key in options){ settings[key] = options[key]; } } var isMobileDevice = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); if(isMobileDevice){ settings.wpgmza_force_greedy_gestures = true; } else { settings.wpgmza_force_greedy_gestures = false; } this.settings = settings; } });
Please may you save the above code into the “Custom JS” setting block (Maps -> Settings -> Advanced Settings/Custom Scripts)?
Once this has been done, please clear your browser cache and confirm if this helps?
I look forward to hearing back from you.
Kindest Regards,
Matthew -
AuthorPosts
- You must be logged in to reply to this topic.