1 $(document).ready(function () {
2 $("#open_map_key").click(function (e) {
3 var url = $(this).attr('href'),
4 title = $(this).text();
6 function updateMapKey() {
7 var mapLayer = map.baseLayer.keyid,
8 mapZoom = map.getZoom();
10 $(".mapkey-table-entry").each(function () {
11 var data = $(this).data();
13 if (mapLayer == data.layer &&
14 mapZoom >= data.zoomMin && mapZoom <= data.zoomMax) {
22 $("#sidebar_content").load(url, updateMapKey);
24 openSidebar({ title: title });
26 $("#sidebar").one("closed", function () {
27 map.events.unregister("zoomend", map, updateMapKey);
28 map.events.unregister("changelayer", map, updateMapKey);
31 map.events.register("zoomend", map, updateMapKey);
32 map.events.register("changelayer", map, updateMapKey);