From 7fc512819b4746045470429d1d7d7189bfc530f6 Mon Sep 17 00:00:00 2001 From: Jack Gilmore <46202639+JackGilmore@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:23:27 +0000 Subject: [PATCH] Popup --- index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 19109b1..ac5806c 100644 --- a/index.html +++ b/index.html @@ -149,6 +149,14 @@

Defects by type

extraClasses: "fa-solid" }); var marker = L.marker([parseFloat(defect.Lat), parseFloat(defect.Lng)], { icon: icon }); + + var popupText = `

${defect["Problem type"]}

+ `; + debugger; + + marker.bindPopup(popupText) mapLayer.addLayer(marker); }); @@ -156,7 +164,7 @@

Defects by type

// Defects by type var sortedDefectsByType = Object.fromEntries( - Object.entries(defectTypes).sort(([, a], [, b]) =>b.length - a.length) + Object.entries(defectTypes).sort(([, a], [, b]) => b.length - a.length) ); var defectsByTypeHtml = Object.keys(sortedDefectsByType).map(x => {