From 260e946ab65a370fb82787da00c14dc64fca6bb1 Mon Sep 17 00:00:00 2001 From: W1CDN Date: Mon, 15 Jan 2024 11:52:30 -0600 Subject: [PATCH] Fool around with marker groups. --- api_app.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api_app.py b/api_app.py index a0ca74c..ed483d5 100644 --- a/api_app.py +++ b/api_app.py @@ -129,24 +129,28 @@ def map(): # Make markers for all the frames id_counter = 0 markers = '' + marker_ids = [] for frame in frames: if frame['latitude'] != None: # Create unique ID for each marker idd = 'frame' + str(id_counter) id_counter += 1 - # Create the marker and its pop-up for each shop + # Create each marker markers += "var {idd} = L.marker([{latitude}, {longitude}]);\ - {idd}.addTo(map).bindPopup('{from_ssid}');".format(idd=idd, latitude=frame['latitude'],\ + {idd}.addTo(map).bindTooltip('{from_ssid}', permanent=true).openTooltip();".format(idd=idd, latitude=frame['latitude'],\ longitude=frame['longitude'], from_ssid=frame['from'], created=frame['created']) + # Try to make a list of markers for Leaflet, but not working + marker_ids.append(idd) return render_template('map.html', station_lat = config['Settings']['station_lat'], station_lon = config['Settings']['station_lon'], - markers = markers) + markers = markers, + marker_ids = marker_ids) class Packets(Resource): def get(self):