diff --git a/webgis/index.html b/webgis/index.html
index 27240cd..3b27187 100644
--- a/webgis/index.html
+++ b/webgis/index.html
@@ -139,6 +139,7 @@
+
diff --git a/webgis/js/controllers/form_controller.js b/webgis/js/controllers/form_controller.js
index e7cf907..404429f 100644
--- a/webgis/js/controllers/form_controller.js
+++ b/webgis/js/controllers/form_controller.js
@@ -2,6 +2,8 @@ import { Controller } from "@hotwired/stimulus";
import { GisState } from "../state.js";
import UI from "../ui.js";
+const html = String.raw;
+
export default class extends Controller {
static values = {
'coords': String,
@@ -9,7 +11,7 @@ export default class extends Controller {
'id': String,
};
- static targets = ['search'];
+ static targets = ['search', 'results'];
/**
*
@@ -25,7 +27,53 @@ export default class extends Controller {
}
const response = await fetch("https://caprigis-api.ddev.site:33001/search?" + new URLSearchParams(body));
+ const results = await response.json();
- console.debug(await response.json(), body);
+ console.debug(results);
+
+ this.#injectResults(results);
+ this.#filterMap(results);
+ }
+
+ #injectResults(results) {
+ /**
+ * @type {HTMLOutputElement} output
+ */
+ const output = this.resultsTarget;
+ output.innerHTML = '';
+
+ for (const result of results) {
+ const item = html`
+
${result.label}
+ `;
+
+ output.innerHTML += item;
+ }
+ }
+
+ /**
+ *
+ * @param {Array