diff --git a/assets/css/general.css b/assets/css/general.css index a4dfef717..0066ed66c 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -1398,3 +1398,7 @@ svg text.month { fill: #AAA; } display: flex; flex-direction: column; } + + .legendClose { + float: right; + } diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index 4ccde0863..7cca9cb3c 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -163,7 +163,9 @@ function plot(visitor, grid_two, grid_four, grid_six, grid_two_confirmed, grid_f if (grids != '') { legend.onAdd = function(map) { let div = L.DomUtil.create("div", "legend"); - html = ""; + div.setAttribute('id', 'gridmapLegend'); + html = '
X
'; + html += "
"; html += '' + gridsquares_gridsquares_confirmed + ' ('+grid_four_confirmed.length+')
'; html += '' + gridsquares_gridsquares_not_confirmed + ' ('+(grid_four.length - grid_four_confirmed.length)+')
'; html += ''; @@ -174,6 +176,8 @@ function plot(visitor, grid_two, grid_four, grid_six, grid_two_confirmed, grid_f } else { legend.onAdd = function(map) { let div = L.DomUtil.create("div", "legend"); + div.setAttribute('id', 'gridmapLegend'); + div.innerHTML += '
X
'; div.innerHTML += "

" + gridsquares_gridsquares + "

"; div.innerHTML += '' + gridsquares_gridsquares_confirmed + ' ('+grid_four_confirmed.length+')
'; div.innerHTML += '' + gridsquares_gridsquares_not_confirmed + ' ('+(grid_four.length - grid_four_confirmed.length)+')
'; @@ -283,6 +287,11 @@ function clearMarkers() { $(".ld-ext-right-clear").prop('disabled', false); } +function hideLegend() { + clearMarkers(); + $("#gridmapLegend").hide(); +} + $(document).ready(function(){ gridPlot(this.form, visitor); $(window).resize(function () {
' + gridsquares_gridsquares_total_worked + ' ('+(Math.round((grid_four.length / grid_max) * 10000) / 100)+'%):'+(grid_four.length)+' / '+grid_max+'