]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_key.rhtml
keys change depending on zoom level; force 210px sidebar width for keys
[rails.git] / app / views / site / _key.rhtml
index 2d8f1bc762b7f7053c6ad14245be82a55424c6f7..54ec829096681301d7ff41242e990d43d14be82c 100644 (file)
@@ -5,8 +5,12 @@
 <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<12) { var imgname='keymapnik'+zoomlevel+'.png'; }
+       else                   { var imgname='keymapnik12.png'; }
+    updateSidebar("Map key", "<p><img src='images/"+imgname+"' /></p>");
+    openSidebar("210px");
   }
 // -->
 </script>