map and scrolling page by mouse – stop scroll

New home Forums Pro Add-on General queries map and scrolling page by mouse – stop scroll

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #75731
    knd
    Participant

    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

    #75765
    Matthew
    Moderator

    Hi 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,
    Matthew

    #75787
    knd
    Participant

    Hi,

    Yes it works good 🙂

    is possible to enable this option only for mobile?

    best regards
    M.

    #75801
    Matthew
    Moderator

    Hi 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

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.