diff options
-rwxr-xr-x | templates/web/base/dashboard/heatmap.html | 4 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/density-map.js | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/templates/web/base/dashboard/heatmap.html b/templates/web/base/dashboard/heatmap.html index d180af09a..ba5c10c17 100755 --- a/templates/web/base/dashboard/heatmap.html +++ b/templates/web/base/dashboard/heatmap.html @@ -40,9 +40,9 @@ In wards <select class="form-control js-multiple" multiple id="wards" name="ward </div> <p class="segmented-control segmented-control--radio"> - <input type="radio" name="heatmap" id="heatmap_yes" value="Yes"> + <input type="radio" name="heatmap" id="heatmap_yes" value="Yes" checked> <label class="btn" for="heatmap_yes">Heatmap</label> - <input type="radio" name="heatmap" id="heatmap_no" value="No" checked> + <input type="radio" name="heatmap" id="heatmap_no" value="No"> <label class="btn" for="heatmap_no">Pin map</label> </p> diff --git a/web/cobrands/fixmystreet/density-map.js b/web/cobrands/fixmystreet/density-map.js index d3516d09a..9febf66d7 100644 --- a/web/cobrands/fixmystreet/density-map.js +++ b/web/cobrands/fixmystreet/density-map.js @@ -26,6 +26,8 @@ $(function(){ return; } + var heatmap_on = $('input[name=heatmap]:checked').val() === 'Yes'; + var heat_layer = new Heatmap.Layer("Heatmap"); heat_layer.setOpacity(0.7); heat_layer.setVisibility(false); @@ -60,6 +62,11 @@ $(function(){ fixmystreet.markers.setVisibility(true); }); + if (heatmap_on) { + fixmystreet.markers.setVisibility(false); + heat_layer.setVisibility(true); + } + $('#sort').closest('.report-list-filters').hide(); $("#wards, #start_date, #end_date").on("change.filters", debounce(function() { |