1 L.OSM.key = function (options) {
2 var control = L.OSM.sidebarPane(options, "key", null, "javascripts.key.title");
4 control.onAddPane = function (map, button, $ui) {
5 var $section = $("<div>")
6 .attr("class", "section")
13 map.on("baselayerchange", updateButton);
18 map.on("zoomend baselayerchange", update);
19 $section.load("/key", update);
23 map.off("zoomend baselayerchange", update);
26 function updateButton() {
27 var disabled = ["mapnik", "cyclemap"].indexOf(map.getMapBaseLayerId()) === -1;
29 .toggleClass("disabled", disabled)
30 .attr("data-bs-original-title",
32 "javascripts.key.tooltip_disabled" :
33 "javascripts.key.tooltip"));
37 var layer = map.getMapBaseLayerId(),
40 $(".mapkey-table-entry").each(function () {
41 var data = $(this).data();
42 if (layer === data.layer && zoom >= data.zoomMin && zoom <= data.zoomMax) {