]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.key.js
Update runway and taxiway mapnik map key
[rails.git] / app / assets / javascripts / leaflet.key.js
index bcd5839cdad8891e183e2fcec8bf7c19b14e4191..088d0f9d3ea0fcf71cd36f10dd44090f8df35745 100644 (file)
@@ -39,11 +39,11 @@ L.OSM.key = function (options) {
 
       $(".mapkey-table-entry").each(function () {
         var data = $(this).data();
-        if (layer === data.layer && zoom >= data.zoomMin && zoom <= data.zoomMax) {
-          $(this).show();
-        } else {
-          $(this).hide();
-        }
+        $(this).toggle(
+          layer === data.layer &&
+          (!data.zoomMin || zoom >= data.zoomMin) &&
+          (!data.zoomMax || zoom <= data.zoomMax)
+        );
       });
     }
   };