From fe008958a0645ce062920d08346541c147cda528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 5 Dec 2018 15:38:34 +0100 Subject: [PATCH] maps: don't allow (at all) moving a map set to a fixed position (#28641) --- wcs/qommon/static/js/qommon.map.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wcs/qommon/static/js/qommon.map.js b/wcs/qommon/static/js/qommon.map.js index c551f37ce..3f27ded11 100644 --- a/wcs/qommon/static/js/qommon.map.js +++ b/wcs/qommon/static/js/qommon.map.js @@ -24,6 +24,10 @@ $(window).on('load', function() { L.latLng($map_widget.data('max-bounds-lat1'), $map_widget.data('max-bounds-lng1')), L.latLng($map_widget.data('max-bounds-lat2'), $map_widget.data('max-bounds-lng2'))); } + if ($map_widget.data('readonly') && $map_widget.attr('id') != 'backoffice-map') { + map_options.scrollWheelZoom = 'center'; + map_options.doubleClickZoom = 'center'; + } var map = L.map($(this).attr('id'), map_options); var map_controls_position = $('body').data('map-controls-position') || 'topleft'; new L.Control.Zoom({ @@ -55,6 +59,8 @@ $(window).on('load', function() { }).addTo(map); if ($map_widget.data('readonly') && $map_widget.attr('id') != 'backoffice-map') { map.dragging.disable(); + map.boxZoom.disable(); + map.keyboard.disable(); } else { map.addControl(gps_control); map.on('click', function(e) { -- 2.20.0.rc2