From 4225af79667b24b8d9f43e862c4d557bd7222b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 15 Jun 2018 11:27:31 +0200 Subject: [PATCH] maps: don't add zoom controls if zoom level is fixed (#24569) --- combo/apps/maps/static/js/combo.map.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/combo/apps/maps/static/js/combo.map.js b/combo/apps/maps/static/js/combo.map.js index 0279a44..53c15ec 100644 --- a/combo/apps/maps/static/js/combo.map.js +++ b/combo/apps/maps/static/js/combo.map.js @@ -101,7 +101,9 @@ $(function() { } var map = L.map($map_widget[0], map_options); var map_controls_position = $('body').data('map-controls-position') || 'topleft'; - new L.Control.Zoom({position: map_controls_position}).addTo(map); + if (map_options.maxZoom != map_options.minZoom) { + new L.Control.Zoom({position: map_controls_position}).addTo(map); + } if (L.Control.Gps) { var gps_control = new L.Control.Gps({position: map_controls_position}); map.addControl(gps_control); -- 2.17.1