When using a rather large google map on a smaller device like a phone or a small tablet it can sometimes become difficult to scroll down the page because the scrolling occurs within the map.

I could not find any setting in the module to turn of draggable so i wrote a JS behaviour to set draggable to false on a given viewport.

Drupal.behaviors.DisableDragMap = {
    attach: function (context, settings) {
      $(window).load(function() {
        if ($(document).width() < 600) {
          $('.geolocation-map').each(function () {
            id = $(this).attr('id').replace('geolocation-googlemaps-dynamic-', '');
            Drupal.geolocationGooglemaps.maps[id].setOptions({draggable: false});
          });
        }
      });
    }
  }

Perhaps this could be a future setting for the module? Or maybe i have looked over it. Anyway, feel free to close this issue if there is no request for this functionality.

Comments

strakkie created an issue. See original summary.

derjochenmeyer’s picture

Status: Active » Postponed

Thanks for sharing your solution. Any patches are welcome.

strakkie’s picture

Version: 7.x-1.6 » 7.x-1.x-dev
Status: Postponed » Needs review
StatusFileSize
new4.7 KB

Hi derjochenmeyer,

I have create a patch which gives allows users to disable dragging completely or below a given viewport width.

However, i have little knowledge of jQuery and especially when it comes to Drupal behaviors. Even though the patch works i doubt the changes in geolocation_googlemaps_dynamic_formatter.js are production-ready.

Any pointers on how to improve the patch are very welcome.

christianadamski’s picture

Component: Google Maps geolocation » Geolocation Field / Backend
Status: Needs review » Closed (won't fix)

Closing all 7.x issues. It's time.