title = $(this).text();
function updateMapKey() {
- $("#sidebar_content").load(url, {
- layer: map.baseLayer.keyid,
- zoom: map.getZoom()
+ var mapLayer = map.baseLayer.keyid,
+ mapZoom = map.getZoom();
+
+ $(".mapkey-table-entry").each(function () {
+ var data = $(this).data();
+
+ if (mapLayer == data.layer &&
+ mapZoom >= data.zoomMin && mapZoom <= data.zoomMax) {
+ $(this).show();
+ } else {
+ $(this).hide();
+ }
});
}
- updateMapKey();
+ $("#sidebar_content").load(url, updateMapKey);
+
openSidebar({ title: title });
$("#sidebar").one("closed", function () {