maps: don't allow (at all) moving a map set to a fixed position (#28641)
This commit is contained in:
parent
b2a6af547c
commit
e78a942fb0
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue