Skip to content

Commit

Permalink
Popup
Browse files Browse the repository at this point in the history
  • Loading branch information
JackGilmore committed Mar 17, 2024
1 parent 354843b commit 7fc5128
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,22 @@ <h3>Defects by type</h3>
extraClasses: "fa-solid"
});
var marker = L.marker([parseFloat(defect.Lat), parseFloat(defect.Lng)], { icon: icon });

var popupText = `<p class="h5">${defect["Problem type"]}</p>
<ul class="list-unstyled">
<li><strong>Reported:</strong> ${defect["Reported date"]}</li>
</ul>`;
debugger;

marker.bindPopup(popupText)
mapLayer.addLayer(marker);
});

mapLayer.addTo(map);

// 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 => {
Expand Down

0 comments on commit 7fc5128

Please sign in to comment.