- map.on('zoomend', function() {
- var disabled = map.getZoom() < minZoom + 1;
- $(input).prop('disabled', disabled);
- disabled ? $(item).attr('class', 'disabled') : $(item).attr('class', '');
- item.attr('data-original-title', disabled ?
- 'Zoom in to see ' + name.toLowerCase() : '');
+ map.on("zoomend", function () {
+ var disabled = map.getBounds().getSize() >= maxArea;
+ $(input).prop("disabled", disabled);
+
+ if (disabled && $(input).is(":checked")) {
+ $(input).prop("checked", false)
+ .trigger("change");
+ checked = true;
+ } else if (!disabled && !$(input).is(":checked") && checked) {
+ $(input).prop("checked", true)
+ .trigger("change");
+ }
+
+ $(item).attr("class", disabled ? "disabled" : "");
+ item.attr("data-original-title", disabled ?
+ I18n.t("javascripts.site.map_" + name + "_zoom_in_tooltip") : "");