]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_key.rhtml
Don't call formatChanged() when disabling XML output as it has side effects.
[rails.git] / app / views / site / _key.rhtml
index 54ec829096681301d7ff41242e990d43d14be82c..64309949815eadc0f80922876e3f8d304d800bfb 100644 (file)
@@ -5,12 +5,21 @@
 <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'; }
+    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");
+    openSidebar({ width: "210px" });
+  }
+
+  function updateKey() {
+    if (sidebarOpen("Map key")) 
+    {
+      showKey();
+    }
   }
 // -->
 </script>