]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_key.rhtml
api06: s/delete_with_relations_and_history/delete_with_history/g
[rails.git] / app / views / site / _key.rhtml
index 2d8f1bc762b7f7053c6ad14245be82a55424c6f7..64309949815eadc0f80922876e3f8d304d800bfb 100644 (file)
@@ -5,8 +5,21 @@
 <script type="text/javascript">
 <!--
   function showKey() {
-    updateSidebar("Map key", "<p><img src='images/keymapnik11.png' /></p>");
-    openSidebar();
+    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({ width: "210px" });
+  }
+
+  function updateKey() {
+    if (sidebarOpen("Map key")) 
+    {
+      showKey();
+    }
   }
 // -->
 </script>