X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fd8f35309d6149f3c4924dcf95beca8ec3bbf520..be931d0955fbd2379b1ffedb9abd32b1e8cb5915:/app/assets/javascripts/leaflet.layers.js?ds=sidebyside
diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js
index c506c951e..7703529b8 100644
--- a/app/assets/javascripts/leaflet.layers.js
+++ b/app/assets/javascripts/leaflet.layers.js
@@ -120,7 +120,7 @@ L.OSM.layers = function(options) {
var list = $('
')
.appendTo(overlaySection);
- function addOverlay(layer, name, minZoom) {
+ function addOverlay(layer, name, maxArea) {
var refName = name.split(' ').join('_').toLowerCase();
var item = $('- ')
.attr('class', refName)
@@ -153,7 +153,7 @@ L.OSM.layers = function(options) {
});
map.on('zoomend', function() {
- var disabled = map.getZoom() < minZoom + 1;
+ var disabled = map.getBounds().getSize() >= maxArea;
$(input).prop('disabled', disabled);
$(item).attr('class', disabled ? 'disabled' : '');
item.attr('data-original-title', disabled ?
@@ -161,8 +161,8 @@ L.OSM.layers = function(options) {
});
}
- addOverlay(map.noteLayer, I18n.t('javascripts.map.layers.notes'), 10);
- addOverlay(map.dataLayer, I18n.t('javascripts.map.layers.data'), 15);
+ addOverlay(map.noteLayer, I18n.t('javascripts.map.layers.notes'), OSM.MAX_NOTE_REQUEST_AREA);
+ addOverlay(map.dataLayer, I18n.t('javascripts.map.layers.data'), OSM.MAX_REQUEST_AREA);
}
options.sidebar.addPane($ui);
@@ -171,6 +171,7 @@ L.OSM.layers = function(options) {
e.stopPropagation();
e.preventDefault();
options.sidebar.togglePane($ui, button);
+ $('.leaflet-control .control-button').tooltip('hide');
}
return $container[0];