+$(document).ready(function () {
+ var updateMapKey = function () {
+ $("#sidebar_content").load("<%= url_for :action => :key %>", {
+ layer: map.baseLayer.keyid,
+ zoom: map.getZoom()
+ });
+ }
+
+ var closeMapKey = function () {
+ map.events.unregister("zoomend", map, updateMapKey);
+ map.events.unregister("changelayer", map, updateMapKey);
+ }
+
+ $("#open_map_key").click(function () {