aboutsummaryrefslogtreecommitdiff
path: root/src/static
diff options
context:
space:
mode:
Diffstat (limited to 'src/static')
-rw-r--r--src/static/main.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/static/main.js b/src/static/main.js
index 58052b7..9bdaa11 100644
--- a/src/static/main.js
+++ b/src/static/main.js
@@ -13,6 +13,12 @@ var heatmap = L.featureGroup().addTo(map);
const CategoryField = document.getElementById('Category');
const LoadingIndicator = document.getElementById('LoadingIndicator');
+const form = document.getElementById('QueryForm');
+
+form.addEventListener('submit', (event) => {
+ event.preventDefault(); // Prevents the default form submission
+ runQueryAfterLoad()
+});
const DefaultSearchValue = "supermarket";
var Categories = []
@@ -27,6 +33,8 @@ var layerControl = L.control.layers({},overlayMaps).addTo(map);
function runQueryAfterLoad() {
LoadingIndicator.hidden = false;
+ markers.clearLayers();
+ polygons.clearLayers();
fetchAll(CategoryField.value);
}