control.onAddPane = function (map, button, $ui) {
var $section = $("<div>")
- .attr("class", "section")
+ .attr("class", "p-3")
.appendTo($ui);
$ui
}
function update() {
- var layer = map.getMapBaseLayerId(),
+ var layerId = map.getMapBaseLayerId(),
zoom = map.getZoom();
$(".mapkey-table-entry").each(function () {
var data = $(this).data();
- if (layer === data.layer && zoom >= data.zoomMin && zoom <= data.zoomMax) {
- $(this).show();
- } else {
- $(this).hide();
- }
+ $(this).toggle(
+ layerId === data.layer &&
+ (!data.zoomMin || zoom >= data.zoomMin) &&
+ (!data.zoomMax || zoom <= data.zoomMax)
+ );
});
}
};