Add simple map of stations #57

Merged
W1CDN merged 6 commits from map-1 into main 2024-11-20 10:54:30 -06:00
Showing only changes of commit 260e946ab6 - Show all commits

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