From 679eb975a04d8c5baa0c02977281c1c3e2875894 Mon Sep 17 00:00:00 2001 From: Colin Wong Date: Tue, 5 Nov 2024 02:54:34 -0600 Subject: [PATCH] poster popup fix --- posters/templates/posters/poster_list.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/posters/templates/posters/poster_list.html b/posters/templates/posters/poster_list.html index 58ca50e..bfd2690 100644 --- a/posters/templates/posters/poster_list.html +++ b/posters/templates/posters/poster_list.html @@ -78,12 +78,11 @@

Posters

parseFloat(poster.longitude), ]); data.forEach((poster) => { - L.marker([ + var marker = L.marker([ parseFloat(poster.latitude), parseFloat(poster.longitude), - ]) - .bindPopup(L.popup().setContent(poster.location + " - " + poster.visits.count())) - .addTo(map); + ]).addTo(map); + marker.bindPopup(L.popup().setContent(poster.location + " - " + poster.visits.count())).openPopup(); }); }) .catch((error) => console.error("Error fetching poster data:", error));