Support » Plugin: WP Google Maps » Disable 'draggable' only on mobile devices

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author WPGMaps

    (@wpgmaps)

    Hi there.

    Disabling dragging specific to a mobile device can only be done in the plugin’s code at this point in time.

    Would you be comfortable in making these changes?

    Hi there,

    I was searching for a solution too.
    As the author suggested I edited the core.js itself to disable the draggable option on mobile devices. I used the code from this solution.

    So here is what i did
    – Open core.js loacated in /js
    – Go to line 1086
    – Paste this code

    var isDraggable = !('ontouchstart' in document.documentElement);

    – Go to line 1011
    – Change

    wpgmza_settings_map_draggable = true;

    to

    wpgmza_settings_map_draggable = isDraggable;
    and
    wpgmza_settings_map_draggable = false;

    to

    wpgmza_settings_map_draggable = isDraggable;

    This did all the magic 🙂

    Greetings from Germany,
    Stephan

    Jarryd

    (@jarryd-long)

    Hi Stephan.

    Thank you very much for posting the code to perform this ‘magic’ 😉 We really appreciate it.

    No problem. Glad that i found a solution 🙂

    Jarryd

    (@jarryd-long)

    So glad to hear. Thanks again 🙂

    I couldn’t get the above solution to work on v6.4.00, but I found an easier solution:

    Just add:

    gestureHandling: ‘auto’

    to the myOptions array in /wp-google-maps/js/wpgmaps.js

    Then on mobile devices you can use two fingers to pan/zoom the map, and one finger to scroll the page.

    • This reply was modified 3 years, 2 months ago by tr1988.
    Jarryd

    (@jarryd-long)

    Hi @tr1988

    Thank you for posting your solution 🙂

    We’ve added in an option under ‘Maps’ -> ‘Settings’ that also allows you to do enable/disable this, however it isn’t mobile specific at this point in time.

    I can’t see that option in Maps > Settings and the current version of the plugin has no references to gestureHandling that I can find.

    Jarryd

    (@jarryd-long)

    Hi @tr1988

    Sorry for the confusion on my part.

    This option in the settings page is only available in the Pro version. Would you be comfortable making the above changes to get the desired effect?

    Yes, I’ve already made the changes.

    As the gestureHandling: ‘auto’ setting is a standard option of the free Google Maps API, could this also be made an option of the non-pro version of this plugin?

    You already support other standard options of the API such as Full Screen, StreetView, Pan Control, Scroll Wheel, Double Click Zoom, Zoom Controls etc. So this appears to be the only option not available to free users, and is quite essential for mobile usage.

    Thanks.

    Jarryd

    (@jarryd-long)

    Hi @tr1988

    I’ll see what we can do about introducing this option in the Basic version in the next update we release.

    My apologies for any inconvenience caused.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Disable 'draggable' only on mobile devices’ is closed to new replies.