maps: don't add zoom controls if zoom level is fixed (#24569)

This commit is contained in:
Frédéric Péters 2018-06-15 11:27:31 +02:00
parent ead713413b
commit 1e529e134d
1 changed files with 3 additions and 1 deletions

View File

@ -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);