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
Comment #2
derjochenmeyer commentedThanks for sharing your solution. Any patches are welcome.
Comment #3
strakkie commentedHi 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.
Comment #4
christianadamski commentedClosing all 7.x issues. It's time.