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