From b27931f2f715d0e9e0b0d30f28ebc29d9e1f9aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 15 Jun 2018 13:21:20 +0200 Subject: [PATCH] maps: add data attribute to control map draggability (default: true) (#24580) --- combo/apps/maps/static/js/combo.map.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/combo/apps/maps/static/js/combo.map.js b/combo/apps/maps/static/js/combo.map.js index 24b772d..437b41f 100644 --- a/combo/apps/maps/static/js/combo.map.js +++ b/combo/apps/maps/static/js/combo.map.js @@ -100,6 +100,9 @@ $(function() { L.latLng($map_widget.data('max-bounds-lat2'), $map_widget.data('max-bounds-lng2'))) } var map = L.map($map_widget[0], map_options); + if ($map_widget.data('draggable') === false) { + map.dragging.disable(); + } var map_controls_position = $('body').data('map-controls-position') || 'topleft'; if (map_options.maxZoom != map_options.minZoom) { new L.Control.Zoom({position: map_controls_position}).addTo(map); -- 2.17.1