Fool around with marker groups.

This commit is contained in:
W1CDN 2024-01-15 11:52:30 -06:00
parent 5fb589507e
commit 260e946ab6

View File

@ -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):