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 $("#sidebar_content").load(url, {
8 layer: map.baseLayer.keyid,
14 openSidebar({ title: title });
16 $("#sidebar").one("closed", function () {
17 map.events.unregister("zoomend", map, updateMapKey);
18 map.events.unregister("changelayer", map, updateMapKey);
21 map.events.register("zoomend", map, updateMapKey);
22 map.events.register("changelayer", map, updateMapKey);