<% content_for :left_menu do %>
<%= link_to_function "Map key", "showKey();" %>
<% end %>

<script type="text/javascript">
<!--
  function showKey() {
    var zoomlevel = map.getZoom();

    if (zoomlevel<7 )      { var imgname = 'keymapnik6.png'; }
    else if (zoomlevel<12) { var imgname = 'keymapnik'+zoomlevel+'.png'; }
    else                   { var imgname = 'keymapnik12.png'; }

    updateSidebar("Map key", "<p><img src='images/"+imgname+"' /></p>");
    openSidebar("210px");
  }

  function updateKey() {
    if (sidebarOpen("Map key")) 
    {
      showKey();
    }
  }
// -->
</script>

<% content_for :left_menu do %>
<%= link_to_function "Map key", "showKey();" %>
<% end %>

<script type="text/javascript">
<!--
  function showKey() {
    var zoomlevel = map.getZoom();

    if (zoomlevel<7 )      { var imgname = 'keymapnik6.png'; }
    else if (zoomlevel<13) { var imgname = 'keymapnik'+zoomlevel+'.png'; }
    else                   { var imgname = 'keymapnik13.png'; }

    updateSidebar("Map key", "<p><img src='images/"+imgname+"' /></p>");
    openSidebar("210px");
  }

  function updateKey() {
    if (sidebarOpen("Map key")) 
    {
      showKey();
    }
  }
// -->
</script>

Use the z13 key for z13 and over.
Use the z13 key for z13 and over.


