+ function closeMapKey() {
+ map.events.unregister("zoomend", map, updateMapKey);
+ map.events.unregister("changelayer", map, updateMapKey);
+ }
+
+ function updateMapKey() {
+ var layer = map.baseLayer.name.toLowerCase().replace(/\s+/g, "_");
+ var zoom = map.getZoom();
+
+ <%= remote_function :update => "sidebar_content",
+ :url => { :action => "key" },
+ :with => "'layer=' + layer + '&zoom=' + zoom",
+ :method => :get
+ %>