Google Maps – Draggable = False

Hi,

I need to be able to set ‘draggable = false’ for the google map so that the map cannot be dragged on mobile. At the moment, on a touch screen, you cannot scroll down on the page once you get to the map as the map drags instead.

How can I achieve this?

Thanks

Gurdeep

  • Vaughan
    • Ex Staff

    Hi Sembisoft,

    Hope you’re well?

    currently I don’t think this is possible without some custom coding of the plugin. I’ve taken a quick look, but i’m not so sure as Javascript isn’t my expertise.

    But I will flag one of our SLS guys to see if he can come up with a quick solution for you in the meantime.

    Hopefully the developer should respond shortly.

    Thanks

  • Jude
    • DEV MAN

    Hey Gurdeep

    Sorry about the extreme delay here, it somehow slipped through the gaps. The easiest way to do this is

    add_filter( 'agm-save-options', function( $map_options, $data ) {
    $map_options['draggable'] = false ;
    return $map_options ;
    } );

    Let us know if you still need help with this. Keeping my eyes open on this.

    Thank you for being a WPMU DEV member and have a fantastic day!

    Cheers

    Jude