aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-10-11 16:08:33 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-10-15 09:07:05 +0100
commit586736940541d6e779faed841b103ac4272b6db3 (patch)
tree6e8afe30c9dda5aad9609df5487fd801c9401d14
parent3550b5b2c0ca271a5505198a267ea8c9e94033f1 (diff)
Default heatmap page to showing heatmap.
-rwxr-xr-xtemplates/web/base/dashboard/heatmap.html4
-rw-r--r--web/cobrands/fixmystreet/density-map.js7
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() {